Skip to content

Conversation

@sbkok
Copy link
Collaborator

@sbkok sbkok commented Aug 31, 2022

Why?

After updating the CloudFormation template for a ADF pipeline, it tries to update the termination protection flag on the stack. This will fail as the permissions are not configured yet. The failure it returned was:

2022-08-30 14:22:24,295 | ERROR | cloudformation | 111111111111 | adf-pipeline-some-pipeline, Error: An error occurred (AccessDenied) when calling the UpdateTerminationProtection operation: User: arn:aws:sts::111111111111:assumed-role/adf-global-base-deploymen-PipelineManagementCodeBu-xxxxxxxxxxxxx/AWSCodeBuild-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is not authorized to perform: cloudformation:UpdateTerminationProtection on resource: arn:aws:cloudformation:eu-west-1:111111111111:stack/adf-pipeline-some-pipeline/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx because no identity-based policy allows the cloudformation:UpdateTerminationProtection action | (cloudformation.py:230)

What?

Adding permission to call the CloudFormation UpdateTerminationProtection API.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

**Why?**

After updating the CloudFormation template for a ADF pipeline, it tries to
update the termination protection flag on the stack. This will fail as the
permissions are not configured yet. The failure it returned was:

> 2022-08-30 14:22:24,295 | ERROR | cloudformation | 111111111111 | adf-pipeline-some-pipeline, Error: An error occurred (AccessDenied) when
> calling the UpdateTerminationProtection operation: User:
> arn:aws:sts::111111111111:assumed-role/adf-global-base-deploymen-PipelineManagementCodeBu-xxxxxxxxxxxxx/AWSCodeBuild-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
> is not authorized to perform: cloudformation:UpdateTerminationProtection on resource:
> arn:aws:cloudformation:eu-west-1:111111111111:stack/adf-pipeline-some-pipeline/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
> because no identity-based policy allows the cloudformation:UpdateTerminationProtection action | (cloudformation.py:230)

**What?**

Adding permission to call the CloudFormation UpdateTerminationProtection API.
@sbkok sbkok added the bug Something isn't working label Aug 31, 2022
@sbkok sbkok added this to the v3.2.0 milestone Aug 31, 2022
@sbkok sbkok requested review from StewartW and javydekoning August 31, 2022 07:46
runtime-versions:
python: 3.9
nodejs: 14
pre_build:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this been removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the next lines are installation steps, not pre-build commands.
This has always been a pre-build step before, so not something that was introduced incorrectly.
I just figured it makes more sense to put it in the install step instead, as that is what it is doing.

Copy link
Contributor

@javydekoning javydekoning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sbkok sbkok merged commit 4fadf09 into awslabs:master Aug 31, 2022
@sbkok sbkok deleted the fix/cfn-update-termination-protection branch August 31, 2022 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants