エラー: 1 つの検証エラーが検出されました: 'code.s3Bucket' の値 'BATS::SAM::CodeS3Bucket' は制約を満たせませんでした: メンバーは正規表現パターンを満たす必要があります: ^[0-9A-Za-z.-_]*( ?
BATS::SAM::CodeS3Bucket の役割は何ですか
Conditions:
HasBucketKey:
Fn::Not:
- Fn::Equals:
- {Ref: BucketKey}
- ''
HasBucketName:
Fn::Not:
- Fn::Equals:
- {Ref: BucketName}
- ''
Parameters:
BucketKey: {Default: '', Type: String}
BucketName: {Default: '', Type: String}
Resources:
OriginAccessLambdaRole:
Properties:
AssumeRolePolicyDocument:
Statement:
- Action: ['sts:AssumeRole']
Effect: Allow
Principal:
Service: [lambda.amazonaws.com]
Version: '2012-10-17'
Policies:
- PolicyDocument:
Statement:
- Action: ['logs:CreateLogStream', 'logs:PutLogEvents', 'logs:CreateLogGroup']
Effect: Allow
Resource: '*'
- Action: ['cloudfront:*']
Effect: Allow
Resource: '*'
PolicyName: CloudFrontOAIPolicy
Type: AWS::IAM::Role
OriginAccessLambda:
DependsOn: [OriginAccessLambdaRole]
Properties:
Code:
S3Bucket:
Fn::If:
- HasBucketName
- {Ref: BucketName}
- BATS::SAM::CodeS3Bucket
S3Key:
Fn::If:
- HasBucketKey
- {Ref: BucketKey}
- BATS::SAM::CodeS3Key
Description: Creates an origin access identity
Handler: handlers.oai
MemorySize: 2048
Role:
Fn::GetAtt: [OriginAccessLambdaRole, Arn]
Runtime: python3.6
Timeout: 120
Type: AWS::Lambda::Function
Transform: AWS::Serverless-2016-10-31**
この私の cloudFormation テンプレート
IAM ロールは正常に作成されていますが、上記のラムダ作成中にエラーが発生します。
ありがとう