尝试使用以下配置创建S3存储桶时,请继续遇到此错误:模板验证错误


BucketUser:
    Type: AWS::IAM::User 
    Properties:
      PolicyName: InTheBucket  
      PolicyDocument:
        Version: '2012-10-17'
        Statement:
        - Effect: Allow
          Action:
          - s3:GetObject
          - s3:PutObject
          - s3:PutBucketCORS
          - s3:PutObjectAcl
          Resource: arn:aws:s3:::flask-Bucket
BucketKey:
    Type: AWS::IAM::AccessKey
    Properties:
      Username:
        !Ref BucketUser
Outputs:
  WebsiteURL:
    Value: !GetAtt S3Bucket
    Export:
      Name: S3Bucket
  BucketKey:
    Value: !Ref BucketKey
    Export:
      Name: BucketKey
  SecretAccessKey:
    Value: !GetAtt BucketKey.SecretAccessKey
    Export:
      Name: SecretAccessKey
Error name :  Template error: if specifying one argument to Fn::GetAtt,   
that argument must be a non-empty string in format <LogicalId>.<Attribute>.

我一直在引用此。

检查 AWS::S3::Bucket

的返回值

对于WebsiteURL输出,请尝试:

WebsiteURL:
  Value: !GetAtt S3Bucket.WebsiteURL
  Export:
    Name: S3Bucket

相关内容

  • 没有找到相关文章