From 5cb9d38304a06590102ed448767e624589fe2e4c Mon Sep 17 00:00:00 2001 From: Steve Astels Date: Tue, 10 Dec 2024 14:21:19 -0500 Subject: [PATCH 1/3] tweak sms keywords AIDE and INFO (#1694) --- scripts/set_sms_keywords/set_sms_keywords.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/set_sms_keywords/set_sms_keywords.py b/scripts/set_sms_keywords/set_sms_keywords.py index 17fa4b751..2b37220c0 100644 --- a/scripts/set_sms_keywords/set_sms_keywords.py +++ b/scripts/set_sms_keywords/set_sms_keywords.py @@ -66,7 +66,7 @@ }, { "Keyword": "AIDE", - "KeywordMessage": "GC Notify: Visitez https://notification.canada.ca/contact Frais de msg/donnée std applicables. La fréquence des messages peut varier. Textez ARRÊT pour annuler.", + "KeywordMessage": "Notification GC: Visitez https://notification.canada.ca/contact Frais de msg/données std applicables. La fréquence des messages peut varier. Textez ARRÊT pour annuler.", "KeywordAction": "AUTOMATIC_RESPONSE", }, { @@ -76,7 +76,7 @@ }, { "Keyword": "INFO", - "KeywordMessage": "GC Notify: More info at https://notification.canada.ca Data rates apply. Plus d’informations à https://notification.canada.ca Frais de msg/donnée std applicables.", + "KeywordMessage": "GC Notify: More info at https://notification.canada.ca Data rates apply. Notification GC: Plus d’informations à https://notification.canada.ca Frais de msg/données std applicables.", "KeywordAction": "AUTOMATIC_RESPONSE", } ] From 1131026e7893267ff87d1f9f05abee826b0a1d61 Mon Sep 17 00:00:00 2001 From: Ben Larabie Date: Wed, 11 Dec 2024 10:16:34 -0500 Subject: [PATCH 2/3] formatting (#1697) --- aws/common/import.tf | 99 ++++++++++++ .../aws_integration.tf => common/newrelic.tf} | 64 ++++---- aws/common/variables.tf | 9 ++ aws/newrelic/removed.tf | 151 ++++++++++++++++++ env/dev/common/.terraform.lock.hcl | 115 +++++++------ env/dev/newrelic/.terraform.lock.hcl | 113 +++++++++++++ env/staging/newrelic/.terraform.lock.hcl | 113 +++++++++++++ 7 files changed, 588 insertions(+), 76 deletions(-) create mode 100644 aws/common/import.tf rename aws/{newrelic/aws_integration.tf => common/newrelic.tf} (80%) create mode 100644 aws/newrelic/removed.tf create mode 100644 env/dev/newrelic/.terraform.lock.hcl create mode 100644 env/staging/newrelic/.terraform.lock.hcl diff --git a/aws/common/import.tf b/aws/common/import.tf new file mode 100644 index 000000000..97805a3da --- /dev/null +++ b/aws/common/import.tf @@ -0,0 +1,99 @@ +import { + to = aws_cloudwatch_metric_stream.newrelic_metric_stream[0] + id = "newrelic-metric-stream-${var.env}" +} + +import { + to = aws_config_configuration_recorder_status.newrelic_recorder_status[0] + id = var.aws_config_recorder_name +} + +import { + to = aws_iam_policy.newrelic_aws_permissions[0] + id = "arn:aws:iam::${var.account_id}:policy/NewRelicCloudStreamReadPermissions-${var.env}" +} + +import { + to = aws_iam_role.firehose_newrelic_role[0] + id = "firehose_newrelic_role_${var.env}" +} + +import { + to = aws_iam_role.metric_stream_to_firehose[0] + id = "newrelic_metric_stream_to_firehose_role_${var.env}" +} + +import { + to = aws_iam_role.newrelic_aws_role[0] + id = "NewRelicInfrastructure-Integrations-${var.env}" +} + +import { + to = aws_iam_role.newrelic_configuration_recorder[0] + id = "newrelic_configuration_recorder-${var.env}" +} + +import { + to = aws_iam_role_policy.metric_stream_to_firehose[0] + id = "newrelic_metric_stream_to_firehose_role_${var.env}:default" +} + +import { + to = aws_iam_role_policy.newrelic_configuration_recorder_s3[0] + id = "newrelic_configuration_recorder-${var.env}:newrelic-configuration-recorder-s3-${var.env}" +} + +import { + to = aws_iam_role_policy_attachment.newrelic_aws_policy_attach[0] + id = "NewRelicInfrastructure-Integrations-${var.env}/arn:aws:iam::aws:policy/ReadOnlyAccess" +} + +import { + to = aws_iam_role_policy_attachment.newrelic_configuration_recorder[0] + id = "newrelic_configuration_recorder-${var.env}/arn:aws:iam::aws:policy/service-role/AWS_ConfigRole" +} + +import { + to = aws_kinesis_firehose_delivery_stream.newrelic_firehose_stream[0] + id = "arn:aws:firehose:ca-central-1:${var.account_id}:deliverystream/newrelic_firehose_stream_${var.env}" +} + +import { + to = aws_s3_bucket.newrelic_aws_bucket[0] + id = "newrelic-aws-bucket-${random_string.s3-bucket-name[0].id}" +} + +import { + to = aws_s3_bucket.newrelic_configuration_recorder_s3[0] + id = "newrelic-configuration-recorder-${random_string.s3-bucket-name[0].id}" +} + +import { + to = aws_s3_bucket_ownership_controls.newrelic_ownership_controls[0] + id = "newrelic-aws-bucket-${random_string.s3-bucket-name[0].id}" +} + +import { + to = newrelic_api_access_key.newrelic_aws_access_key[0] + id = "5EA911F90B135B0D61DB4012CB0DC376CCC5017C98EB1688932254CDDAFD3443:USER" +} + +import { + to = newrelic_cloud_aws_integrations.newrelic_cloud_integration_pull[0] + id = var.env == "dev" ? "242485" : "225924" +} + +import { + to = newrelic_cloud_aws_link_account.newrelic_cloud_integration_pull[0] + id = var.env == "dev" ? "242485" : "225924" +} + +import { + to = newrelic_cloud_aws_link_account.newrelic_cloud_integration_push[0] + id = var.env == "dev" ? "242484" : "225918" +} + +import { + to = random_string.s3-bucket-name[0] + id = var.env == "dev" ? "fiskyzxf" : "9p5x8bkb" +} diff --git a/aws/newrelic/aws_integration.tf b/aws/common/newrelic.tf similarity index 80% rename from aws/newrelic/aws_integration.tf rename to aws/common/newrelic.tf index 37b31db8f..d03fc584e 100644 --- a/aws/newrelic/aws_integration.tf +++ b/aws/common/newrelic.tf @@ -1,3 +1,9 @@ +provider "newrelic" { + account_id = var.new_relic_account_id + api_key = var.new_relic_api_key + region = "US" +} + data "aws_iam_policy_document" "newrelic_assume_policy" { count = var.enable_new_relic ? 1 : 0 @@ -19,14 +25,14 @@ data "aws_iam_policy_document" "newrelic_assume_policy" { } resource "aws_iam_role" "newrelic_aws_role" { - count = var.enable_new_relic && var.env == "staging" ? 1 : 0 + count = var.enable_new_relic && var.env != "production" ? 1 : 0 name = "NewRelicInfrastructure-Integrations-${var.env}" description = "New Relic Cloud integration role" assume_role_policy = data.aws_iam_policy_document.newrelic_assume_policy[0].json } resource "aws_iam_policy" "newrelic_aws_permissions" { - count = var.enable_new_relic && var.env == "staging" ? 1 : 0 + count = var.enable_new_relic && var.env != "production" ? 1 : 0 name = "NewRelicCloudStreamReadPermissions-${var.env}" description = "" policy = < Date: Thu, 12 Dec 2024 09:28:52 -0500 Subject: [PATCH 3/3] removing import and removed blocks (#1698) [review] --- aws/common/import.tf | 99 -------------------------- aws/newrelic/removed.tf | 151 ---------------------------------------- 2 files changed, 250 deletions(-) delete mode 100644 aws/common/import.tf delete mode 100644 aws/newrelic/removed.tf diff --git a/aws/common/import.tf b/aws/common/import.tf deleted file mode 100644 index 97805a3da..000000000 --- a/aws/common/import.tf +++ /dev/null @@ -1,99 +0,0 @@ -import { - to = aws_cloudwatch_metric_stream.newrelic_metric_stream[0] - id = "newrelic-metric-stream-${var.env}" -} - -import { - to = aws_config_configuration_recorder_status.newrelic_recorder_status[0] - id = var.aws_config_recorder_name -} - -import { - to = aws_iam_policy.newrelic_aws_permissions[0] - id = "arn:aws:iam::${var.account_id}:policy/NewRelicCloudStreamReadPermissions-${var.env}" -} - -import { - to = aws_iam_role.firehose_newrelic_role[0] - id = "firehose_newrelic_role_${var.env}" -} - -import { - to = aws_iam_role.metric_stream_to_firehose[0] - id = "newrelic_metric_stream_to_firehose_role_${var.env}" -} - -import { - to = aws_iam_role.newrelic_aws_role[0] - id = "NewRelicInfrastructure-Integrations-${var.env}" -} - -import { - to = aws_iam_role.newrelic_configuration_recorder[0] - id = "newrelic_configuration_recorder-${var.env}" -} - -import { - to = aws_iam_role_policy.metric_stream_to_firehose[0] - id = "newrelic_metric_stream_to_firehose_role_${var.env}:default" -} - -import { - to = aws_iam_role_policy.newrelic_configuration_recorder_s3[0] - id = "newrelic_configuration_recorder-${var.env}:newrelic-configuration-recorder-s3-${var.env}" -} - -import { - to = aws_iam_role_policy_attachment.newrelic_aws_policy_attach[0] - id = "NewRelicInfrastructure-Integrations-${var.env}/arn:aws:iam::aws:policy/ReadOnlyAccess" -} - -import { - to = aws_iam_role_policy_attachment.newrelic_configuration_recorder[0] - id = "newrelic_configuration_recorder-${var.env}/arn:aws:iam::aws:policy/service-role/AWS_ConfigRole" -} - -import { - to = aws_kinesis_firehose_delivery_stream.newrelic_firehose_stream[0] - id = "arn:aws:firehose:ca-central-1:${var.account_id}:deliverystream/newrelic_firehose_stream_${var.env}" -} - -import { - to = aws_s3_bucket.newrelic_aws_bucket[0] - id = "newrelic-aws-bucket-${random_string.s3-bucket-name[0].id}" -} - -import { - to = aws_s3_bucket.newrelic_configuration_recorder_s3[0] - id = "newrelic-configuration-recorder-${random_string.s3-bucket-name[0].id}" -} - -import { - to = aws_s3_bucket_ownership_controls.newrelic_ownership_controls[0] - id = "newrelic-aws-bucket-${random_string.s3-bucket-name[0].id}" -} - -import { - to = newrelic_api_access_key.newrelic_aws_access_key[0] - id = "5EA911F90B135B0D61DB4012CB0DC376CCC5017C98EB1688932254CDDAFD3443:USER" -} - -import { - to = newrelic_cloud_aws_integrations.newrelic_cloud_integration_pull[0] - id = var.env == "dev" ? "242485" : "225924" -} - -import { - to = newrelic_cloud_aws_link_account.newrelic_cloud_integration_pull[0] - id = var.env == "dev" ? "242485" : "225924" -} - -import { - to = newrelic_cloud_aws_link_account.newrelic_cloud_integration_push[0] - id = var.env == "dev" ? "242484" : "225918" -} - -import { - to = random_string.s3-bucket-name[0] - id = var.env == "dev" ? "fiskyzxf" : "9p5x8bkb" -} diff --git a/aws/newrelic/removed.tf b/aws/newrelic/removed.tf deleted file mode 100644 index e1fc50016..000000000 --- a/aws/newrelic/removed.tf +++ /dev/null @@ -1,151 +0,0 @@ -removed { - from = aws_cloudwatch_metric_stream.newrelic_metric_stream - - lifecycle { - destroy = false - } -} - -removed { - from = aws_config_configuration_recorder_status.newrelic_recorder_status - - lifecycle { - destroy = false - } -} - -removed { - from = aws_iam_policy.newrelic_aws_permissions - - lifecycle { - destroy = false - } -} - -removed { - from = aws_iam_role.firehose_newrelic_role - - lifecycle { - destroy = false - } -} - -removed { - from = aws_iam_role.metric_stream_to_firehose - - lifecycle { - destroy = false - } -} - -removed { - from = aws_iam_role.newrelic_aws_role - - lifecycle { - destroy = false - } -} - -removed { - from = aws_iam_role.newrelic_configuration_recorder - - lifecycle { - destroy = false - } -} - -removed { - from = aws_iam_role_policy.metric_stream_to_firehose - - lifecycle { - destroy = false - } -} - -removed { - from = aws_iam_role_policy.newrelic_configuration_recorder_s3 - - lifecycle { - destroy = false - } -} - -removed { - from = aws_iam_role_policy_attachment.newrelic_aws_policy_attach - - lifecycle { - destroy = false - } -} - -removed { - from = aws_iam_role_policy_attachment.newrelic_configuration_recorder - - lifecycle { - destroy = false - } -} - -removed { - from = aws_kinesis_firehose_delivery_stream.newrelic_firehose_stream - - lifecycle { - destroy = false - } -} - -removed { - from = aws_s3_bucket.newrelic_aws_bucket - - lifecycle { - destroy = false - } -} - -removed { - from = aws_s3_bucket.newrelic_configuration_recorder_s3 - - lifecycle { - destroy = false - } -} - -removed { - from = aws_s3_bucket_ownership_controls.newrelic_ownership_controls - - lifecycle { - destroy = false - } -} - -removed { - from = newrelic_api_access_key.newrelic_aws_access_key - - lifecycle { - destroy = false - } -} - -removed { - from = newrelic_cloud_aws_integrations.newrelic_cloud_integration_pull - - lifecycle { - destroy = false - } -} -removed { - - from = newrelic_cloud_aws_link_account.newrelic_cloud_integration_pull - - lifecycle { - destroy = false - } -} - -removed { - from = newrelic_cloud_aws_link_account.newrelic_cloud_integration_push - - lifecycle { - destroy = false - } -}