To get started, you need to bootstrap the AWS accounts to support InfraWeave.
Ensure you have set up profiles for all your accounts, here is an example:
# Filename: ~/.aws/config
# ...
[profile central]
sso_account_id = 000000000000
regio = us-east-1
sso_session = aws-sso-session
sso_role_name = AdministratorAccess
[profile project1-dev]
sso_account_id = 111111111111
regio = us-east-1
sso_session = aws-sso-session
sso_role_name = AdministratorAccess
[profile project1-prod]
sso_account_id = 222222222222
regio = us-east-1
sso_session = aws-sso-session
sso_role_name = AdministratorAccess
[profile project2-dev]
sso_account_id = 333333333333
regio = us-east-1
sso_session = aws-sso-session
sso_role_name = AdministratorAccess
[sso-session aws-sso-session]
sso_start_url = https://d-1234567890.awsapps.com/start
sso_region = us-east-1
sso_registration_scopes = sso:account:access
Clone the aws-bootstrap which is designed to make it easy to get started.
It has the following structure:
.
├── LICENSE
├── README.md
├── central.tf
├── locals.tf
├── project-1.tf
└── project-2.tf
Before you bootstrap the control plane you need to configure it as you want.
Here are following configurations in locals.tf
:
environment
By default environment
is set to "prod", but if you want to have multiple control-planes, this parameter can be used. This local variable is passed to each module.
In order to use multiple environments, either have a copy of this folder per environment, or modify the code to handle all environments in this folder.
Modify the file central.tf
.
- Set up one central-module per region you want to support
- Configure a corresponding provider per region and name accordingly
In this example we have project1-dev
, project1-prod
and project2-dev
to demonstrate how it can be set up, each project has its own .tf
-file.
- Set up one workload-module per region you want to support
- Configure a corresponding provider per region and name accordingly
Ensure you have an active sso-sesion: aws sso login --profile sso-session
.
First time you need to ensure pull-through-cache has been set up and populated before infrastructure is bootstrapped.
There is a script prepared for this, modify it to your needs and run it ./setup_pull_through_cache.sh
Perform the bootstrapping by running
terraform init
terraform apply
This will bootstrap the entire platform in all desired AWS accounts.