formatting all templates

ctalarms-whitelist
lalanza808 4 years ago
parent 9a6d194fa2
commit bc534db02e

@ -1,5 +1,5 @@
variable "sns_emails" { variable "sns_emails" {
type = list type = list
default = [] default = []
} }
variable "tags" { variable "tags" {

@ -17,7 +17,7 @@ resource "aws_organizations_organizational_unit" "non_prod" {
} }
resource "aws_organizations_policy" "prod" { resource "aws_organizations_policy" "prod" {
name = "Production" name = "Production"
content = <<CONTENT content = <<CONTENT
{ {
@ -32,7 +32,7 @@ CONTENT
} }
resource "aws_organizations_policy" "non_prod" { resource "aws_organizations_policy" "non_prod" {
name = "NonProduction" name = "NonProduction"
content = <<CONTENT content = <<CONTENT
{ {

@ -1,6 +1,6 @@
resource "aws_iam_role" "cloudtrail_log_group_role" { resource "aws_iam_role" "cloudtrail_log_group_role" {
name = aws_s3_bucket.cloudtrail_bucket.id name = aws_s3_bucket.cloudtrail_bucket.id
tags = var.tags tags = var.tags
assume_role_policy = <<EOF assume_role_policy = <<EOF
{ {
@ -19,8 +19,8 @@ EOF
} }
resource "aws_iam_role_policy" "cloudtrail_log_group_role_policy" { resource "aws_iam_role_policy" "cloudtrail_log_group_role_policy" {
name = aws_s3_bucket.cloudtrail_bucket.id name = aws_s3_bucket.cloudtrail_bucket.id
role = aws_iam_role.cloudtrail_log_group_role.id role = aws_iam_role.cloudtrail_log_group_role.id
policy = <<EOF policy = <<EOF
{ {

@ -17,7 +17,7 @@ resource "aws_cloudtrail" "cloudtrail_bucket_logging" {
include_management_events = var.include_management_events include_management_events = var.include_management_events
data_resource { data_resource {
type = "AWS::S3::Object" type = "AWS::S3::Object"
values = compact(concat( values = compact(concat(
[var.default_log_bucket], [var.default_log_bucket],
formatlist("arn:aws:s3:::%s/", var.activity_log_buckets) formatlist("arn:aws:s3:::%s/", var.activity_log_buckets)

@ -60,6 +60,6 @@ variable "activity_log_buckets" {
default = [] default = []
} }
variable "default_log_bucket" { variable "default_log_bucket" {
default = "arn:aws:s3:::" default = "arn:aws:s3:::"
description = "The default buckets to log - all buckets in the account - override to empty string" description = "The default buckets to log - all buckets in the account - override to empty string"
} }

@ -49,7 +49,7 @@ data "aws_iam_policy_document" "kms" {
] ]
resources = ["*"] resources = ["*"]
principals { principals {
type = "AWS" type = "AWS"
identifiers = formatlist("arn:aws:iam::${local.account_id}:role/%s", var.usage_roles) identifiers = formatlist("arn:aws:iam::${local.account_id}:role/%s", var.usage_roles)
} }
} }
@ -62,7 +62,7 @@ data "aws_iam_policy_document" "kms" {
] ]
resources = ["*"] resources = ["*"]
principals { principals {
type = "AWS" type = "AWS"
identifiers = formatlist("arn:aws:iam::${local.account_id}:role/%s", var.usage_roles) identifiers = formatlist("arn:aws:iam::${local.account_id}:role/%s", var.usage_roles)
} }
condition { condition {

@ -8,7 +8,7 @@ variable "app_name" {
} }
variable "administrator_roles" { variable "administrator_roles" {
description = "IAM Role name of AWS account administrators" description = "IAM Role name of AWS account administrators"
type = list type = list
} }
variable "tags" { variable "tags" {
default = {} default = {}

Loading…
Cancel
Save