Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(experimental-ec2-pattern): Create Policy first #2464

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akash1810
Copy link
Member

What does this change?

When deploying Prism with the GuEc2AppExperimental for the first time, the deployment failed with the cloud-init-output logs stating:

An error occurred (AccessDenied) when calling the DescribeTargetHealth operation: User: arn:aws:sts::000000000000:assumed-role/prism-CODE-InstanceRolePrism/i-0cee86d64de253ca4 is not authorized to perform: elasticloadbalancing:DescribeTargetHealth because no identity-based policy allows the elasticloadbalancing:DescribeTargetHealth action

This suggests the instance update was started before the policy that grants these permissions was created.

Make the ASG depend on the policy that grants these permissions to resolve, as CloudFormation creates dependencies first.

How to test

See updated test.

How can we measure success?

Improved stability.

Have we considered potential risks?

N/A.

Checklist

  • I have listed any breaking changes, along with a migration path 1
  • I have updated the documentation as required for the described changes 2

Footnotes

  1. Consider whether this is something that will mean changes to projects that have already been migrated, or to the CDK CLI tool. If changes are required, consider adding a checklist here and/or linking to related PRs.

  2. If you are adding a new construct or pattern, has new documentation been added? If you are amending defaults or changing behaviour, are the existing docs still valid?

When deploying Prism with the `GuEc2AppExperimental` for the first time,
the deployment failed with the cloud-init-output logs stating:

```log
An error occurred (AccessDenied) when calling the DescribeTargetHealth operation: User: arn:aws:sts::000000000000:assumed-role/prism-CODE-InstanceRolePrism/i-0cee86d64de253ca4 is not authorized to perform: elasticloadbalancing:DescribeTargetHealth because no identity-based policy allows the elasticloadbalancing:DescribeTargetHealth action
```

This suggests the instance update was started before the policy that grants these permissions was created.

Make the ASG depend on the policy that grants these permissions to resolve,
as CloudFormation creates dependencies first.
@akash1810 akash1810 requested a review from a team as a code owner September 19, 2024 18:06
Copy link

changeset-bot bot commented Sep 19, 2024

🦋 Changeset detected

Latest commit: 1110a11

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@guardian/cdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant