MaksymBilenko / terraform-provider-synthetics

Terraform provider for AWS Synthetics Canary
10 stars 4 forks source link

The argument "region" is required, but was not set. #6

Closed arozwalak closed 3 years ago

arozwalak commented 3 years ago

I've set up 'synthetic_canary' as shown in README file

resource "synthetics_canary" "terraform-deploy-test" {
  name = var.synthetic_name
  runtime_version = "syn-nodejs-2.1"
  # todo: parametrize runtime_version
  execution_role_arn = aws_iam_policy.execution_policy.arn
  artifact_s3_location = "s3://${data.aws_s3_bucket.artifacts.id}/canary/"
  zip_file = data.archive_file.synthetic.output_path
  handler = "lp-login.handler"
  # todo: parametrize name of a handler
  run_config {
    memory_in_mb = 1024
    timeout_in_seconds = 60
  }
}

and when running terraform plan -out=sandbox.tfplan I'm getting below error

Error: Missing required argument

The argument "region" is required, but was not set.
lloyd-cw commented 3 years ago

Add the following to the same file you have declared our synthetic provider:

provider "synthetics" {
  region = var.region
}

You can hard set it but instead i would just replace the var.region with whever you use for your region variable.

arozwalak commented 3 years ago

thanks for help, I missed that.