-
Notifications
You must be signed in to change notification settings - Fork 2
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
Create non-default VPC in network layer #72
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ticket
Resolves #152
Changes
project-config
mapping network names to network-specific configsinfra/modules/network
module that creates a nondefault VPC with a basic default configuration that contains:infra/networks/main.tf
):infra/modules/network
to create non-default VPCnetwork_name
property to the application environment config (env-config) to map environments to networksenvironment_config.network_name
. This is done using thenetwork_name
AWS tag. Also reference the appropriate subnets (public and private subnets for the service layer and database subnets for the database layer) by using thenetwork_name
andnetwork_type
tags.Context for reviewers
It turns out we needed nondefault VPC sooner than realized so this is a bit of a rushed implementation of nondefault VPC that follows the WIP VPC tech spec.
Notably, in the default implementation we added a single NAT Gateway which is needed by ECS Fargate to start up the ECS task. It might be possible to achieve this without a NAT Gateway but that will take additional investigation.
Testing
In order to not break
dev
, I did everything in a newstaging
environment sincestaging
didn't exist. I followed these steps for testing:I configured and created the network
I deployed the database layer for the staging environment
I ran the role manager to provision the database roles and ran the role checker as well
I pushed the branch and ran the build-and-publish workflow.
See workflow run
I ran the deploy workflow from this branch, which runs migrations and deploys to the service layer
See workflow run
I hit an endpoint that touches the database to see that it works: http://app-staging-701758158.us-east-1.elb.amazonaws.com/migrations
Note: I temporarily turned off CI Infra Service since that's destined to fail since the service layer no longer points to the default VPC