spotinst / terraform-spotinst-aws-connect

A Terraform module to connect an AWS account to Spot.io.
Apache License 2.0
1 stars 8 forks source link

Duplicate provider configuration #24

Open victorcechinel opened 9 months ago

victorcechinel commented 9 months ago

What happened:

The Module has a duplicate provider configuration.

For structures using Monorepo, the provider configuration is created only in the Terragrunt Root file.

As the provider configuration already exists in this module, it's duplicating, making it impossible to use with other Spot.io modules.

terragrunt init  && terragrunt plan -lock=false

Initializing the backend...
There are some problems with the configuration, described below.

The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.
╷
│ Error: Duplicate provider configuration
│ 
│   on providers.tf line 2:
│    2: provider "spotinst" {
│ 
│ A default (non-aliased) provider configuration for "spotinst" was already
│ given at main.tf:1,1-20. If multiple configurations are required, set the
│ "alias" argument for alternative configurations.
╵

ERRO[0004] terraform invocation failed in /Users/victor/Developer/Intelipost/Github/sre-terragrunt-spot-io/intelipost/account/.terragrunt-cache/oPMk5En143TKn6VYj7Fo4cu-hxU/XMtmQELq8-UPRR-7mI9Rz0nM5Jo  prefix=[/Users/victor/Developer/Intelipost/Github/sre-terragrunt-spot-io/intelipost/account] 
ERRO[0004] 1 error occurred:
        * [/Users/victor/Developer/Intelipost/Github/sre-terragrunt-spot-io/intelipost/account/.terragrunt-cache/oPMk5En143TKn6VYj7Fo4cu-hxU/XMtmQELq8-UPRR-7mI9Rz0nM5Jo] exit status 1

What you expected to happen:

Remove the provider configuration so that it is created using the Module.

How to reproduce it (as minimally and precisely as possible):

  1. Create provider.tf or terragrunt.hcl (contains provider configuration);
  2. Settings credentials on provider;
  3. Use the module;
  4. Error appear;

Environment:

rogeriospinaintelipost commented 9 months ago

Same here

felipeIntelipost commented 9 months ago

I'm having the same problem here