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 public IP support #83

Merged

Conversation

rchenzheng
Copy link
Contributor

  • include examples
  • dynamic and static address
  • update readme

@rchenzheng
Copy link
Contributor Author

Solves #80

@wkharold
Copy link
Contributor

Please merge, this will allow ephemeral external IPs as well.

@mehdicopter
Copy link

When this is going to be merged ?

Copy link
Member

@bharathkkb bharathkkb left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @rchenzheng

  • Can we get tests passing for this? You can do make docker_test_lint to see what is failing for the lint check. I see that some docs also need to be regenerated. Please run make build. Additional details here.

  • The simple example that was modified is also used in our integration tests here. Since two variables was added to that example (nat_ip and network_tier) we will need to make adequate changes. Can we set some defaults, like null for nat_ip and PREMIUM for network_tier so that the example can get an ephemeral ip by default?

@bharathkkb bharathkkb requested a review from morgante May 27, 2020 16:53
@bharathkkb
Copy link
Member

@morgante wanted to confirm that we do want to add support for this in compute_instance module. The solution in #84 only works if the instance_template module is also used in conjunction.

  - include examples
  - dynamic and static address
  - update readme
@rchenzheng
Copy link
Contributor Author

Thanks for the PR @rchenzheng

  • Can we get tests passing for this? You can do make docker_test_lint to see what is failing for the lint check. I see that some docs also need to be regenerated. Please run make build. Additional details here.
  • The simple example that was modified is also used in our integration tests here. Since two variables was added to that example (nat_ip and network_tier) we will need to make adequate changes. Can we set some defaults, like null for nat_ip and PREMIUM for network_tier so that the example can get an ephemeral ip by default?

It's been quite hectic around here, I'll update the PR shortly

@morgante
Copy link
Contributor

@rchenzheng Can you clarify if your use case is specifically to attach an external IP on the VM when the template doesn't have one? I'm not sure I fully follow the scenario where that's necessary.

@rchenzheng
Copy link
Contributor Author

@rchenzheng Can you clarify if your use case is specifically to attach an external IP on the VM when the template doesn't have one? I'm not sure I fully follow the scenario where that's necessary.

Yes attaching a static ip as indicated in #80

@rchenzheng rchenzheng force-pushed the public_ip_support branch from b427e74 to f102103 Compare May 27, 2020 17:27
morgante
morgante previously approved these changes May 27, 2020
Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

Got it. Assuming tests pass, LGTM. Thanks!

@morgante
Copy link
Contributor

FYI this is the error in the test logs:

       Error: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.networkInterfaces[0].accessConfigs[0].natIP': 'null'. The specified external IP address 'null' was not found in region 'us-central1'., invalid
       
         on ../../../../modules/compute_instance/main.tf line 41, in resource "google_compute_instance_from_template" "compute_instance":
         41: resource "google_compute_instance_from_template" "compute_instance" {
       
       
       
       Error: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.networkInterfaces[0].accessConfigs[0].natIP': 'null'. The specified external IP address 'null' was not found in region 'us-central1'., invalid
       
         on ../../../../modules/compute_instance/main.tf line 41, in resource "google_compute_instance_from_template" "compute_instance":
         41: resource "google_compute_instance_from_template" "compute_instance" {
       
       
       
       Error: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.networkInterfaces[0].accessConfigs[0].natIP': 'null'. The specified external IP address 'null' was not found in region 'us-central1'., invalid
       
         on ../../../../modules/compute_instance/main.tf line 41, in resource "google_compute_instance_from_template" "compute_instance":
         41: resource "google_compute_instance_from_template" "compute_instance" {
       
       
       
       Error: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.networkInterfaces[0].accessConfigs[0].natIP': 'null'. The specified external IP address 'null' was not found in region 'us-central1'., invalid
       
         on ../../../../modules/compute_instance/main.tf line 41, in resource "google_compute_instance_from_template" "compute_instance":
         41: resource "google_compute_instance_from_template" "compute_instance" {

@rchenzheng
Copy link
Contributor Author

FYI this is the error in the test logs:

       Error: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.networkInterfaces[0].accessConfigs[0].natIP': 'null'. The specified external IP address 'null' was not found in region 'us-central1'., invalid
       
         on ../../../../modules/compute_instance/main.tf line 41, in resource "google_compute_instance_from_template" "compute_instance":
         41: resource "google_compute_instance_from_template" "compute_instance" {
       
       
       
       Error: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.networkInterfaces[0].accessConfigs[0].natIP': 'null'. The specified external IP address 'null' was not found in region 'us-central1'., invalid
       
         on ../../../../modules/compute_instance/main.tf line 41, in resource "google_compute_instance_from_template" "compute_instance":
         41: resource "google_compute_instance_from_template" "compute_instance" {
       
       
       
       Error: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.networkInterfaces[0].accessConfigs[0].natIP': 'null'. The specified external IP address 'null' was not found in region 'us-central1'., invalid
       
         on ../../../../modules/compute_instance/main.tf line 41, in resource "google_compute_instance_from_template" "compute_instance":
         41: resource "google_compute_instance_from_template" "compute_instance" {
       
       
       
       Error: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.networkInterfaces[0].accessConfigs[0].natIP': 'null'. The specified external IP address 'null' was not found in region 'us-central1'., invalid
       
         on ../../../../modules/compute_instance/main.tf line 41, in resource "google_compute_instance_from_template" "compute_instance":
         41: resource "google_compute_instance_from_template" "compute_instance" {

It's been fixed, thanks

@morgante morgante merged commit dde01ff into terraform-google-modules:master May 27, 2020
raolivei added a commit to scoremedia/terraform-google-vm that referenced this pull request Feb 25, 2021
…s" for TF v0.13 support (#2)

* fix: Correct names for instances in preemptible and regular instance module (terraform-google-modules#81)

BREAKING CHANGE: The preemptible_and_regular_instance_templates modules have had name_prefixes renamed, forcing instances to be recreated.

* chore: fixing typo in instance_template README (terraform-google-modules#86)

* feat: Add support for assigning public IPs directly to instances. (terraform-google-modules#83)

* chore: release 3.0.0 (terraform-google-modules#82)

* updated CHANGELOG.md [ci skip]

* updated README.md

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

* fix terraform-google-modules#88 issues with autogen tmpl for mig (terraform-google-modules#93)

* chore: fix format

* feat: Add stateful disk support (terraform-google-modules#90)

* Added: stateful configuration

* Added: var udpate

* Added: var udpate

* Updated: stateful_disk variable, autogen docs

* feat: Add wait_for_instances and configurable timeout support for mig (terraform-google-modules#96)

BREAKING CHANGE: instance_redistribution_type must now be specified for update policies.

* chore: release 4.0.0 (terraform-google-modules#98)

* fix: relax version constraints to enable terraform 0.13.x compatibility (terraform-google-modules#108)

* chore: Updating Links in README (terraform-google-modules#97) (terraform-google-modules#112)

* Update README.md

* Update README.md

* fix: Terraform version upgrade for compute_instance module from 0.12.6 to 0.12.7 (terraform-google-modules#103)

* fix(UMIG): access_config should be 2D array (terraform-google-modules#111)

BREAKING CHANGE: var.access_config has been changed to a 2D array, with a separate element for each VM.

* chore: release 5.0.0

* feat: Added instance_group_manager output (terraform-google-modules#105)

* add instance_group_manager output

needed to create a stateful MIG in conjunction with https://www.terraform.io/docs/providers/google/r/compute_region_per_instance_config.html

* fix: autogen/outputs.tf.tmpl use {{ module_name }} in instance_group_manager output

Co-authored-by: Morgante Pell <[email protected]>

* chore: release 5.1.0 (terraform-google-modules#115)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

* feat: adds an output for the health check self_links to be consumed by load balancer resources outside this module (terraform-google-modules#119)

* feat: adds an output for the health check self_links to be consumed by load balancer resources outside this module

* chore: docs generation

* moved change up to autogen

* aligning CI and makefile image for docs generation

* feat!: Update default source image and family to latest CentOS 7 (terraform-google-modules#126)

* feat: add TF 0.13 constraint and module attribution (terraform-google-modules#128)

BREAKING CHANGE: Minimum Terraform version increased to 0.13.

* chore: Remove < 0.14 constraints in examples/fixtures [bot-pr] (terraform-google-modules#129)

* chore: release 6.0.0 (terraform-google-modules#127)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

Co-authored-by: GeneralAardvark <[email protected]>
Co-authored-by: fclerg <[email protected]>
Co-authored-by: Richard Chen Zheng <[email protected]>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Pasquale D'Agostino <[email protected]>
Co-authored-by: Morgante Pell <[email protected]>
Co-authored-by: Konstantin Kirpichnikov <[email protected]>
Co-authored-by: Sean Johnson <[email protected]>
Co-authored-by: Brandon J. Bjelland <[email protected]>
Co-authored-by: Darpan Shah <[email protected]>
Co-authored-by: Aaron Yang <[email protected]>
Co-authored-by: Uroš <[email protected]>
Co-authored-by: Ryan Canty <[email protected]>
Co-authored-by: Adrian <[email protected]>
Co-authored-by: Brandon J. Bjelland <[email protected]>
Co-authored-by: Yurii Serhiichuk <[email protected]>
Co-authored-by: Bharath KKB <[email protected]>
Co-authored-by: cloud-foundation-bot <[email protected]>
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

Successfully merging this pull request may close these issues.

5 participants