Unchanged Cloudformation template results in creation of new ec2 resource

0

How can I determine what caused a nested Cloudformation stack to be updated when I made no changes to the template?

To be clear: I have a script that uploads my templates to s3, and I always upload them all even if I didn't change them, so in S3 I think the modified date is still changed. But I'm pretty sure this shouldn't trigger an update to the stack? In this case, I had changed a different template and was running an update for that.

Part of the reason I'm learning Cloudformation is to build my infra with some predictability - if I have some components relying on specific ec2 instance IDs, unpredictable replacements will be a hassle to manage because I'll have to go around updating IDs in configurations (for example variables for my Github Actions CD pipeline across multiple repos.)

In this case the unwanted update was for a template that creates these resources:

  • AWS::IAM::Role
  • AWS::IAM::InstanceProfile
  • AWS::EC2::Instance.

What I did change was an AWS::IAM::RolePolicy in a different template for the same parent stack, adding the following actions:

  • For my VPC resource: ec2:CreateVpcEndpoint, ec2:DeleteVpcEndpoints
  • For an S3 bucket: s3:PutObject

Are there internal updates in AWS that might trigger updates, like a new version of an AMI or something?

질문됨 2달 전408회 조회
1개 답변
1

Uploading a new template file to S3, even without any modifications, updates the file's metadata such as the last modified date. CloudFormation may interpret this as a change and proceed to update the stack.

profile picture
전문가
답변함 한 달 전
  • Even if the "changed file" resulted in no changes to the resource itself?

  • What's strange is that there are three other sub-stacks that don't get updated, despite also having files uploaded to S3.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠