Skip to content

Commit

Permalink
Merge branch 'master' into fix/enable-meta
Browse files Browse the repository at this point in the history
  • Loading branch information
g-awmalik authored Sep 21, 2023
2 parents a36f8c1 + d5eac17 commit 5cb6b90
Show file tree
Hide file tree
Showing 18 changed files with 184 additions and 138 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

All notable changes to this project will be documented in this file. See [conventional-commits](https://www.conventionalcommits.org/) for commit guidelines.

## [10.0.0](https://github.com/terraform-google-modules/terraform-google-vm/compare/v9.0.0...v10.0.0) (2023-09-21)


### ⚠ BREAKING CHANGES

* add instances_details sensitive output ([#308](https://github.com/terraform-google-modules/terraform-google-vm/issues/308))
* allow to override umig availability zones ([#329](https://github.com/terraform-google-modules/terraform-google-vm/issues/329))
* enable fuller networking features in instance_template module ([#330](https://github.com/terraform-google-modules/terraform-google-vm/issues/330))

### Features

* Add resource_manager_tags to module and use it on google_compute_instance_from_template. ([#344](https://github.com/terraform-google-modules/terraform-google-vm/issues/344)) ([652a98e](https://github.com/terraform-google-modules/terraform-google-vm/commit/652a98e7561fdd20ce2e676cc6668572078aac5b))
* allow to override umig availability zones ([#329](https://github.com/terraform-google-modules/terraform-google-vm/issues/329)) ([4dc9d57](https://github.com/terraform-google-modules/terraform-google-vm/commit/4dc9d57cb81128b9f487d7f203831a8d4c6ecfd0))
* enable fuller networking features in instance_template module ([#330](https://github.com/terraform-google-modules/terraform-google-vm/issues/330)) ([7917ba6](https://github.com/terraform-google-modules/terraform-google-vm/commit/7917ba6924e2bd8a04b8e25236ec451e5ea1923c))
* support self_link_unique output of instance template resource ([#347](https://github.com/terraform-google-modules/terraform-google-vm/issues/347)) ([fab60cd](https://github.com/terraform-google-modules/terraform-google-vm/commit/fab60cd66f1abed795acf4bfdf0098641bb510c1))
* support setting instance_termination_action for Spot VMs ([#346](https://github.com/terraform-google-modules/terraform-google-vm/issues/346)) ([6f74715](https://github.com/terraform-google-modules/terraform-google-vm/commit/6f7471557f2beea94b91f81168aba50878737aa5))
* support setting nic_type of primary network interface ([#334](https://github.com/terraform-google-modules/terraform-google-vm/issues/334)) ([f067e54](https://github.com/terraform-google-modules/terraform-google-vm/commit/f067e54fd1006e0623677d60686fd95d8d625fd0))


### Bug Fixes

* add instances_details sensitive output ([#308](https://github.com/terraform-google-modules/terraform-google-vm/issues/308)) ([85fd51e](https://github.com/terraform-google-modules/terraform-google-vm/commit/85fd51e618211a2333e3fb3b6a8d2addf74e2ad0))
* minor lint fixes ([#333](https://github.com/terraform-google-modules/terraform-google-vm/issues/333)) ([6750fec](https://github.com/terraform-google-modules/terraform-google-vm/commit/6750fec417e1a3db92312e1bb833039df6328a19))
* remove unnecessary validation block ([#335](https://github.com/terraform-google-modules/terraform-google-vm/issues/335)) ([84fbd1f](https://github.com/terraform-google-modules/terraform-google-vm/commit/84fbd1fa0df737accffd61d7fbbe8febee18b56e))

## [9.0.0](https://github.com/terraform-google-modules/terraform-google-vm/compare/v8.0.1...v9.0.0) (2023-08-22)


Expand Down
4 changes: 2 additions & 2 deletions autogen/versions.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:{% if mig %}mig{% else %}mig_with_percent{% endif %}/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:{% if mig %}mig{% else %}mig_with_percent{% endif %}/v10.0.0"
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/terraform-google-vm:{% if mig %}mig{% else %}mig_with_percent{% endif %}/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:{% if mig %}mig{% else %}mig_with_percent{% endif %}/v10.0.0"
}
}
2 changes: 1 addition & 1 deletion modules/compute_disk_snapshot/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v10.0.0"
}
}
1 change: 1 addition & 0 deletions modules/compute_instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ See the [simple](https://github.com/terraform-google-modules/terraform-google-vm
| network | Network to deploy to. Only one of network or subnetwork should be specified. | `string` | `""` | no |
| num\_instances | Number of instances to create. This value is ignored if static\_ips is provided. | `number` | `"1"` | no |
| region | Region where the instances should be created. | `string` | `null` | no |
| resource\_manager\_tags | (Optional) A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. In Terraform, this value cannot be updated and changing it will recreate the resource. | `map(string)` | `null` | no |
| resource\_policies | (Optional) A list of short names or self\_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. | `list(string)` | `[]` | no |
| static\_ips | List of static IPs for VM instances | `list(string)` | `[]` | no |
| subnetwork | Subnet to deploy to. Only one of network or subnetwork should be specified. | `string` | `""` | no |
Expand Down
4 changes: 4 additions & 0 deletions modules/compute_instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ resource "google_compute_instance_from_template" "compute_instance" {
resource_policies = var.resource_policies
labels = var.labels

params {
resource_manager_tags = var.resource_manager_tags
}

dynamic "network_interface" {
for_each = local.network_interface

Expand Down
6 changes: 6 additions & 0 deletions modules/compute_instance/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,9 @@ variable "labels" {
description = "(Optional) Labels to override those from the template, provided as a map"
default = null
}

variable "resource_manager_tags" {
description = "(Optional) A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. In Terraform, this value cannot be updated and changing it will recreate the resource."
type = map(string)
default = null
}
2 changes: 1 addition & 1 deletion modules/compute_instance/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v10.0.0"
}
}
2 changes: 2 additions & 0 deletions modules/instance_template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ See the [simple](../../examples/instance_template/simple) for a usage example.
| source\_image\_family | Source image family. If neither source\_image nor source\_image\_family is specified, defaults to the latest public CentOS image. | `string` | `"centos-7"` | no |
| source\_image\_project | Project where the source image comes from. The default project contains CentOS images. | `string` | `"centos-cloud"` | no |
| spot | Provision a SPOT instance | `bool` | `false` | no |
| spot\_instance\_termination\_action | Action to take when Compute Engine preempts a Spot VM. | `string` | `"STOP"` | no |
| stack\_type | The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are `IPV4_IPV6` or `IPV4_ONLY`. Default behavior is equivalent to IPV4\_ONLY. | `string` | `null` | no |
| startup\_script | User startup script to run when instances spin up | `string` | `""` | no |
| subnetwork | The name of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided. | `string` | `""` | no |
Expand All @@ -61,6 +62,7 @@ See the [simple](../../examples/instance_template/simple) for a usage example.
|------|-------------|
| name | Name of instance template |
| self\_link | Self-link of instance template |
| self\_link\_unique | Unique self-link of instance template (recommended output to use instead of self\_link) |
| tags | Tags that will be associated with instance(s) |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
2 changes: 1 addition & 1 deletion modules/instance_template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ resource "google_compute_instance_template" "tpl" {
automatic_restart = local.automatic_restart
on_host_maintenance = local.on_host_maintenance
provisioning_model = var.spot ? "SPOT" : null
instance_termination_action = var.spot ? "STOP" : null
instance_termination_action = var.spot ? var.spot_instance_termination_action : null
}

advanced_machine_features {
Expand Down
5 changes: 5 additions & 0 deletions modules/instance_template/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
* limitations under the License.
*/

output "self_link_unique" {
description = "Unique self-link of instance template (recommended output to use instead of self_link)"
value = google_compute_instance_template.tpl.self_link_unique
}

output "self_link" {
description = "Self-link of instance template"
value = google_compute_instance_template.tpl.self_link
Expand Down
11 changes: 11 additions & 0 deletions modules/instance_template/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ variable "on_host_maintenance" {
default = "MIGRATE"
}

variable "spot_instance_termination_action" {
description = "Action to take when Compute Engine preempts a Spot VM."
type = string
default = "STOP"

validation {
condition = contains(["STOP", "DELETE"], var.spot_instance_termination_action)
error_message = "Allowed values for spot_instance_termination_action are: \"STOP\" or \"DELETE\"."
}
}

variable "region" {
type = string
description = "Region where the instance template should be created."
Expand Down
2 changes: 1 addition & 1 deletion modules/instance_template/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:instance_template/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:instance_template/v10.0.0"
}
}
4 changes: 2 additions & 2 deletions modules/mig/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:mig/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:mig/v10.0.0"
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/terraform-google-vm:mig/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:mig/v10.0.0"
}
}
4 changes: 2 additions & 2 deletions modules/mig_with_percent/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:mig_with_percent/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:mig_with_percent/v10.0.0"
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/terraform-google-vm:mig_with_percent/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:mig_with_percent/v10.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ terraform {
google-beta = ">= 3.88, < 5.0"
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v10.0.0"
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v10.0.0"
}
}
2 changes: 1 addition & 1 deletion modules/umig/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:umig/v9.0.0"
module_name = "blueprints/terraform/terraform-google-vm:umig/v10.0.0"
}
}
75 changes: 38 additions & 37 deletions test/integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,77 +3,78 @@ module github.com/terraform-google-modules/terraform-google-sql-db/test/integrat
go 1.20

require (
github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test v0.8.0
github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test v0.8.1
github.com/stretchr/testify v1.8.4
)

require (
cloud.google.com/go v0.110.2 // indirect
cloud.google.com/go/compute v1.19.3 // indirect
cloud.google.com/go v0.110.7 // indirect
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.0.1 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cloud.google.com/go/iam v1.1.2 // indirect
cloud.google.com/go/storage v1.33.0 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/aws/aws-sdk-go v1.44.271 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/aws/aws-sdk-go v1.45.5 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-errors/errors v1.5.0 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.9.1 // indirect
github.com/gruntwork-io/terratest v0.43.11 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gruntwork-io/terratest v0.43.13 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.7.1 // indirect
github.com/hashicorp/go-getter v1.7.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl/v2 v2.16.2 // indirect
github.com/hashicorp/terraform-json v0.16.0 // indirect
github.com/jinzhu/copier v0.3.5 // indirect
github.com/hashicorp/hcl/v2 v2.18.0 // indirect
github.com/hashicorp/terraform-json v0.17.1 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-zglob v0.0.4 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.2-0.20210821155943-2d9075ca8770 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/tidwall/gjson v1.15.0 // indirect
github.com/tidwall/gjson v1.16.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
github.com/tmccombs/hcl2json v0.5.0 // indirect
github.com/tmccombs/hcl2json v0.6.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/zclconf/go-cty v1.13.2 // indirect
github.com/zclconf/go-cty v1.14.0 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.124.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e // indirect
google.golang.org/grpc v1.55.0 // indirect
google.golang.org/api v0.138.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/grpc v1.58.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/kube-openapi v0.0.0-20230525220651-2546d827e515 // indirect
sigs.k8s.io/kustomize/kyaml v0.14.2 // indirect
k8s.io/kube-openapi v0.0.0-20230905202853-d090da108d2f // indirect
sigs.k8s.io/kustomize/kyaml v0.14.3 // indirect
)
Loading

0 comments on commit 5cb6b90

Please sign in to comment.