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

Support new COOL environment structure #393

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

dav3r
Copy link
Member

@dav3r dav3r commented Jan 17, 2025

🗣 Description

This PR makes updates in support of the switchover from our legacy account/environment scheme (where staging and production accounts exist within the same AWS organization) to our new scheme (where they do not).

Highlights include:

💭 Motivation and context

The goal of this PR is to get us closer to our modernized account scheme where there is no more co-mingling of staging and production accounts. Doing that will result in cleaner code across all COOL-related repositories as well as improved separation of resources across all COOL environments.

🧪 Testing

The x86 and ARM AMIs were successfully created in the dev environment via the build workflow. I applied the updated terraform-post-packer and it ran, though it doesn't really do anything since we don't have any dynamic "env*" accounts created yet in the dev environment.

The x86 and ARM AMIs were successfully created in the staging-a environment via the prerelease workflow. I applied the updated terraform-post-packer and it ran successfully. Since I used a tfvars file that shared the AMIs with the legacy staging env* accounts, I confirmed via the AWS GUI that the new AMIs were indeed shared with those legacy staging accounts.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • All new and existing tests pass.

✅ Pre-merge checklist

  • Revert dependencies to default branches (terraform-build-user/main.tf)
  • Set final (release) version to 2.0.0+build.2 (at least, I think that is what we should do here - if you have a different opinion, please speak up in the PR discussion below).

✅ Post-merge checklist

  • Create a release.

dav3r added 17 commits January 15, 2025 16:27
This lets us avoid hardcoding the bucket name and allows it to be set on a per-environment basis via the -backend-config command line option or other methods.  For details, see: https://developer.hashicorp.com/terraform/language/backend#partial-configuration
…emote states

Also, make all remote states use the same environment (no more mixed staging and production states).
This is the extension I chose for our backend config files.
Also, assume the newly-renamed and environment-specific build role.
Now that we have a suitable dev environment, we want to create AMIs there.  Previously, we did not create AMIs until the prerelease workflow was run.
Also, assume the newly-renamed and environment-specific build role.
This lets us avoid hardcoding the bucket name and allows it to be set on a per-environment basis via the -backend-config command line option or other methods.  For details, see: https://developer.hashicorp.com/terraform/language/backend#partial-configuration
…d accounts

This can be done thanks to our new scheme which no longer has staging and production accounts co-mingled in the same AWS organization.
@dav3r dav3r added the improvement This issue or pull request will add or improve functionality, maintainability, or ease of use label Jan 17, 2025
@dav3r dav3r self-assigned this Jan 17, 2025
@dav3r dav3r deployed to staging-a January 17, 2025 17:09 — with GitHub Actions Active
@dav3r dav3r marked this pull request as ready for review January 17, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant