-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Support terraform 0.12 hcl syntax #6329
Conversation
Hi @sergeylanzman. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
b37db4b
to
46dea7a
Compare
46dea7a
to
591439a
Compare
/ok-to-test Thanks for the fix! Looks like lots of manual work, very much appreciated! |
It'd be nice if we could use the new HCL library, but the readme makes it sound like this repo is only temporary: https://github.com/hashicorp/hcl2 I guess |
Thanks for investigating and for fixing @sergeylanzman. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justinsb, sergeylanzman The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
(I assume this output works in earlier versions of terraform as well - like 0.11 ?) |
Looks like more tests that need to be updated to the new form. Do we know when terraform 0.12 is landing? This feels like such a big change I'm wondering if they'll be able to force everyone to move... |
|
@sergeylanzman thanks - I think you might have to rebase to pick up the new test that is failing (in /retest |
remove "=" from multi block assign Terraform from 0.12 not support multi block assign with "="
New changes are detected. LGTM label has been removed. |
remove "=" from multi block assign Terraform from 0.12 not support multi block assign with "="
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resource "aws_route" "0-0-0-0--0" {
route_table_id = "${aws_route_table.additionalcidr-example-com.id}"
destination_cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.additionalcidr-example-com.id}"
}
From the v0.12 upgrade guide:
The tasks it may suggest you perform could include:
Renaming any resources or provider aliases that have names that start with digits, because that is no longer valid in Terraform 0.12.
Fixing the |
We are on Terraform 0.12.3 and just starting out with Kops. The generated |
@demisx I simply renamed the 0-0-0-0 aws route, run |
@lorantonodipo Oh, nice! Thank you for your prompt reply. Do you have any recommendations on what this route should be named? This is what got generated for me for an existing VPC with 3 AZS and public/private subnet in each one. Will
|
I just renamed this one, however I was a bit sloppy and I just renamed it to And you understanding is correct (I think), that is the route to use the internet gateway for to get to the internet. |
Regarding the route resource name incompatibility, I have one proposed fix: This would require terraform users to Alternatively we rename the resource closer to the hcl rendering code, perhaps like this: specifically this: rifelpet@f7bd6dd#diff-b83a0a8f383853739ac00a4d5481e818 Writing this fix uncovered that the Thoughts on a better prefix or better approach to renaming these two resources? |
Since "0.0.0.0" represents the default route, perhaps it could be named |
Is this PR will be merged soon, we can expect it to be inside kops 1.13.0, or 1.12.3 ? |
@sergeylanzman @justinsb @chrisz100 This PR is stalled ? |
Out of curiosity, I ran Using the following config: resource "aws_ebs_volume" "example" {
availability_zone = "us-east-2a"
size = 40
tags {
"hello/world" = "HelloWorld"
}
} $ terraform plan
Error: Invalid argument name
on main.tf line 10, in resource "aws_ebs_volume" "example":
10: "hello/world" = "HelloWorld"
Argument names must not be quoted. Based on hashicorp/terraform#19240, I assume the correct format would be: resource "aws_ebs_volume" "example" {
availability_zone = "us-east-2a"
size = 40
- tags {
+ tags = {
"hello/world" = "HelloWorld"
}
} Would this mean this PR needs an additional call to s = strings.Replace(s, " = {", " {", -1)
s = strings.Replace(s, "tags {", "tags = {", -1)
...
...
...
formatted = []byte(strings.Replace(string(formatted), " = {", " {", -1))
formatted = []byte(strings.Replace(string(formatted), "tags {", "tags = {", -1)) |
Any updates on this? Would be super helpful to have in 1.15. |
bump :) whats left to do? |
@sergeylanzman: PR needs rebase. 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. |
@sergeylanzman: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
Any updates here? Does this just need a rebase? |
See #7052 (comment) |
This work was superseded by #8825 so I think its safe to close this out |
@rifelpet: Closed this PR. In response to this:
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. |
remove "=" from multi block assign
Terraform from 0.12 not support multi block assign with "=" hashicorp/terraform#19156