Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify an AWS Region using Terraform #72

Open
hasez opened this issue Jun 9, 2022 · 0 comments
Open

How to specify an AWS Region using Terraform #72

hasez opened this issue Jun 9, 2022 · 0 comments

Comments

@hasez
Copy link

hasez commented Jun 9, 2022

I use two regions AWS.

  • main: ap-notheast-1
  • secondary: us-east-1

How do I deploy log-ingestion to each region by Terraform ?

my terraform

I specified providers in the module "newrelic_log_ingestion_virginia" , but warnings occur when executing the plan.
Also, in executing apply, referenced to the main region.

provider "newrelic" {
  account_id = var.newrelic_account_id
  api_key    = var.newrelic_api_key
  region     = "US"
}
provider "aws" {
  region = "ap-northeast-1"
}
provider "aws" {
  region = "us-east-1"
  alias  = "virginia"
}
module "newrelic_log_ingestion" {
  source                       = "github.com/newrelic/aws-log-ingestion"
  nr_license_key               = var.newrelic_license_key
}
module "newrelic_log_ingestion_virginia" {
  source                       = "github.com/newrelic/aws-log-ingestion"
  nr_license_key               = var.newrelic_license_key
  providers = {
    aws = aws.virginia
  }
}

I think to add required_providers to aws-log-ingestion/terraform.tf.

  • For example, like this
    terraform {
      required_version = ">= 0.14, < 2.0"
    +  required_providers {
    +    aws = {
    +      source = "hashicorp/aws"
    +    }
      }
    }

Is there another way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant