I have to delete my .terraform folder every time in order for me to run terraform init/plan/apply.
The error that I get is:
Error: Duplicate data "aws_vpc_endpoint_service" configuration
│
│ on .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/main.tf line 5:
│ 5: data "aws_vpc_endpoint_service" "this" {
│
│ A aws_vpc_endpoint_service data resource named "this" was already declared at .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/main 3.tf:5,1-39. Resource names must be unique per type in each module.
╵
╷
│ Error: Duplicate resource "aws_vpc_endpoint" configuration
│
│ on .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/main.tf line 17:
│ 17: resource "aws_vpc_endpoint" "this" {
│
│ A aws_vpc_endpoint resource named "this" was already declared at .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/main 3.tf:17,1-35. Resource names must be unique per type in each module.
╵
╷
│ Error: Duplicate output definition
│
│ on .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/outputs.tf line 1:
│ 1: output "endpoints" {
│
│ An output named "endpoints" was already defined at .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/outputs 3.tf:1,1-19. Output names must be unique within a module.
╵
╷
│ Error: Duplicate variable declaration
│
│ on .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/variables.tf line 1:
│ 1: variable "create" {
│
│ A variable named "create" was already declared at .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/variables 3.tf:1,1-18. Variable names must be unique within a module.
╵
╷
│ Error: Duplicate variable declaration
│
│ on .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/variables.tf line 7:
│ 7: variable "vpc_id" {
│
│ A variable named "vpc_id" was already declared at .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/variables 3.tf:7,1-18. Variable names must be unique within a module.
╵
╷
│ Error: Duplicate variable declaration
│
│ on .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/variables.tf line 13:
│ 13: variable "endpoints" {
│
│ A variable named "endpoints" was already declared at .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/variables 3.tf:13,1-21. Variable names must be unique within a module.
╵
╷
│ Error: Duplicate variable declaration
│
│ on .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/variables.tf line 19:
│ 19: variable "security_group_ids" {
│
│ A variable named "security_group_ids" was already declared at .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/variables 3.tf:19,1-30. Variable names must be unique within a module.
╵
╷
│ Error: Duplicate variable declaration
│
│ on .terraform/modules/vpc_endpoints_nocreate/modules/vpc-endpoints/variables.tf line 25:
│ 25: variable "subnet_ids" {
After executing rm -rf .terraform .terraform.lock.hcl && terraform init && terraform workspace select prod, I am able to run init/plan/apply, but only once. Then the errors come back and I have to do these steps again.
I have to delete my
.terraform
folder every time in order for me to runterraform init/plan/apply
.The error that I get is:
After executing
rm -rf .terraform .terraform.lock.hcl && terraform init && terraform workspace select prod
, I am able to runinit/plan/apply
, but only once. Then the errors come back and I have to do these steps again.Terraform version:
Module version: (Latest? I don't specify the version)