Skip to content

Commit

Permalink
fix(deps): lint updates for cft/developer-tools v1.18 (#123)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Andrew Peabody <[email protected]>
  • Loading branch information
renovate[bot] and apeabody authored Jan 8, 2024
1 parent 90fdc5d commit 2d57bef
Show file tree
Hide file tree
Showing 25 changed files with 48 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Make will use bash instead of sh
SHELL := /usr/bin/env bash

DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.0
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.18
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
REGISTRY_URL := gcr.io/cloud-foundation-cicd

Expand Down
2 changes: 1 addition & 1 deletion build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ tags:
- 'integration'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.0'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.18'
2 changes: 1 addition & 1 deletion build/lint.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ tags:
- 'lint'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.0'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.18'
2 changes: 1 addition & 1 deletion examples/instance_with_advanced_options/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ output "instance_name" {

output "ipv4" {
description = "The public IP address of the deployed instance"
value = google_compute_instance.vm.network_interface.0.access_config.0.nat_ip
value = google_compute_instance.vm.network_interface[0].access_config[0].nat_ip
}
3 changes: 0 additions & 3 deletions examples/instance_with_attached_disk/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
* limitations under the License.
*/

provider "google" {
}

locals {
instance_name = format("%s-%s", var.instance_name, substr(md5(module.gce-container.container.image), 0, 8))
}
Expand Down
4 changes: 2 additions & 2 deletions examples/instance_with_attached_disk/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ output "volumes" {

output "http_address" {
description = "The IP address on which the HTTP service is exposed"
value = google_compute_instance.vm.network_interface.0.access_config.0.nat_ip
value = google_compute_instance.vm.network_interface[0].access_config[0].nat_ip
}

output "http_port" {
Expand All @@ -46,5 +46,5 @@ output "instance_name" {

output "ipv4" {
description = "The public IP address of the deployed instance"
value = google_compute_instance.vm.network_interface.0.access_config.0.nat_ip
value = google_compute_instance.vm.network_interface[0].access_config[0].nat_ip
}
2 changes: 1 addition & 1 deletion examples/instance_with_config_file/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ output "volumes" {

output "ipv4" {
description = "The public IP address of the deployed instance"
value = google_compute_instance.vm.network_interface.0.access_config.0.nat_ip
value = google_compute_instance.vm.network_interface[0].access_config[0].nat_ip
}
1 change: 0 additions & 1 deletion examples/managed_instance_group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ This example requires that some python libraries be installed, as outlined in `r
| region | The GCP region to deploy instances into | `string` | n/a | yes |
| service\_account | n/a | <pre>object({<br> email = string,<br> scopes = list(string)<br> })</pre> | <pre>{<br> "email": "",<br> "scopes": [<br> "cloud-platform"<br> ]<br>}</pre> | no |
| subnetwork | The name of the subnetwork to deploy instances into | `string` | `"mig-subnet"` | no |
| zone | The GCP zone to deploy instances into | `string` | n/a | yes |

## Outputs

Expand Down
5 changes: 0 additions & 5 deletions examples/managed_instance_group/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ variable "region" {
type = string
}

variable "zone" {
description = "The GCP zone to deploy instances into"
type = string
}

variable "network" {
description = "The GCP network"
type = string
Expand Down
3 changes: 0 additions & 3 deletions examples/simple_instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
* limitations under the License.
*/

provider "google" {
}

locals {
instance_name = format("%s-%s", var.instance_name, substr(md5(module.gce-container.container.image), 0, 8))
}
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_instance/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ output "instance_name" {

output "ipv4" {
description = "The public IP address of the deployed instance"
value = google_compute_instance.vm.network_interface.0.access_config.0.nat_ip
value = google_compute_instance.vm.network_interface[0].access_config[0].nat_ip
}

output "cos_image_name" {
Expand Down
6 changes: 3 additions & 3 deletions modules/cos-coredns/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ data "template_file" "cloud-config" {
image = var.container_image
instance_id = count.index + 1
log_driver = var.log_driver
ip_address = google_compute_address.addresses.*.address[count.index]
ip_address = google_compute_address.addresses[*].address[count.index]
}
}

Expand Down Expand Up @@ -72,7 +72,7 @@ resource "google_compute_instance" "default" {

network_interface {
subnetwork = var.subnetwork
network_ip = google_compute_address.addresses.*.address[count.index]
network_ip = google_compute_address.addresses[*].address[count.index]
access_config {}
}

Expand All @@ -84,7 +84,7 @@ resource "google_compute_instance" "default" {
metadata = {
google-logging-enabled = var.stackdriver_logging
google-monitoring-enabled = var.stackdriver_monitoring
user-data = data.template_file.cloud-config.*.rendered[count.index]
user-data = data.template_file.cloud-config[*].rendered[count.index]
}
}

Expand Down
6 changes: 3 additions & 3 deletions modules/cos-coredns/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

output "instances" {
description = "Instance name => address map."
value = zipmap(google_compute_instance.default.*.name, google_compute_address.addresses.*.address)
value = zipmap(google_compute_instance.default[*].name, google_compute_address.addresses[*].address)
}

output "names" {
description = "List of instance names."
value = [google_compute_instance.default.*.name]
value = [google_compute_instance.default[*].name]
}

output "internal_addresses" {
description = "List of instance internal addresses."
value = [google_compute_instance.default.*.network_interface.0.network_ip]
value = [google_compute_instance.default[*].network_interface[0].network_ip]
}
2 changes: 2 additions & 0 deletions modules/cos-coredns/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ variable "corefile" {

variable "log_driver" {
description = "Docker log driver to use for CoreDNS."
type = string
default = "gcplogs"
}

Expand All @@ -132,6 +133,7 @@ variable "stackdriver_logging" {

variable "stackdriver_monitoring" {
description = "Enable the Stackdriver monitoring agent."
type = bool
default = true
}

Expand Down
4 changes: 4 additions & 0 deletions modules/cos-coredns/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ terraform {
source = "hashicorp/google-beta"
version = ">= 3.53, < 5.0"
}
template = {
source = "hashicorp/template"
version = ">= 2.1.0"
}
}

provider_meta "google" {
Expand Down
6 changes: 3 additions & 3 deletions modules/cos-generic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ data "template_file" "cloud-config" {
custom_var = var.cloud_init_custom_var
instance_id = count.index + 1
instance_name = "${local.prefix}${count.index + 1}"
ip_address = var.reserve_ip ? google_compute_address.addresses.*.address[count.index] : ""
ip_address = var.reserve_ip ? google_compute_address.addresses[*].address[count.index] : ""
}
}

Expand Down Expand Up @@ -69,7 +69,7 @@ resource "google_compute_instance" "default" {

network_interface {
subnetwork = var.subnetwork
network_ip = var.reserve_ip ? google_compute_address.addresses.*.address[count.index] : ""
network_ip = var.reserve_ip ? google_compute_address.addresses[*].address[count.index] : ""
access_config {}
}

Expand All @@ -81,7 +81,7 @@ resource "google_compute_instance" "default" {
metadata = {
google-logging-enabled = var.stackdriver_logging
google-monitoring-enabled = var.stackdriver_monitoring
user-data = data.template_file.cloud-config.*.rendered[count.index]
user-data = data.template_file.cloud-config[*].rendered[count.index]
}

allow_stopping_for_update = var.allow_stopping_for_update
Expand Down
6 changes: 3 additions & 3 deletions modules/cos-generic/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

output "instances" {
description = "Instance name => address map."
value = zipmap(google_compute_instance.default.*.name, google_compute_address.addresses.*.address)
value = zipmap(google_compute_instance.default[*].name, google_compute_address.addresses[*].address)
}

output "names" {
description = "List of instance names."
value = [google_compute_instance.default.*.name]
value = [google_compute_instance.default[*].name]
}

output "internal_addresses" {
description = "List of instance internal addresses."
value = [google_compute_instance.default.*.network_interface.0.network_ip]
value = [google_compute_instance.default[*].network_interface[0].network_ip]
}
4 changes: 4 additions & 0 deletions modules/cos-generic/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ terraform {
source = "hashicorp/google-beta"
version = ">= 3.53, < 5.0"
}
template = {
source = "hashicorp/template"
version = ">= 2.1.0"
}
}

provider_meta "google" {
Expand Down
8 changes: 4 additions & 4 deletions modules/cos-mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ data "template_file" "cloud-config" {
vars = {
image = var.container_image
instance_id = count.index + 1
ip_address = google_compute_address.addresses.*.address[count.index]
ip_address = google_compute_address.addresses[*].address[count.index]
key = lookup(var.kms_data, "key", "")
keyring = lookup(var.kms_data, "keyring", "")
location = lookup(var.kms_data, "location", "")
Expand Down Expand Up @@ -97,12 +97,12 @@ resource "google_compute_instance" "default" {

network_interface {
subnetwork = var.subnetwork
network_ip = google_compute_address.addresses.*.address[count.index]
network_ip = google_compute_address.addresses[*].address[count.index]
access_config {}
}

attached_disk {
source = google_compute_disk.disk-data.*.name[count.index]
source = google_compute_disk.disk-data[*].name[count.index]
device_name = "mysql-data"
}

Expand All @@ -116,7 +116,7 @@ resource "google_compute_instance" "default" {
}

metadata = {
user-data = data.template_file.cloud-config.*.rendered[count.index]
user-data = data.template_file.cloud-config[*].rendered[count.index]
google-logging-enabled = var.stackdriver_logging
google-monitoring-enabled = var.stackdriver_monitoring
}
Expand Down
2 changes: 1 addition & 1 deletion modules/cos-mysql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

output "instances" {
description = "Instance name => address map."
value = zipmap(google_compute_instance.default.*.name, google_compute_address.addresses.*.address)
value = zipmap(google_compute_instance.default[*].name, google_compute_address.addresses[*].address)
}

output "password" {
Expand Down
8 changes: 8 additions & 0 deletions modules/cos-mysql/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ terraform {
source = "hashicorp/google-beta"
version = ">= 3.53, < 5.0"
}
template = {
source = "hashicorp/template"
version = ">= 2.1.0"
}
random = {
source = "hashicorp/random"
version = ">= 3.3.0"
}
}

provider_meta "google" {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/instance_with_config_file/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "random_string" "suffix" {
length = 4
upper = "false"
lower = "true"
number = "false"
numeric = "false"
special = "false"
}

Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/instance_with_config_file/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ terraform {
}
local = {
source = "hashicorp/local"
version = "~> 2.0"
version = ">= 2.0"
}
random = {
source = "hashicorp/random"
version = "~> 3.0"
version = ">= 3.3.0"
}
tls = {
source = "hashicorp/tls"
version = "~> 4.0"
version = ">= 4.0"
}
}
required_version = ">= 0.13"
Expand Down
1 change: 0 additions & 1 deletion test/fixtures/managed_instance_group/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module "example" {
source = "../../../examples/managed_instance_group"
project_id = var.project_id
region = var.region
zone = var.zone
subnetwork = google_compute_subnetwork.main.name
mig_name = "cft-test-${local.example_name}-${random_string.suffix.result}"
image_port = "8080"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shared/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "random_string" "suffix" {
length = 4
upper = "false"
lower = "true"
number = "false"
numeric = "false"
special = "false"
}

Expand Down

0 comments on commit 2d57bef

Please sign in to comment.