Skip to content

Commit

Permalink
examples configaggregator: example aggregator for delegated admin
Browse files Browse the repository at this point in the history
  • Loading branch information
dschofie committed Jun 4, 2024
1 parent c6a0549 commit 5788dbc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
33 changes: 33 additions & 0 deletions examples/tf/configaggregator/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
resource "aws_config_configuration_aggregator" "organization" {
depends_on = [aws_iam_role_policy_attachment.organization]

name = "telophase-config-aggregator" # Required

organization_aggregation_source {
all_regions = true
role_arn = aws_iam_role.organization.arn
}
}

data "aws_iam_policy_document" "assume_role" {
statement {
effect = "Allow"

principals {
type = "Service"
identifiers = ["config.amazonaws.com"]
}

actions = ["sts:AssumeRole"]
}
}

resource "aws_iam_role" "organization" {
name = "telophase-config-aggregator-role"
assume_role_policy = data.aws_iam_policy_document.assume_role.json
}

resource "aws_iam_role_policy_attachment" "organization" {
role = aws_iam_role.organization.name
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSConfigRoleForOrganizations"
}
12 changes: 12 additions & 0 deletions examples/tf/configaggregator/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
terraform {
backend "s3" {
bucket = "terraform-state-${telophase.account_id}"
key = "configaggregator/terraform.tfstate"
region = "us-west-2"
}
}


provider "aws" {
region = "us-east-1"
}

0 comments on commit 5788dbc

Please sign in to comment.