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

feat(test): test IAM setup with CF templates on fresh account #3262

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

Conversation

InesNi
Copy link
Contributor

@InesNi InesNi commented Jul 11, 2024

Description

Two main changes:

1. Merging the two CF templates used for GitHub OIDC IAM setup into one template.

This way the IAM role created will have permission needed to run tests on both Lambda and Fargate, and only one Launch Stack button will be needed in our GitHub Actions guide.

2. Adding automated tests for CloudFormation (CF) templates

Testing that the IAM role created from the github-oidc.yml CF template has the correct permissions to be able to run Artillery tests on Lambda and Fargate and that the OIDC is set correctly.

  • We do this by building on the Publish CloudFormation templates to AWS S3 Github action creating the following flow:

    • The templates are published to S3
    • Then the set-up-and-run-artillery-test-on-aws job runs for both Lambda and Fargate but one at a time:
      • Relevant resources are deleted from the AWS account used for testing with aws-nuke, essentially simulating a fresh account
      • We get the GitHub OIDC template from S3 and deploy the stack
      • The created ArtilleryGitHubOIDCRole IAM role is assumed
      • Existing test files are triggered: the lambda-smoke.test.js for Lambda and dd-adot.test.js for Fargate.
  • The action will be triggered by Publish packages to NPM and Publish packages to NPM (canary) runs. Due to this a canary version of templates has been implemented as well.

Pre-merge checklist

  • Does this require an update to the docs?
  • Does this require a changelog entry?

@InesNi InesNi marked this pull request as draft July 11, 2024 12:12
@InesNi InesNi force-pushed the ifazlic-art-1855-automated-e2e-test-for-cloudformation-templates branch from fb76207 to 603973b Compare July 11, 2024 13:51
@InesNi InesNi marked this pull request as ready for review July 11, 2024 13:52
@InesNi InesNi force-pushed the ifazlic-art-1855-automated-e2e-test-for-cloudformation-templates branch from 603973b to f9abdc6 Compare July 11, 2024 14:46
@InesNi InesNi force-pushed the ifazlic-art-1855-automated-e2e-test-for-cloudformation-templates branch from f9abdc6 to 2c68262 Compare July 11, 2024 14:48
@InesNi InesNi requested a review from a team July 16, 2024 08:31
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