aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 54 forks source link

"Template error: resource EC2Instance does not support attribute type Id in Fn::GetAtt" #1879

Open ksdawson opened 8 months ago

ksdawson commented 8 months ago

Name of the resource

AWS::EC2::Instance

Resource Name

No response

Issue Description

CloudFormation documentation lists the attribute Id as one of the attributes available in Fn::GetAtt (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#aws-resource-ec2-instance-return-values). However, I get the error "Template error: resource EC2Instance does not support attribute type Id in Fn::GetAtt" when attempting to use it.

Expected Behavior

The attribute Id should be available to use in Fn::GetAtt.

Observed Behavior

The attribute Id is not available to use in Fn::GetAtt.

Test Cases

Tested in the regions us-west-1, us-west-2, us-east-1, and us-east-2.

Other Details

No response

ThorHammerTime commented 6 months ago

I ran into the same error and noted the documentation states a !GetAtt: instance.Id is valid. The only thing I saw was the default/!Ref return is for the instance ID, ie !Ref instance. I might consider this a documentation error as other Cloudformation Resources I can think of do not duplicate the default !Ref value with a !GetAtt.