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

Missing required argument #1938

Open
gavinc-git opened this issue Oct 18, 2024 · 4 comments
Open

Missing required argument #1938

gavinc-git opened this issue Oct 18, 2024 · 4 comments

Comments

@gavinc-git
Copy link

gavinc-git commented Oct 18, 2024

I am trialing out capturing my DevOps environment, starting with the basic

terraformer import aws --resources=vpc --profile=devops

This runs:

2024/10/18 11:44:38 aws importing default region
2024/10/18 11:44:38 aws importing... vpc
2024/10/18 11:44:39 aws done importing vpc
2024/10/18 11:44:39 Number of resources for service vpc: 2
2024/10/18 11:44:39 Refreshing state... aws_vpc.tfer--vpc-XXXXXXXXXXXXXXX0
2024/10/18 11:44:39 Refreshing state... aws_vpc.tfer--vpc-XXXXXXXXXXXXXXXc
2024/10/18 11:44:39 Filtered number of resources for service vpc: 2
2024/10/18 11:44:39 aws Connecting....
2024/10/18 11:44:39 aws save vpc
2024/10/18 11:44:39 aws save tfstate for vpc

When i then try to init in that directory:

cd /generated/aws/vpc

terraform init

I get this:

Initializing the backend...
╷
│ Error: Invalid legacy provider address
│
│ This configuration or its associated state refers to the unqualified provider "aws".
│
│ You must complete the Terraform 0.13 upgrade process before upgrading to later versions.

So ran this to update the provider, and then re-init'd

terraform state replace-provider -- -/aws hashicorp/aws
terraform init
terraform plan

I get the following:

│ Warning: Argument is deprecated
│
│   with aws_vpc.tfer--vpc-02dbed6323637034c,
│   on vpc.tf line 4, in resource "aws_vpc" "tfer--vpc-02dbed6323637034c":
│    4:   enable_classiclink                   = "false"
│
│ With the retirement of EC2-Classic the enable_classiclink attribute has been deprecated and will be removed in a future version.
│
│ (and 3 more similar warnings elsewhere)
╵
╷
│ Error: Missing required argument
│
│   with aws_vpc.tfer--vpc-02dbed6323637034c,
│   on vpc.tf line 10, in resource "aws_vpc" "tfer--vpc-02dbed6323637034c":
│   10:   ipv6_netmask_length                  = "0"
│
│ "ipv6_netmask_length": all of `ipv6_ipam_pool_id,ipv6_netmask_length` must be specified
╵
╷
│ Error: Missing required argument
│
│   with aws_vpc.tfer--vpc-0e2e029894a2aed30,
│   on vpc.tf line 32, in resource "aws_vpc" "tfer--vpc-0e2e029894a2aed30":
│   32:   ipv6_netmask_length                  = "0"
│
│ "ipv6_netmask_length": all of `ipv6_ipam_pool_id,ipv6_netmask_length` must be specified

Am i missing something??

System is WSL2 Ubuntu
Terraform

Terraform v1.9.8
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v4.67.0

Terraformer: I'm using a build of the tip of master

@gavinc-git
Copy link
Author

If I remove the IPv6 parts from all outputted files, it does run/plan

Is there a way I can remove this?

And a way to update the provider across ALL output in one go?

@gavinc-git
Copy link
Author

Also ec2_instance is throwing alot of issues

Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-03e6e36e08139edc6_WireGuard-0020-Server,
│   on instance.tf line 10, in resource "aws_instance" "tfer--i-03e6e36e08139edc6_WireGuard-0020-Server":
│   10:   cpu_core_count = "1"
│
│ "cpu_core_count": conflicts with cpu_options.0.core_count
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-03e6e36e08139edc6_WireGuard-0020-Server,
│   on instance.tf line 13, in resource "aws_instance" "tfer--i-03e6e36e08139edc6_WireGuard-0020-Server":
│   13:     core_count       = "1"
│
│ "cpu_options.0.core_count": conflicts with cpu_core_count
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-03e6e36e08139edc6_WireGuard-0020-Server,
│   on instance.tf line 14, in resource "aws_instance" "tfer--i-03e6e36e08139edc6_WireGuard-0020-Server":
│   14:     threads_per_core = "2"
│
│ "cpu_options.0.threads_per_core": conflicts with cpu_threads_per_core
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-03e6e36e08139edc6_WireGuard-0020-Server,
│   on instance.tf line 17, in resource "aws_instance" "tfer--i-03e6e36e08139edc6_WireGuard-0020-Server":
│   17:   cpu_threads_per_core = "2"
│
│ "cpu_threads_per_core": conflicts with cpu_options.0.threads_per_core
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0a7d3dd11a79c1047_Octopus-0020-Server,
│   on instance.tf line 98, in resource "aws_instance" "tfer--i-0a7d3dd11a79c1047_Octopus-0020-Server":
│   98:   cpu_core_count = "1"
│
│ "cpu_core_count": conflicts with cpu_options.0.core_count
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0a7d3dd11a79c1047_Octopus-0020-Server,
│   on instance.tf line 101, in resource "aws_instance" "tfer--i-0a7d3dd11a79c1047_Octopus-0020-Server":
│  101:     core_count       = "1"
│
│ "cpu_options.0.core_count": conflicts with cpu_core_count
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0a7d3dd11a79c1047_Octopus-0020-Server,
│   on instance.tf line 102, in resource "aws_instance" "tfer--i-0a7d3dd11a79c1047_Octopus-0020-Server":
│  102:     threads_per_core = "2"
│
│ "cpu_options.0.threads_per_core": conflicts with cpu_threads_per_core
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0a7d3dd11a79c1047_Octopus-0020-Server,
│   on instance.tf line 105, in resource "aws_instance" "tfer--i-0a7d3dd11a79c1047_Octopus-0020-Server":
│  105:   cpu_threads_per_core = "2"
│
│ "cpu_threads_per_core": conflicts with cpu_options.0.threads_per_core
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0ab84ad1ba773650f_Docker-0020-Host,
│   on instance.tf line 204, in resource "aws_instance" "tfer--i-0ab84ad1ba773650f_Docker-0020-Host":
│  204:   cpu_core_count = "1"
│
│ "cpu_core_count": conflicts with cpu_options.0.core_count
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0ab84ad1ba773650f_Docker-0020-Host,
│   on instance.tf line 207, in resource "aws_instance" "tfer--i-0ab84ad1ba773650f_Docker-0020-Host":
│  207:     core_count       = "1"
│
│ "cpu_options.0.core_count": conflicts with cpu_core_count
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0ab84ad1ba773650f_Docker-0020-Host,
│   on instance.tf line 208, in resource "aws_instance" "tfer--i-0ab84ad1ba773650f_Docker-0020-Host":
│  208:     threads_per_core = "2"
│
│ "cpu_options.0.threads_per_core": conflicts with cpu_threads_per_core
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0ab84ad1ba773650f_Docker-0020-Host,
│   on instance.tf line 211, in resource "aws_instance" "tfer--i-0ab84ad1ba773650f_Docker-0020-Host":
│  211:   cpu_threads_per_core = "2"
│
│ "cpu_threads_per_core": conflicts with cpu_options.0.threads_per_core
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0c4ca439961deb3f8_WireGuard-0020-Server-0020---0020-GUI,
│   on instance.tf line 287, in resource "aws_instance" "tfer--i-0c4ca439961deb3f8_WireGuard-0020-Server-0020---0020-GUI":
│  287:   cpu_core_count = "1"
│
│ "cpu_core_count": conflicts with cpu_options.0.core_count
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0c4ca439961deb3f8_WireGuard-0020-Server-0020---0020-GUI,
│   on instance.tf line 290, in resource "aws_instance" "tfer--i-0c4ca439961deb3f8_WireGuard-0020-Server-0020---0020-GUI":
│  290:     core_count       = "1"
│
│ "cpu_options.0.core_count": conflicts with cpu_core_count
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0c4ca439961deb3f8_WireGuard-0020-Server-0020---0020-GUI,
│   on instance.tf line 291, in resource "aws_instance" "tfer--i-0c4ca439961deb3f8_WireGuard-0020-Server-0020---0020-GUI":
│  291:     threads_per_core = "2"
│
│ "cpu_options.0.threads_per_core": conflicts with cpu_threads_per_core
╵
╷
│ Error: Conflicting configuration arguments
│
│   with aws_instance.tfer--i-0c4ca439961deb3f8_WireGuard-0020-Server-0020---0020-GUI,
│   on instance.tf line 294, in resource "aws_instance" "tfer--i-0c4ca439961deb3f8_WireGuard-0020-Server-0020---0020-GUI":
│  294:   cpu_threads_per_core = "2"
│
│ "cpu_threads_per_core": conflicts with cpu_options.0.threads_per_core

@yakirlevi
Copy link

I have the same problem when importing vpc

@ceydaduzgec
Copy link

ceydaduzgec commented Dec 4, 2024

I solved the EC2 error by deleting deprecated cpu related variables.

cpu_core_count = "1"

  cpu_options {
    core_count       = "1"
    threads_per_core = "1"
  }

  cpu_threads_per_core = "1"

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

3 participants