Skip to content

Commit

Permalink
fix: Use var.name for more resources
Browse files Browse the repository at this point in the history
This allows users to reuse this module multiple times within one AWS
account
  • Loading branch information
clburlison committed Apr 20, 2021
1 parent 06015d0 commit 0ba2962
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "aws_cloudfront_distribution" "munki" {

enabled = true
is_ipv6_enabled = true
comment = "Munki"
comment = var.name

aliases = var.cf_dns_aliases

Expand Down Expand Up @@ -165,7 +165,7 @@ resource "aws_cloudfront_distribution" "munki_basic_auth" {

enabled = true
is_ipv6_enabled = true
comment = "Munki"
comment = var.name

aliases = var.cf_dns_aliases

Expand Down Expand Up @@ -301,4 +301,3 @@ resource "aws_cloudfront_distribution" "munki_basic_auth" {
ssl_support_method = var.cf_ssl_support_method
}
}

3 changes: 1 addition & 2 deletions cloudwatch.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_cloudwatch_log_group" "munki_makecatalogs" {
name = "/aws/lambda/munki_makecatalogs"
name = "/aws/lambda/${var.name}_makecatalogs"
retention_in_days = "30"

tags = merge(
Expand Down Expand Up @@ -65,4 +65,3 @@ resource "aws_cloudwatch_metric_alarm" "Makecatalogs-Error" {
alarm_actions = [var.alarm_arn]
insufficient_data_actions = []
}

3 changes: 1 addition & 2 deletions policy.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_iam_policy" "munki-s3-rw" {
name = "munki-s3-rw"
name = "${var.name}-s3-rw"
path = "/"
description = "Munki s3 policy for read/write access to the s3 munki repo bucket. Used for automation purposes."

Expand Down Expand Up @@ -32,4 +32,3 @@ resource "aws_iam_policy" "munki-s3-rw" {
EOF

}

0 comments on commit 0ba2962

Please sign in to comment.