zingroo
zingroo

Reputation: 1

When trying to create an S3 bucket with the following config, keep on running into this error: Template validation error

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>.

I have been referencing this.

Upvotes: 0

Views: 125

Answers (1)

maafk
maafk

Reputation: 6876

Check the return values for AWS::S3::Bucket

For the WebsiteURL output, try:

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

Upvotes: 1

Related Questions