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 = <