无法验证以下目标配置(服务:Amazon S3;状态码

时间:2019-06-10 13:26:47

标签: amazon-web-services amazon-s3 aws-lambda

无法验证以下目标配置(服务:Amazon S3;状态码

MyBucket:
    Type: AWS::S3::Bucket
    Properties:
      AccessControl: Private
      BucketEncryption:
        ServerSideEncryptionConfiguration:
        - ServerSideEncryptionByDefault:
            SSEAlgorithm: aws:kms
      VersioningConfiguration:
        Status: Enabled
      BucketName: {Bucketname}
      NotificationConfiguration:
        LambdaConfigurations:
          - Event: 's3:ObjectCreated:*'
            Function: !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${BucketName}   Filter:
              S3Key:
                Rules:
                  -
                    Name: suffix
                    Value: ".txt"            
      PublicAccessBlockConfiguration:
        BlockPublicAcls: True
        BlockPublicPolicy: false
        IgnorePublicAcls: True
        RestrictPublicBuckets: True

    Permission:
    Type: AWS::Lambda::Permission
    DependsOn:
      -myFunction
    Properties:
      Action: lambda:InvokeFunction
      #EventSourceToken: !GetAtt myFunction.Arn

      #FunctionName: !GetAtt myFunction.Arn
      FunctionName:
        "Fn::GetAtt": [ myFunction, Arn ]      
      Principal: s3.amazonaws.com
      SourceArn: !Sub arn:aws:s3:::${bukcetName}

0 个答案:

没有答案