DNXLabs / one-cli

CLI to manage all stacks from DNX.
https://cli.dnx.one
Apache License 2.0
7 stars 0 forks source link

"one terraform plan" has an error with the infra-root stack #55

Closed claisonamorim closed 4 years ago

claisonamorim commented 4 years ago

Using all the steps with the "make" command everything works as expected for deploying to the infra-root stack, but using the "one terraform plan" command, it shows the following error:

**Setting workspace to default Assuming role dnx-root at

Error: Missing required argument

on .terraform / modules / security-baseline / _providers.tf line 1, in provider "aws": 1: provider "aws" {}

The argument "region" is required, but no definition was found.**

Quickly analyzing this issue, I noticed that using the "one terraform plan", the variable AWS_DEFAULT_REGION was not exposed to the container, but with the make command it was. This is probably the problem.

brunodasilvalenga commented 4 years ago

Hey @claisonamorim can you check your one.yml and make sure that you have the region in the default workspace?

workspaces:
  default:
    aws-region: ap-southeast-2
arthurbdiniz commented 4 years ago

@brunodasilvalenga aws-region: ap-southeast-2 are only used been used for ECS workspaces, they don't work for normal workspaces.

arthurbdiniz commented 4 years ago

This problem is unrelated to the CLI.

The module terraform-aws-security-baseline is the root cause for this because the module has described a provider but without defining a standard region.

on .terraform/modules/security-baseline/_providers.tf line 1, in provider "aws":
   1: provider "aws" {}

To solve this a new patch was released for the module, any issues with it just reopen this issue.

@claisonamorim Please update your stack to:

module "security-baseline" {
  source = "git::https://github.com/DNXLabs/terraform-aws-security-baseline?ref=1.1.2"
}