Skip to content

Commit

Permalink
feat: update TPG version constraints to allow 4.0 (#133)
Browse files Browse the repository at this point in the history
* feat: update TPG version constraints to allow 4.0

* fix resources, add dep on beta provider

Co-authored-by: bharathkkb <bharathkrishnakb@gmail.com>
  • Loading branch information
cloud-foundation-bot and bharathkkb committed Dec 2, 2021
1 parent 62ddd11 commit a1a53fb
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 6 deletions.
25 changes: 25 additions & 0 deletions examples/shared_vpc_internal/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.0"
}
}
required_version = ">= 0.13"
}
25 changes: 25 additions & 0 deletions examples/vault-on-gce/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.0"
}
}
required_version = ">= 0.13"
}
2 changes: 1 addition & 1 deletion modules/cluster/crypto.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ resource "tls_locally_signed_cert" "vault-server" {
resource "google_kms_secret_ciphertext" "vault-tls-key-encrypted" {
count = local.manage_tls_count

crypto_key = google_kms_crypto_key.vault-init.self_link
crypto_key = google_kms_crypto_key.vault-init.id
plaintext = tls_private_key.vault-server[0].private_key_pem
}

Expand Down
2 changes: 1 addition & 1 deletion modules/cluster/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ resource "google_storage_bucket_iam_member" "vault" {

# Give kms cryptokey-level permissions to the service account.
resource "google_kms_crypto_key_iam_member" "ck-iam" {
crypto_key_id = google_kms_crypto_key.vault-init.self_link
crypto_key_id = google_kms_crypto_key.vault-init.id
role = "roles/cloudkms.cryptoKeyEncrypterDecrypter"
member = local.service_account_member
}
Expand Down
3 changes: 2 additions & 1 deletion modules/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ resource "google_compute_forwarding_rule" "external" {

# Vault instance group manager
resource "google_compute_region_instance_group_manager" "vault" {
project = var.project_id
provider = google-beta
project = var.project_id

name = "vault-igm"
region = var.region
Expand Down
11 changes: 10 additions & 1 deletion modules/cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,21 @@ terraform {

google = {
source = "hashicorp/google"
version = "~> 3.53"
version = ">= 3.53, < 5.0"
}

google-beta = {
source = "hashicorp/google-beta"
version = ">= 3.53, < 5.0"
}
}

provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vault:cluster/v6.0.0"
}

provider_meta "google-beta" {
module_name = "blueprints/terraform/terraform-google-vault:cluster/v6.0.0"
}

}
5 changes: 4 additions & 1 deletion test/setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
*/

terraform {
required_version = ">= 0.12.6"
required_version = ">= 0.13"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.53"
}
random = {
source = "hashicorp/random"
}
}
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ terraform {

google = {
source = "hashicorp/google"
version = "~> 3.53"
version = ">= 3.53, < 5.0"
}
}

Expand Down

0 comments on commit a1a53fb

Please sign in to comment.