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

Unsupported argument locals, on terraform plan #7743

Closed
blackcheshire13 opened this issue Oct 4, 2019 · 7 comments
Closed

Unsupported argument locals, on terraform plan #7743

blackcheshire13 opened this issue Oct 4, 2019 · 7 comments
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@blackcheshire13
Copy link

kops version 1.14.0
terraform version 0.12.9
cloud provider aws
kubectl version 1.15.0

After commands
kops update cluster
--out=.
--target=terraform
--state ${STATE}
--name ${CLUSTER_NAME}
kops generate file kubernetes.tf without errors and warnings , next step
terraform init - OK
terraform plan - generate next errors:

Error: Unsupported argument

  on kubernetes.tf line 1:
   1: locals = {

An argument named "locals" is not expected here. Did you mean to define a
block of type "locals"?
Error: Unsupported argument

  on kubernetes.tf line 594:
 594: terraform = {

An argument named "terraform" is not expected here. Did you mean to define a
block of type "terraform"?

And many errors with type Attribute redefined

tag = {

The argument "tag" was already set at kubernetes.tf:200,3-6. Each argument may
be set only once.

Please help, maybe i use wrong version terraform? What version terraform need?

@blackcheshire13
Copy link
Author

Yees, i use wrong version terraform)) Please write on main page - https://github.com/kubernetes/kops/blob/master/docs/terraform.md
KOPS NOT SUPPORTED TERRAFORM > 0.11

@jiraguha
Copy link

Hey guys,
I have the same issue. What should be done?
Downgrading terraform? Or you will make moves with Kops to make it work with the latest terraform apis?
Thx

@fred-vogt
Copy link

This is being worked on in #7052

For now one possible workaround:

  • post-process the kops terraform output and use terraform 0.12upgrade to fixup the block assignments

Details

If kops is creating the default route you'll need to change the resource name to be terraform-12 compliant:

resource "aws_route" "0-0-0-0--0" {
  route_table_id         = "${aws_route_table...}"
  destination_cidr_block = "0.0.0.0/0"
  gateway_id             = "${aws_internet_gateway...}"
}

=>

resource "aws_route" "default-0-0-0-0--0" {
  route_table_id         = "${aws_route_table...}"
  destination_cidr_block = "0.0.0.0/0"
  gateway_id             = "${aws_internet_gateway...}"
}

Same for any additional CIDR-blocks:

resource "aws_vpc_ipv4_cidr_block_association" "10-1-0-0--16" {
  vpc_id     = "${aws_vpc....}"
  cidr_block = "10.1.0.0/16"
}

=>

resource "aws_vpc_ipv4_cidr_block_association" "vpc-cidr-block-10-1-0-0--16" {
  vpc_id     = "${aws_vpc....}"
  cidr_block = "10.1.0.0/16"
}

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 17, 2020
@smaillns
Copy link

smaillns commented Mar 15, 2020

please check this one #7052 (comment)

@rifelpet
Copy link
Member

Terraform support has been added in #8825 and will be a part of the next Kops 1.18 release
/close

@k8s-ci-robot
Copy link
Contributor

@rifelpet: Closing this issue.

In response to this:

Terraform support has been added in #8825 and will be a part of the next Kops 1.18 release
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

7 participants