Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on May 3, 2023. It is now read-only.

Terraform AWS Config module

License

NotificationsYou must be signed in to change notification settings

cmdlabs/terraform-aws-config

Repository files navigation

Table of contents

  1. Overview
  2. Terraform AWS Config - Overview Diagram
  3. Terraform AWS Config
  4. License

Overview

AWS Config catpures point in time snapshots of the environment to allow for point in time review of configuration. Additionally AWS Config can be utilised for automated action using AWS Config rules.

NOTE: Currently only supports AWS owned / managed rules -http://docs.aws.amazon.com/config/latest/developerguide/managed-rules-by-aws-config.html

Terraform >= 0.12.6 is required for this module.

Terraform AWS Config - Overview Diagram

AWSConfig|medium

Terraform AWS Config

Resources docs

Terraform AWS Config automation includes use of the following core Terraform resources:

Inputs

The below outlines the current parameters and defaults.

NameDescriptionTypeDefaultRequired
delivery_frequencyThe frequency with which AWS Config recurringly delivers configuration snapshots. May be one of One_Hour, Three_Hours, Six_Hours, Twelve_Hours, or TwentyFour_HoursstringTwentyFour_HoursNo
enable_recorderWhether the configuration recorder should be enabled or disabledbooltrueNo
expirationThe number of days to wait before expiring an objectnumber2555No
transition_to_glacierThe number of days to wait before transitioning an object to Glaciernumber30No
is_aggregatorWhether the account is to be an aggregator or notboolfalseNo
aggregator_account_idThe AWS Account ID of the aggregator accountstringnullNo
aggregator_account_regionThe AWS Region of the aggregator accountstringnullNo
source_account_idsList of 12-digit account IDs of the accounts being aggregatedlist(string)[]No
bucket_nameThe bucket name - required by both aggregator and source accountsstring""Yes
config_rulesA list of config rules. By not specifying, a minimum set of recommended rules are appliedmap(any)(map)No

Outputs

NameDescription
bucketThe bucket name that config writes output to
bucket_arnThe bucket ARN that config writes output to
delivery_channel_idThe name of the delivery channel
recorder_idName of the recorder
topic_arnThe ARN of the SNS topic AWS Config writes events to

Examples

Aggregator Account

A Config account configured as an Aggregator:

variable"aggregator_account_id" {}variable"source_account_id" {}variable"bucket_name" {}module"aggregator" {source="git@github.com:cmdlabs/terraform-aws-config.git"is_aggregator=trueaggregator_account_id=var.aggregator_account_idaggregator_account_region="ap-southeast-2"source_account_ids=[var.source_account_id]bucket_name=var.bucket_name}

To apply that:

▶ export TF_VAR_bucket_name=config-bucket-"$(uuidgen | tr 'A-Z' 'a-z')"  # bucket name must be globally unique▶ TF_VAR_aggregator_account_id=xxxxxxxxxxxx TF_VAR_source_account_id=yyyyyyyyyyyy terraform apply

Source Account

Then a Config Source that points to its S3 bucket:

variable"bucket_name" {}module"source" {source="git@github.com:cmdlabs/terraform-aws-config.git"is_aggregator=falsebucket_name=var.bucket_name}

To apply that:

# $TF_VAR_bucket_name set from above.▶ terraform apply

License

Apache 2.0.


[8]ページ先頭

©2009-2025 Movatter.jp