Terraform module that configures an AWS account for
Overmind infrastructure discovery. A single
terraform apply creates:
- An IAM role with a read-only policy in the target AWS account
- A trust policy allowing Overmind to assume the role via STS external ID
- An Overmind source registration pointing at the role
provider "overmind" {}
provider "aws" {
region = "us-east-1"
}
module "overmind_aws_source" {
source = "overmindtech/aws-source/overmind"
name = "production"
}| Name | Description | Type | Default | Required |
|---|---|---|---|---|
name |
Descriptive name for the source in Overmind | string |
n/a | yes |
regions |
AWS regions to discover (defaults to all non-opt-in regions) | list(string) |
All 17 standard regions | no |
role_name |
Name for the IAM role created in this account | string |
"overmind-read-only" |
no |
tags |
Additional tags to apply to IAM resources | map(string) |
{} |
no |
| Name | Description |
|---|---|
role_arn |
ARN of the created IAM role |
source_id |
UUID of the Overmind source |
external_id |
AWS STS external ID used in the trust policy |
Use AWS provider aliases to onboard several accounts at once:
provider "overmind" {}
provider "aws" {
alias = "production"
region = "us-east-1"
assume_role { role_arn = "arn:aws:iam::111111111111:role/terraform" }
}
provider "aws" {
alias = "staging"
region = "eu-west-1"
assume_role { role_arn = "arn:aws:iam::222222222222:role/terraform" }
}
module "overmind_production" {
source = "overmindtech/aws-source/overmind"
name = "production"
providers = {
aws = aws.production
overmind = overmind
}
}
module "overmind_staging" {
source = "overmindtech/aws-source/overmind"
name = "staging"
regions = ["eu-west-1"]
providers = {
aws = aws.staging
overmind = overmind
}
}If you already created an Overmind AWS source through the UI and want to manage it with Terraform, you can import it using the source UUID (visible on the source details page in Settings > Sources):
terraform import module.overmind_aws_source.overmind_aws_source.this <source-uuid>After importing, run terraform plan to verify the state matches your
configuration. Terraform will show any drift between the imported resource and
your HCL.
The Overmind provider reads OVERMIND_API_KEY from the environment. The API key
must have sources:write scope.
The AWS provider must have permissions to create IAM roles and policies in the target account.
| Name | Version |
|---|---|
| terraform | >= 1.5.0 |
| aws | >= 6.0 |
| overmind | >= 0.1.0 |