aws-config
This component provisions AWS Config across all accounts in an AWS Organization. AWS Config is a service that enables you to assess, audit, and evaluate the configurations of your AWS resources. It continuously monitors and records configuration changes to your AWS resources and provides a detailed view of the relationships between those resources.
Component Features
This component is responsible for:
- Configuration Recording: Deploys Configuration Recorders in each account and region to track resource configurations
- Centralized Aggregation: Configures a designated account (typically
security) as the central aggregation point for all AWS Config data - Compliance Monitoring: Deploys conformance packs to monitor resources for compliance with best practices and industry standards (e.g., CMMC, CIS, HIPAA)
- Configuration Storage: Delivers configuration snapshots and history to a centralized S3 bucket (typically in the
auditaccount) - Organization-wide Conformance Packs: Deploys organization conformance packs from the management account that automatically apply to all member accounts
- SNS Topic Encryption: Creates encrypted SNS topics for AWS Config notifications (required for CMMC compliance)
- Account Verification: Optional safety check that validates Terraform is running in the correct AWS account
- Flexible Account Map: Supports both remote-state account-map lookups and static account map variables (default)
New Features
This version includes several enhancements:
- Local Conformance Pack Support: Load conformance packs from local files in addition to remote URLs. This enables custom packs, air-gapped deployments, and version-controlled compliance rules.
- Organization Conformance Packs: Deploy conformance packs organization-wide from the management account using the
scope: organizationsetting. - SNS Topic Encryption: Built-in support for KMS encryption of AWS Config SNS topics (
sns_encryption_key_idvariable) for CMMC compliance. - Flexible Component Naming: The
global_collector_component_name_patternvariable allows customization of how the component looks up the global collector region's remote state. - GovCloud Support: Full support for AWS GovCloud regions and partitions.
Key AWS Config Capabilities
- Configuration History: Maintains a detailed history of changes to AWS resources, showing when changes were made, who made them, and what the changes were
- Configuration Snapshots: Takes periodic snapshots of resource configurations for point-in-time views
- Compliance Monitoring: Provides pre-built rules and checks for compliance with best practices and industry standards
- Relationship Mapping: Maps relationships between AWS resources to understand change impacts
- Notifications and Alerts: Sends notifications when configuration changes impact compliance or security posture
Architecture
The component deploys a multi-account, multi-region architecture:
┌─────────────────────────────────────────────────────────────────────────────┐
│ AWS Organization │
│ │
│ ┌────────────────────────────────────────────────────────────────────────┐ │
│ │ Management Account (Organization Conformance Packs) │ │
│ │ - Deploys organization-wide conformance packs │ │
│ │ - Packs automatically apply to all member accounts │ │
│ └────────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────────────────────────┐ │
│ │ Security Account (Central Aggregator) │ │
│ │ - AWS Config Aggregator (collects from ALL accounts) │ │
│ │ - Centralized compliance dashboard │ │
│ └────────────────────────────────────────────────────────────────────────┘ │
│ ▲ ▲ ▲ │
│ │ │ │ Aggregate Authorizations │
│ │ │ │ │
│ ┌────────────────────────────────────────────────────────────────────────┐ │
│ │ Audit Account │ │
│ │ - S3 Bucket (aws-config-bucket) │ │
│ │ - Stores ALL Config data from all accounts ◄───────────────┐ │ │
│ └──────────────────────────────────────────────────────────────│──────────┘ │
│ │ │
│ ┌────────────────────────────────────────────────────────────┐ │ │
│ │ Each Member Account │ │ │
│ │ │ │ │
│ │ Global Collector Region (e.g., us-east-1): │ │ │
│ │ ✓ Configuration Recorder │ │ │
│ │ ✓ IAM Role (created once per account) │ │ │
│ │ ✓ Tracks global resources (IAM, Route53, etc.) │ │ │
│ │ ✓ Aggregate Authorization → Security Account │─┘ │
│ │ ✓ Delivery Channel → S3 Bucket (audit) ────────────────────────────────┘
│ │ │ │
│ │ Additional Regions (e.g., us-west-2): │ │
│ │ ✓ Configuration Recorder │ │
│ │ ✓ References IAM Role from global collector region │ │
│ │ ✓ Tracks regional resources (EC2, VPC, RDS, etc.) │ │
│ │ ✓ Delivery Channel → S3 Bucket (audit) ────────────────────────────────┘
│ └────────────────────────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────────────────┘
Architecture Benefits
- Centralized Compliance: Security team can view all resource configurations from one account
- Cost Efficiency: Single S3 bucket for all AWS Config data (in audit account)
- Security Best Practices: Aggregation in security account aligns with AWS Well-Architected Framework
- Scalability: Easy to add new accounts and regions without changing the aggregation setup
- GovCloud Compatible: Supports AWS GovCloud regions and partitions
AWS Config Limitations
Be aware of these AWS Config limitations:
- Maximum 1000 AWS Config rules per account can be evaluated
- Mitigate by removing duplicate rules across packs
- Remove rules that don't apply to any resources
- Consider scheduling pack deployment with Lambda for more than 1000 rules
- See the Audit Manager docs for converting conformance packs to custom Audit Manager assessments
- Maximum 50 conformance packs per account
Usage
Prerequisites
Before deploying this AWS Config component:
-
AWS Config Bucket: The
aws-config-bucketcomponent must be provisioned first in the audit account:atmos terraform apply aws-config-bucket -s core-use1-audit -
Support IAM Role (CIS AWS Foundations 1.20): A designated support IAM role should be deployed to every account:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowSupport",
"Effect": "Allow",
"Action": ["support:*"],
"Resource": "*"
},
{
"Sid": "AllowTrustedAdvisor",
"Effect": "Allow",
"Action": "trustedadvisor:Describe*",
"Resource": "*"
}
]
} -
Service Access Principals (for organization-level conformance packs): Enable trusted access for AWS Config in your organization:
How to Verify:
aws organizations list-aws-service-access-for-organization | grep configEnable if Disabled:
aws organizations enable-aws-service-access --service-principal config.amazonaws.com
aws organizations enable-aws-service-access --service-principal config-multiaccountsetup.amazonaws.comOr if using our
accountcomponent, add these principals toaws_service_access_principals.
Usage
Stack Level: Regional
AWS Config is a regional service. The component must be deployed to each region where you want to track resources.
Scope Configuration
The default_scope variable controls how conformance packs are deployed:
| Scope | Description | Use Case |
|---|---|---|
account | Conformance packs deployed per-account | Member accounts |
organization | Conformance packs deployed organization-wide | Management account only |
Using Account Scope (Member Accounts)
For member accounts, use default_scope: account. The component will:
- Create a Configuration Recorder in each region
- Create an IAM role only in the global collector region
- Authorize the central aggregator account to collect data
- Deploy account-level conformance packs
Using Organization Scope (Management Account)
For the management account, use default_scope: organization. The component will:
- Deploy organization-wide conformance packs that apply to ALL member accounts
- Require the
config-multiaccountsetup.amazonaws.comservice access principal
Key Configuration Variables
| Variable | Description | Example |
|---|---|---|
global_resource_collector_region | Region that tracks global resources (IAM, Route53) | us-east-1 |
central_resource_collector_account | Account that aggregates all Config data | security |
create_iam_role | Set to true - component auto-detects global collector region | true |
config_bucket_* | References the S3 bucket in audit account | See example below |
sns_encryption_key_id | KMS key for SNS topic encryption (CMMC compliance) | alias/aws/sns |
Catalog Configuration
Default Configuration (stacks/catalog/aws-config/defaults.yaml)
components:
terraform:
aws-config/defaults:
metadata:
type: abstract
component: "aws-config"
vars:
enabled: true
default_scope: account
create_iam_role: true
az_abbreviation_type: fixed
account_map_component_name: "account-map"
account_map_tenant: core
root_account_stage: root
global_environment: gbl
global_resource_collector_region: "us-east-1"
central_resource_collector_account: security
config_bucket_component_name: "aws-config-bucket"
config_bucket_tenant: core
config_bucket_env: ue1
config_bucket_stage: audit
sns_encryption_key_id: "alias/aws/sns"
conformance_packs: []
Member Account Configuration (stacks/catalog/aws-config/member-account.yaml)
import:
- catalog/aws-config/defaults
components:
terraform:
aws-config:
metadata:
component: "aws-config"
inherits:
- "aws-config/defaults"
Organization Account Configuration (stacks/catalog/aws-config/organization.yaml)
import:
- catalog/aws-config/defaults
components:
terraform:
aws-config:
metadata:
component: "aws-config"
inherits:
- "aws-config/defaults"
vars:
default_scope: organization
conformance_packs:
- name: "Operational-Best-Practices-for-CIS-AWS-v1.4-Level2"
conformance_pack: "https://raw.githubusercontent.com/awslabs/aws-config-rules/master/aws-config-conformance-packs/Operational-Best-Practices-for-CIS-AWS-v1.4-Level2.yaml"
parameter_overrides: {}
Conformance Packs
Conformance packs define a collection of AWS Config rules for compliance monitoring. This component supports loading conformance packs from both remote URLs and local files.
Local File Support (New Feature)
The component now supports loading conformance packs from the local filesystem in addition to remote URLs. This enables:
- Custom conformance packs: Create organization-specific compliance rules
- Modified AWS packs: Customize AWS-provided packs for your requirements
- Air-gapped environments: Deploy in environments without internet access
- Version control: Track conformance pack changes alongside infrastructure code
The component automatically detects whether the conformance_pack value is a URL (starts with http:// or https://)
or a local file path. Local paths are resolved relative to the component's root directory.
Conformance Pack Examples
conformance_packs:
# Remote URL (AWS Labs managed packs)
- name: "CIS-AWS-v1.4-Level2"
conformance_pack: "https://raw.githubusercontent.com/awslabs/aws-config-rules/master/aws-config-conformance-packs/Operational-Best-Practices-for-CIS-AWS-v1.4-Level2.yaml"
parameter_overrides:
AccessKeysRotatedParamMaxAccessKeyAge: "45"
# Local file (relative to component directory)
- name: "Custom-CMMC-Pack"
conformance_pack: "conformance-packs/custom-cmmc-pack.yaml"
parameter_overrides: {}
# Another local file example
- name: "CMMC-Level2-Best-Practices"
conformance_pack: "conformance-packs/cmmc-l2-v2-AWS-Best-Practices.yaml"
parameter_overrides:
IamPasswordPolicyParamMaxPasswordAge: "60"
# Override scope for specific pack
- name: "Org-Wide-Security-Pack"
conformance_pack: "https://example.com/pack.yaml"
scope: "organization" # Override default_scope
parameter_overrides: {}
Creating Custom Conformance Packs
To create a custom conformance pack:
-
Create a
conformance-packs/directory in your component:components/terraform/aws-config/
├── conformance-packs/
│ ├── custom-security-rules.yaml
│ └── cmmc-l2-v2-customized.yaml
├── main.tf
├── variables.tf
└── ... -
Define rules in CloudFormation format:
# conformance-packs/custom-security-rules.yaml
Parameters:
MaxAccessKeyAge:
Default: '90'
Type: String
Resources:
AccessKeysRotated:
Type: AWS::Config::ConfigRule
Properties:
ConfigRuleName: custom-access-keys-rotated
InputParameters:
maxAccessKeyAge:
Ref: MaxAccessKeyAge
Source:
Owner: AWS
SourceIdentifier: ACCESS_KEYS_ROTATED -
Reference the local file in your configuration:
conformance_packs:
- name: "Custom-Security-Rules"
conformance_pack: "conformance-packs/custom-security-rules.yaml"
parameter_overrides:
MaxAccessKeyAge: "45"
SNS Topic Encryption
AWS Config creates an SNS topic for notifications. For CMMC compliance, this topic must be encrypted:
# Option 1: AWS Managed Key (Recommended)
sns_encryption_key_id: "alias/aws/sns"
# Option 2: Customer Managed KMS Key
sns_encryption_key_id: "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
Deployment
Provisioning Order
Critical: Deploy Member Accounts BEFORE Organization Account
Organization conformance packs require all member accounts to have configuration recorders already set up. Always deploy member accounts first, then the organization/management account last.
Step 1: Deploy to Member Accounts (Global Collector Region First)
All member accounts can be deployed in parallel:
# Core tenant accounts
atmos terraform apply aws-config -s core-use1-audit
atmos terraform apply aws-config -s core-use1-security
atmos terraform apply aws-config -s core-use1-network
atmos terraform apply aws-config -s core-use1-identity
atmos terraform apply aws-config -s core-use1-dns
atmos terraform apply aws-config -s core-use1-automation
# Platform tenant accounts (if applicable)
atmos terraform apply aws-config -s plat-use1-dev
atmos terraform apply aws-config -s plat-use1-staging
atmos terraform apply aws-config -s plat-use1-prod
Step 2: Deploy to Organization/Management Account (LAST)
atmos terraform apply aws-config -s core-use1-root
Multi-Region Deployment
AWS Config is regional. For multi-region coverage, deploy to each region:
How Multi-Region Works
- Global Collector Region (e.g.,
us-east-1): Creates the IAM role, tracks global resources - Additional Regions (e.g.,
us-west-2): References IAM role via remote state, tracks regional resources only