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

[Cloudformation] - [BUG] - change-set is not correctly reflected

Open
#2,053 2 comments 0 reactions 0 assignees View on GitHub
bug NeedTriage
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
AWS::CloudFormation::Stack

### Issue Description

When we are updating the nested stack at the parent level, if I remove a resource or add a resource, it will trigger modifications for other child stacks within the changeset. For example:
AWSTemplateFormatVersion: '2010-09-09'
Description: An example template for a Step Functions state machine.
Resources:
StateMachineName:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://thisisas3.s3.amazonaws.com/state

thisiss3one:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://thisisas3.s3.amazonaws.com/s3one.yml

iamdummy:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://thisisas3.s3.amazonaws.com/iamdummy.yml

anotherone:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: codeguru-profiler.amazonaws.com
Action: 'sts:AssumeRole'
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonS3FullAccess
RoleName: anotherolequestionmark

In here, I will be removing the anotherone resource, but that will cause a modification to the other resources.

### Expected Behavior

As we only removed the resource 'anotherone', I will expect that only the removed resource shows in the changeset.

### Observed Behavior

When I removed one resource from the parent stack, it showed all the resources as modified even though they were not changed.

### Test Cases

AWSTemplateFormatVersion: '2010-09-09'
Description: An example template for a Step Functions state machine.
Resources:
StateMachineName:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://thisisas3.s3.amazonaws.com/state

thisiss3one:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://thisisas3.s3.amazonaws.com/s3one.yml

iamdummy:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://thisisas3.s3.amazonaws.com/iamdummy.yml

anotherone:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: codeguru-profiler.amazonaws.com
Action: 'sts:AssumeRole'
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonS3FullAccess
RoleName: anotherolequestionmark

### Other Details

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the nested AWS::CloudFormation::Stack update using the supplied parent templates and inspect the resulting change set. Compare a removal of anotherone with the reported modifications to the unchanged child stacks; done means the change set reports only the resource that was removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.