aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap
[ChangeSet] - [Add more details to indicate potential changes ]
- Dominant language
- No language data
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
### Name of the resource
Other
### Resource name
_No response_
### Description
Hi team
Is it possible to add more details about whether or not a resource will be replaced after a changeset has been executed.
As an example, the changeset in the CloudFormation console will show the the NAT gateway "nat-xxxxxxxxx000" will be replaced i.e. ````Replacement = True```
However, the changeset JSON, the ````AfterValue```` is set to ````{{changeSet:KNOWN_AFTER_APPLY}}```` meaning the NAT gateway may not actually be replaced. See snippet below:
````
"ResourceChange": {
"PolicyAction": "ReplaceAndDelete",
"Action": "Modify",
"LogicalResourceId": "NAT_GW",
"PhysicalResourceId": "nat-xxxxxxxxx000",
"ResourceType": "AWS::EC2::NatGateway",
"Replacement": "True",
"Scope": [
"Properties"
],
"Details": [
{
"Target": {
"Attribute": "Properties",
"Name": "SubnetId",
"RequiresRecreation": "Always",
"Path": "/Properties/SubnetId",
"BeforeValue": "subnet-xxxxxxxxx000",
"AfterValue": "{{changeSet:KNOWN_AFTER_APPLY}}",
"AttributeChangeType": "Modify"
},
"Evaluation": "Static",
"ChangeSource": "ResourceReference",
"CausingEntity": "PublicSubnet4DMZ"
},
{
"Target": {
"Attribute": "Properties",
"Name": "SubnetId",
"RequiresRecreation": "Always",
"Path": "/Properties/SubnetId",
"BeforeValue": "subnet-xxxxxxxxx000",
"AfterValue": "{{changeSet:KNOWN_AFTER_APPLY}}",
"AttributeChangeType": "Modify"
},
"Evaluation": "Dynamic",
"ChangeSource": "DirectModification"
}
]
````
For context, this example involves nested stacks that have condition functions. Specifically in the [docs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html)
````"At stack creation or stack update, AWS CloudFormation evaluates all the conditions in your template before creating any resources. Resources that are associated with a true condition are created. Resources that are associated with a false condition are ignored. CloudFormation also re-evaluates these conditions at each stack update before updating any resources. Resources that are still associated with a true condition are updated. Resources that are now associated with a false condition are deleted."````
For the example, it therefore makes sense the the ````"AfterValue"```` is unknown.
Given this, Is it possible to add (for the console changeset) a value like like "Possibly modified" for "Replacement" to make it clear that the CloudFormation is not able to evaluate the values until after the stack updates?
Similarly, the JSON, is it possible to add some like ````"{{changeSet:KNOWN_AFTER_APPLY-Based on Changeset}}"```` to give more details about why the value is unknown
### Other Details
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.