Skip to content

Commit

Permalink
fix!: renamed the ephemeral_ip variable to external_ip (#105)
Browse files Browse the repository at this point in the history
* renamed the ephemeral_ip variable to external_ip

* Documentation update

* Added upgrade path doc
  • Loading branch information
andypanix committed Mar 31, 2022
1 parent feaa6b1 commit 1a63d4c
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ If the user does not share the same domain as the org the bastion is in, you wil
| create\_instance\_from\_template | Whether to create and instance from the template or not. If false, no instance is created, but the instance template is created and usable by a MIG | `bool` | `true` | no |
| disk\_size\_gb | Boot disk size in GB | `number` | `100` | no |
| disk\_type | Boot disk type, can be either pd-ssd, local-ssd, or pd-standard | `string` | `"pd-standard"` | no |
| ephemeral\_ip | Set to true if an ephemeral external IP/DNS is required, must also set access\_config if true | `bool` | `false` | no |
| external\_ip | Set to true if an ephemeral or static external IP/DNS is required, must also set access\_config if true | `bool` | `false` | no |
| fw\_name\_allow\_ssh\_from\_iap | Firewall rule name for allowing SSH from IAP | `string` | `"allow-ssh-from-iap-to-tunnel"` | no |
| host\_project | The network host project ID | `string` | `""` | no |
| image | Source image for the Bastion. If image is not specified, image\_family will be used (which is the default). | `string` | `""` | no |
Expand Down
24 changes: 24 additions & 0 deletions docs/upgrading_to_v5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Upgrading to terraform-google-bastion-host v5.x

The v5.0 release of Google Bastion Host is a backwards incompatible release.
Below a list of the breaking changes and the migration instructions.

## ⚠ BREAKING CHANGES

* Renamed the `ephemeral_ip` variable to `external_ip` as it is possible to specify not only an ephemeral IP but also a static external IP.

## Migration Instructions

The following diff shows the breaking changes introduced in version 5 compared to version 4.

```diff
module "iap_bastion" {
source = "terraform-google-modules/bastion-host/google"
- version = "v4.1"
+ version = "v5.0"

- ephemeral_ip = true
+ external_ip = true

}
```
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ resource "google_compute_instance_from_template" "bastion_vm" {
network_interface {
subnetwork = var.subnet
subnetwork_project = var.host_project != "" ? var.host_project : var.project
access_config = var.ephemeral_ip ? var.access_config : []
access_config = var.external_ip ? var.access_config : []
}

source_instance_template = module.instance_template.self_link
Expand Down
5 changes: 1 addition & 4 deletions modules/bastion-group/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-bastion-host:bastion-group/v4.1.0"
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/terraform-google-bastion-host:bastion-group/v4.1.0"
module_name = "blueprints/terraform/terraform-google-bastion-host:bastion-group/v5.0.0"
}
}
2 changes: 1 addition & 1 deletion modules/iap-tunneling/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-bastion-host:iap-tunneling/v4.1.0"
module_name = "blueprints/terraform/terraform-google-bastion-host:iap-tunneling/v5.0.0"
}
}
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ variable "metadata" {
default = {}
}

variable "ephemeral_ip" {
variable "external_ip" {
type = bool
description = "Set to true if an ephemeral external IP/DNS is required, must also set access_config if true"
description = "Set to true if an ephemeral or static external IP/DNS is required, must also set access_config if true"
default = false
}

Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-bastion-host/v4.1.0"
module_name = "blueprints/terraform/terraform-google-bastion-host/v5.0.0"
}
}

0 comments on commit 1a63d4c

Please sign in to comment.