Skip to content

Commit

Permalink
replace map() with tomap()
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed May 6, 2022
1 parent fd02dec commit ccf33e2
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 26 deletions.
6 changes: 4 additions & 2 deletions cloudtrail-key/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ resource "aws_kms_key" "key" {
tags = merge(
local.base_tags,
var.tags,
map("boc:aws:region", local.region),
map("Name", local.name),
{
"boc:aws:region" = local.region
Name = local.name
},
)
}

Expand Down
4 changes: 2 additions & 2 deletions cloudtrail/cloudtrail.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "aws_cloudtrail" "this" {
tags = merge(
local.base_tags,
var.tags,
map("Name", local.name),
tomap({ Name = local.name }),
)
depends_on = [aws_s3_bucket_policy.policy]
}
Expand All @@ -33,7 +33,7 @@ resource "aws_iam_role" "cloudtrail" {
tags = merge(
local.base_tags,
var.tags,
map("Name", local.role_name),
tomap({ Name = local.role_name }),
)
}

Expand Down
2 changes: 1 addition & 1 deletion cloudtrail/cloudwatch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "aws_cloudwatch_log_group" "this" {
tags = merge(
local.base_tags,
var.tags,
map("Name", local.name),
tomap({ Name = local.name }),
)
}

Expand Down
2 changes: 1 addition & 1 deletion cloudtrail/sns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resource "aws_sns_topic" "cloudtrail" {
tags = merge(
local.base_tags,
var.tags,
map("Name", local.name),
tomap({ Name = local.name }),
)
}

Expand Down
4 changes: 2 additions & 2 deletions cloudtrail/sqs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "aws_sqs_queue" "cloudtrail_deadletter" {
tags = merge(
local.base_tags,
var.tags,
map("Name", format("%v-deadletter", local.name)),
tomap({ Name = format("%v-deadletter", local.name) }),
)
}

Expand Down Expand Up @@ -66,7 +66,7 @@ resource "aws_sqs_queue" "cloudtrail" {
tags = merge(
local.base_tags,
var.tags,
map("Name", local.name),
tomap({ Name = local.name }),
)
}

Expand Down
6 changes: 4 additions & 2 deletions cloudtrail_orig/kms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ resource "aws_kms_key" "key" {

tags = merge(
local.common_tags,
map("boc:aws:region", local.region),
map("Name", var.kms_key),
{
"boc:aws:region" = local.region
Name = var.kms_key
},
)
lifecycle {
ignore_changes = [tags["boc:tf_module_version"]]
Expand Down
2 changes: 1 addition & 1 deletion cloudtrail_orig/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "aws_s3_bucket" "cloudtrail" {
var.tags,
local.base_tags,
lookup(var.component_tags, "s3", {}),
map("Name", local.bucket_name),
tomap({ Name = local.bucket_name }),
)

provisioner "local-exec" {
Expand Down
2 changes: 1 addition & 1 deletion config/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "aws_s3_bucket" "config" {
var.tags,
local.base_tags,
lookup(var.component_tags, "s3", {}),
map("Name", local.bucket_name),
tomap({ Name = local.bucket_name }),
)

provisioner "local-exec" {
Expand Down
6 changes: 2 additions & 4 deletions iam-general-policies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ This provides some custom policies that are to be applied to some accounts and g
"create_policy"
"policy_arn"
}
```
```
* manage-access-keys
Allows for self-managing access keys (for rotating)
* manage-credentials
Expand All @@ -84,8 +83,7 @@ These are policy documents, used liberally, as needed by applications (typically
"policy"
"create_policy"
}
```
```
* ec2\_assume
* sts\_assume
* root\_assume
Expand Down
2 changes: 1 addition & 1 deletion iam-general-policies/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ resource "aws_iam_policy" "general" {
var.tags,
local.base_tags,
lookup(var.component_tags, "policy", {}),
map("Name", format("%vinf-%v", lookup(local._prefixes, "policy", ""), each.value["name"]))
tomap({ Name = format("%vinf-%v", lookup(local._prefixes, "policy", ""), each.value["name"]) }),
)

lifecycle {
Expand Down
2 changes: 1 addition & 1 deletion s3-access-logs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ resource "aws_s3_bucket" "logs" {
var.tags,
local.base_tags,
lookup(var.component_tags, "s3", {}),
map("Name", local.bucket_name),
tomap({ Name = local.bucket_name }),
)

provisioner "local-exec" {
Expand Down
2 changes: 1 addition & 1 deletion s3-config/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource "aws_s3_bucket" "config" {
var.tags,
local.base_tags,
lookup(var.component_tags, "s3", {}),
map("Name", local.bucket_name),
tomap({ Name = local.bucket_name }),
)

provisioner "local-exec" {
Expand Down
2 changes: 1 addition & 1 deletion s3-flow-logs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ resource "aws_s3_bucket" "flowlogs" {
var.tags,
local.base_tags,
lookup(var.component_tags, "s3", {}),
map("Name", local.bucket_name),
tomap({ Name = local.bucket_name }),
)

provisioner "local-exec" {
Expand Down
12 changes: 6 additions & 6 deletions vpc-remove-defaults/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ data "aws_availability_zones" "zones" {
resource "aws_default_vpc" "default" {
tags = merge(
local.base_tags,
map("Name", format("default-vpc-%s", local.vpc_title))
tomap({ Name = format("default-vpc-%s", local.vpc_title) }),
)
lifecycle {
ignore_changes = [tags["boc:tf_module_version"]]
Expand All @@ -118,7 +118,7 @@ resource "aws_default_vpc" "default" {
resource "aws_default_vpc_dhcp_options" "default" {
tags = merge(
local.base_tags,
map("Name", format("default-dhcpopt-%s", local.vpc_title))
tomap({ Name = format("default-dhcpopt-%s", local.vpc_title) }),
)
lifecycle {
ignore_changes = [tags["boc:tf_module_version"]]
Expand All @@ -133,7 +133,7 @@ resource "aws_default_security_group" "default" {

tags = merge(
local.base_tags,
map("Name", format("default-sg-%s", local.vpc_title))
tomap({ Name = format("default-sg-%s", local.vpc_title) }),
)

lifecycle {
Expand All @@ -150,7 +150,7 @@ resource "aws_default_subnet" "default" {

tags = merge(
local.base_tags,
map("Name", format("default-subnet-%s-%s", local.vpc_title, each.key))
tomap({ Name = format("default-subnet-%s-%s", local.vpc_title, each.key) }),
)

lifecycle {
Expand All @@ -167,7 +167,7 @@ resource "aws_default_network_acl" "default" {

tags = merge(
local.base_tags,
map("Name", format("default-nacl-%s", local.vpc_title))
tomap({ Name = format("default-nacl-%s", local.vpc_title) }),
)

lifecycle {
Expand All @@ -184,7 +184,7 @@ resource "aws_default_route_table" "default" {

tags = merge(
local.base_tags,
map("Name", format("default-rt-%s", local.vpc_title))
tomap({ Name = format("default-rt-%s", local.vpc_title) }),
)

lifecycle {
Expand Down

0 comments on commit ccf33e2

Please sign in to comment.