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

Add support for Terraform 0.12 #13 #16

Merged
merged 1 commit into from
Jul 30, 2019
Merged

Add support for Terraform 0.12 #13 #16

merged 1 commit into from
Jul 30, 2019

Conversation

ingwarr
Copy link
Contributor

@ingwarr ingwarr commented Jul 20, 2019

Fixes #13

@ingwarr ingwarr changed the title Add support for Terraform 0.12 #13 WIP Add support for Terraform 0.12 #13 Jul 20, 2019
@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 20, 2019

@aaron-lane As I see tests failed due to terraform-0.11 in the test container. All tests passed locally.

Copy link

@bohdanyurov-gl bohdanyurov-gl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check and resolve everything

Makefile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
examples/compute_instance/simple/variables.tf Outdated Show resolved Hide resolved
examples/compute_instance/simple/variables.tf Outdated Show resolved Hide resolved
examples/instance_template/additional_disks/variables.tf Outdated Show resolved Hide resolved
test/fixtures/mig/autoscaler/variables.tf Show resolved Hide resolved
test/fixtures/mig/simple/variables.tf Show resolved Hide resolved
test/fixtures/umig/named_ports/variables.tf Show resolved Hide resolved
test/fixtures/umig/simple/variables.tf Show resolved Hide resolved
test/fixtures/umig/static_ips/variables.tf Show resolved Hide resolved
@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 20, 2019

image

@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 20, 2019

image

@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 20, 2019

image

@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 20, 2019

image

@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 20, 2019

image

@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 20, 2019

image

@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 20, 2019

image

@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 20, 2019

image

@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 20, 2019

image

@bohdanyurov-gl
Copy link

@ingwarr Please also combine all commits

Copy link

@bohdanyurov-gl bohdanyurov-gl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add lint test result + link to PR to cft repo for CI

CHANGELOG.md Show resolved Hide resolved
@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 24, 2019

@aaron-lane @bohdanyurov-gl As I see integration test fails due to the existence of instance with current ID, I think this instance should be deleted manually

  module.umig_simple.module.umig.google_compute_instance_from_template.compute_instance[3]: Creation complete after 38s [id=umig-simple-004]
   
   Error: Error creating instance: googleapi: Error 409: The resource 'projects/ci-vm-module/zones/us-central1-a/instances/umig-simple-001' already exists, alreadyExists
   
     on ../../../../modules/umig/main.tf line 43, in resource "google_compute_instance_from_template" "compute_instance":
     43: resource "google_compute_instance_from_template" "compute_instance" {

It works fine locally:
image
image
image
image
image
image

@ingwarr ingwarr changed the title WIP Add support for Terraform 0.12 #13 Add support for Terraform 0.12 #13 Jul 24, 2019
Copy link
Contributor

@aaron-lane aaron-lane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All variables which are intended to be booleans should be explicitly typed as booleans (example 1).

Makefile Outdated Show resolved Hide resolved
network = var.network
subnetwork = var.subnetwork
subnetwork_project = var.subnetwork_project
network_ip = length(var.static_ips) == 0 ? "" : element(local.static_ips, count.index)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ingwarr did you determine if null is appropriate here?

modules/instance_template/variables.tf Outdated Show resolved Hide resolved
modules/instance_template/variables.tf Show resolved Hide resolved
modules/instance_template/main.tf Show resolved Hide resolved
modules/umig/variables.tf Outdated Show resolved Hide resolved
test/ci_integration.sh Outdated Show resolved Hide resolved
test/fixtures/compute_instance/simple/variables.tf Outdated Show resolved Hide resolved
test/fixtures/compute_instance/simple/variables.tf Outdated Show resolved Hide resolved
@aaron-lane
Copy link
Contributor

@ingwarr As discussed out of band, ignore the requests to convert objects to map(any) as that does not support arbitrary fields of differing types. Missing attribute checks can also be dropped as the user will have to explicitly set optional values to null until hashicorp/terraform#19898 is addressed.

modules/mig/main.tf Outdated Show resolved Hide resolved
@ingwarr
Copy link
Contributor Author

ingwarr commented Jul 25, 2019

Tests failed d to:
Error: Error creating instance: googleapi: Error 409: The resource 'projects/ci-vm-module/zones/us-central1-a/instances/umig-static-ips-001' already exists, alreadyExists

 on ../../../../modules/umig/main.tf line 43, in resource "google_compute_instance_from_template" "compute_instance":
 43: resource "google_compute_instance_from_template" "compute_instance" {

So we should delete it manually

Copy link
Contributor

@aaron-lane aaron-lane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All boolean and number variables which were typed as strings should be updated with the appropriate type.

The service account variables should not have null defaults.

examples/mig/full/variables.tf Outdated Show resolved Hide resolved
modules/instance_template/variables.tf Outdated Show resolved Hide resolved
@aaron-lane aaron-lane merged commit 6f23856 into terraform-google-modules:aaron-lane-0.12 Jul 30, 2019
SnowmanSeniorDev added a commit to SnowmanSeniorDev/cloud-foundation-toolkit that referenced this pull request Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants