Skip to content

Commit

Permalink
fix: Update version of terraform-validator to 2021-03-22 (#103)
Browse files Browse the repository at this point in the history
* fix: Update version of terraform-validator to 2021-03-22

* fix: use different project_prefix for tests to avoid naming clashes
  • Loading branch information
rjerrems committed Apr 8, 2021
1 parent da4e8c1 commit fb2f372
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 4 deletions.
1 change: 1 addition & 0 deletions examples/cloudbuild_enabled/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This example combines the Organization bootstrap module with the Cloud Build sub
| group\_org\_admins | Google Group for GCP Organization Administrators | `string` | n/a | yes |
| org\_id | GCP Organization ID | `string` | n/a | yes |
| org\_project\_creators | Additional list of members to have project creator role accross the organization. Prefix of group: user: or serviceAccount: is required. | `list(string)` | `[]` | no |
| project\_prefix | Name prefix to use for projects created. | `string` | `"cft"` | no |

## Outputs

Expand Down
2 changes: 2 additions & 0 deletions examples/cloudbuild_enabled/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module "seed_bootstrap" {
default_region = var.default_region
org_project_creators = var.org_project_creators
sa_enable_impersonation = true
project_prefix = var.project_prefix
}

module "cloudbuild_bootstrap" {
Expand All @@ -56,4 +57,5 @@ module "cloudbuild_bootstrap" {
terraform_sa_email = module.seed_bootstrap.terraform_sa_email
terraform_sa_name = module.seed_bootstrap.terraform_sa_name
terraform_state_bucket = module.seed_bootstrap.gcs_bucket_tfstate
project_prefix = var.project_prefix
}
6 changes: 6 additions & 0 deletions examples/cloudbuild_enabled/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ variable "org_project_creators" {
type = list(string)
default = []
}

variable "project_prefix" {
description = "Name prefix to use for projects created."
default = "cft"
type = string
}
1 change: 1 addition & 0 deletions examples/simple-folder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This example demonstrates the simplest usage of the GCP organization bootstrap m
| org\_id | GCP Organization ID | `string` | n/a | yes |
| org\_project\_creators | Additional list of members to have project creator role accross the organization. Prefix of group: user: or serviceAccount: is required. | `list(string)` | `[]` | no |
| parent | GCP parent folder id of form folders/{id} | `string` | n/a | yes |
| project\_prefix | Name prefix to use for projects created. | `string` | `"cft"` | no |

## Outputs

Expand Down
1 change: 1 addition & 0 deletions examples/simple-folder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ module "seed_bootstrap" {
group_billing_admins = var.group_billing_admins
default_region = var.default_region
org_project_creators = var.org_project_creators
project_prefix = var.project_prefix
}
6 changes: 6 additions & 0 deletions examples/simple-folder/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ variable "org_project_creators" {
type = list(string)
default = []
}

variable "project_prefix" {
description = "Name prefix to use for projects created."
default = "cft"
type = string
}
1 change: 1 addition & 0 deletions examples/simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This example demonstrates the simplest usage of the GCP organization bootstrap m
| group\_org\_admins | Google Group for GCP Organization Administrators | `string` | n/a | yes |
| org\_id | GCP Organization ID | `string` | n/a | yes |
| org\_project\_creators | Additional list of members to have project creator role accross the organization. Prefix of group: user: or serviceAccount: is required. | `list(string)` | `[]` | no |
| project\_prefix | Name prefix to use for projects created. | `string` | `"cft"` | no |

## Outputs

Expand Down
1 change: 1 addition & 0 deletions examples/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ module "seed_bootstrap" {
group_billing_admins = var.group_billing_admins
default_region = var.default_region
org_project_creators = var.org_project_creators
project_prefix = var.project_prefix
}
6 changes: 6 additions & 0 deletions examples/simple/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ variable "org_project_creators" {
type = list(string)
default = []
}

variable "project_prefix" {
description = "Name prefix to use for projects created."
default = "cft"
type = string
}
2 changes: 1 addition & 1 deletion modules/cloudbuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Functional examples and sample Cloud Build definitions are included in the [exam
| terraform\_sa\_email | Email for terraform service account. | `string` | n/a | yes |
| terraform\_sa\_name | Fully-qualified name of the terraform service account. | `string` | n/a | yes |
| terraform\_state\_bucket | Default state bucket, used in Cloud Build substitutions. | `string` | n/a | yes |
| terraform\_validator\_release | Default terraform-validator release. | `string` | `"2020-09-24"` | no |
| terraform\_validator\_release | Default terraform-validator release. | `string` | `"2021-03-22"` | no |
| terraform\_version | Default terraform version. | `string` | `"0.13.6"` | no |
| terraform\_version\_sha256sum | sha256sum for default terraform version. | `string` | `"55f2db00b05675026be9c898bdd3e8230ff0c5c78dd12d743ca38032092abfc9"` | no |

Expand Down
2 changes: 1 addition & 1 deletion modules/cloudbuild/cloudbuild_builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM gcr.io/cloud-builders/gcloud-slim
# Use ARG so that values can be overriden by user/cloudbuild
ARG TERRAFORM_VERSION=0.13.6
ARG TERRAFORM_VERSION_SHA256SUM=55f2db00b05675026be9c898bdd3e8230ff0c5c78dd12d743ca38032092abfc9
ARG TERRAFORM_VALIDATOR_RELEASE=2020-09-24
ARG TERRAFORM_VALIDATOR_RELEASE=2021-03-22

ENV ENV_TERRAFORM_VERSION=$TERRAFORM_VERSION
ENV ENV_TERRAFORM_VERSION_SHA256SUM=$TERRAFORM_VERSION_SHA256SUM
Expand Down
2 changes: 1 addition & 1 deletion modules/cloudbuild/cloudbuild_builder/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ steps:
substitutions:
_TERRAFORM_VERSION: '0.13.6' # default value
_TERRAFORM_VERSION_SHA256SUM: '55f2db00b05675026be9c898bdd3e8230ff0c5c78dd12d743ca38032092abfc9' # default value
_TERRAFORM_VALIDATOR_RELEASE: '2020-09-24'
_TERRAFORM_VALIDATOR_RELEASE: '2021-03-22'
images: ['${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/terraform']
2 changes: 1 addition & 1 deletion modules/cloudbuild/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ variable "terraform_version_sha256sum" {
variable "terraform_validator_release" {
description = "Default terraform-validator release."
type = string
default = "2020-09-24"
default = "2021-03-22"
}

variable "cloudbuild_plan_filename" {
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/cloudbuild_enabled/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ module "cloudbuild_enabled" {
group_org_admins = var.group_org_admins
group_billing_admins = var.group_billing_admins
default_region = var.default_region
project_prefix = "cft-test-cb"
}

1 change: 1 addition & 0 deletions test/fixtures/simple-folder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ module "simple" {
group_org_admins = var.group_org_admins
group_billing_admins = var.group_billing_admins
default_region = var.default_region
project_prefix = "cft-test-fldr"
}
1 change: 1 addition & 0 deletions test/fixtures/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ module "simple" {
group_org_admins = var.group_org_admins
group_billing_admins = var.group_billing_admins
default_region = var.default_region
project_prefix = "cft-test"
}

0 comments on commit fb2f372

Please sign in to comment.