aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

Why replacement is true. When `GetAtt` use full function change to short function.

Open
#290 2 comments 6 reactions 0 assignees View on GitHub
enhancement
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

## GetAtt full vs. short function

Quick Sample Summary:
1. Create full function NatGateway resources.
```
NatEipA:
Type: "AWS::EC2::EIP"
Properties:
Domain: "vpc"
NatGatewayA:
Type: "AWS::EC2::NatGateway"
Properties:
AllocationId:
"Fn::GetAtt": [ "NatEipA", "AllocationId" ]
SubnetId:
Ref: "PublicSubnetA"
```

2. Update short function NatGateway resources.
```
NatEipA:
Type: "AWS::EC2::EIP"
Properties:
Domain: "vpc"
NatGatewayA:
Type: "AWS::EC2::NatGateway"
Properties:
AllocationId: !GetAtt NatEipA.AllocationId
SubnetId: !Ref "PublicSubnetA"
```

3. View changeSet ...
```
{
"resourceChange": {
"logicalResourceId": "NatGatewayA",
"action": "Modify",
"physicalResourceId": "nat-004ff195bd7211691",
"resourceType": "AWS::EC2::NatGateway",
"replacement": "True",
"details": [
{
"target": {
"name": "AllocationId",
"requiresRecreation": "Always",
"attribute": "Properties"
},
"causingEntity": null,
"evaluation": "Static",
"changeSource": "DirectModification"
}
],
"scope": [
"Properties"
]
},
"type": "Resource"
},
```

5. Check `NatEipA` resource not in change lists.
---

When `GetAtt` use full function change to short function.
- Why action is `Modify`?
- Why replacement is `true`?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.