This module creates the necessary infrastructure on your AWS accounts to integrate the nOps Compute Copilot ASG product with your environments.
- Creation of a nASG Lambda and related resources such as event bus to react to EC2 events
- Creation of IAM roles with minimum privileges for the Lambdas to run
- Self test and checks when deploying
- Auto update of main Lambda when a new version is deployed
- Integration with nOps APIs for metadata fetching
- Terraform v1.0+
- AWS CLI configured with appropriate permissions
- nOps API key
In order to onboard your AWS account with the nOps ASG product, use the following snippet while being logged in onto the target account.
We only support us-east-1
and us-west-2
as deployment regions for the main module, deployment will fail if other regions are attempted.
terraform {
required_providers {
nops = {
source = "nops-io/nops"
}
aws = {
source = "hashicorp/aws"
}
}
}
provider "nops" {
nops_api_key = "XXXX.XXXXXX"
}
module "cc_asg" {
source = "nops-io/nops-compute-copilot-asg-onboarding/aws"
token = "XXXX.XXXXXXXXX"
}
After the previous deployment finishes, onboard additional regions by deploying the forwarder
submodule into the desired regions.
terraform {
required_providers {
nops = {
source = "nops-io/nops"
}
aws = {
source = "hashicorp/aws"
}
}
}
provider "nops" {
nops_api_key = "XXXX.XXXXXX"
}
module "cc_asg_forwarder" {
source = "nops-io/nops-compute-copilot-asg-onboarding/aws//modules/forwarder"
# Region where the main module was deployed, either us-east-1 or us-west-2.
nasg_central_region = "us-east-1"
}
Name | Version |
---|---|
terraform | >= 1.5 |
archive | >= 2.7.0 |
aws | >= 4.0 |
nops | ~> 0.0.7 |
Name | Version |
---|---|
archive | >= 2.7.0 |
aws | >= 4.0 |
nops | ~> 0.0.7 |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
environment | nASG environment | string |
"prd" |
no |
exclude_regions | Comma-separated list of AWS region codes to exclude from deployment (e.g., us-west-1,eu-west-3). | string |
"" |
no |
memory_size | Lambda function total memory in MB | number |
2048 |
no |
timeout | Lambda function timeout in seconds | number |
900 |
no |
token | Nops Client Token | string |
n/a | yes |
No outputs.