Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: full modernize #111

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# 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.

releaseType: terraform-module
handleGHRelease: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Session.vim
*.tfstate
*.tfstate.*

# tf lock file
**/.terraform.lock.hcl

# Crash log files
crash.log

Expand Down
3 changes: 0 additions & 3 deletions 5-infrastructure/business_unit_1/development/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
| boa\_sql\_project\_id | Project ID for SQL | `string` | n/a | yes |
| enforce\_bin\_auth\_policy | Enable or Disable creation of binary authorization policy | `bool` | `false` | no |
| gcp\_shared\_vpc\_project\_id | The host project id of the shared VPC | `string` | n/a | yes |
| gke\_cluster\_1\_cidr\_block | The primary IPv4 cidr block for the first GKE cluster. | `string` | `"100.64.78.0/28"` | no |
| gke\_cluster\_2\_cidr\_block | The primary IPv4 cidr block for the second GKE cluster. | `string` | `"100.65.70.0/28"` | no |
| gke\_mci\_cluster\_cidr\_block | The primary IPv4 cidr block for multi-cluster ingress (MCI). | `string` | `"100.64.70.0/28"` | no |
| location\_primary | The primary region for deployment | `string` | `"us-east1"` | no |
| location\_secondary | The secondary region for deployment | `string` | `"us-west1"` | no |
| shared\_vpc\_name | The shared VPC network name | `string` | n/a | yes |
Expand Down
6 changes: 1 addition & 5 deletions 5-infrastructure/business_unit_1/development/providers.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2021-2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,10 +18,6 @@ locals {
tf_sa = var.terraform_service_account
}

terraform {
required_version = ">= 0.13"
}

/******************************************
Provider credential configuration
*****************************************/
Expand Down
20 changes: 1 addition & 19 deletions 5-infrastructure/business_unit_1/development/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2021-2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,24 +61,6 @@ variable "boa_sql_project_id" {
description = "Project ID for SQL"
}

variable "gke_cluster_1_cidr_block" {
type = string
description = "The primary IPv4 cidr block for the first GKE cluster."
default = "100.64.78.0/28"
}

variable "gke_cluster_2_cidr_block" {
type = string
description = "The primary IPv4 cidr block for the second GKE cluster."
default = "100.65.70.0/28"
}

variable "gke_mci_cluster_cidr_block" {
type = string
description = "The primary IPv4 cidr block for multi-cluster ingress (MCI)."
default = "100.64.70.0/28"
}

variable "enforce_bin_auth_policy" {
type = bool
description = "Enable or Disable creation of binary authorization policy"
Expand Down
29 changes: 29 additions & 0 deletions 5-infrastructure/business_unit_1/development/version.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright 2023 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_version = ">= 0.13"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 3.50"
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 4.0"
}
}
}
3 changes: 0 additions & 3 deletions 5-infrastructure/business_unit_1/non-production/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
| boa\_sql\_project\_id | Project ID for SQL | `string` | n/a | yes |
| enforce\_bin\_auth\_policy | Enable or Disable creation of binary authorization policy | `bool` | `false` | no |
| gcp\_shared\_vpc\_project\_id | The host project id of the shared VPC | `string` | n/a | yes |
| gke\_cluster\_1\_cidr\_block | The primary IPv4 cidr block for the first GKE cluster. | `string` | `"100.64.142.0/28"` | no |
| gke\_cluster\_2\_cidr\_block | The primary IPv4 cidr block for the second GKE cluster. | `string` | `"100.65.134.0/28"` | no |
| gke\_mci\_cluster\_cidr\_block | The primary IPv4 cidr block for multi-cluster ingress (MCI). | `string` | `"100.64.134.0/28"` | no |
| location\_primary | The primary region for deployment | `string` | `"us-east1"` | no |
| location\_secondary | The secondary region for deployment | `string` | `"us-west1"` | no |
| shared\_vpc\_name | The shared VPC network name | `string` | n/a | yes |
Expand Down
6 changes: 1 addition & 5 deletions 5-infrastructure/business_unit_1/non-production/providers.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2021-2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,10 +18,6 @@ locals {
tf_sa = var.terraform_service_account
}

terraform {
required_version = ">= 0.13"
}

/******************************************
Provider credential configuration
*****************************************/
Expand Down
20 changes: 1 addition & 19 deletions 5-infrastructure/business_unit_1/non-production/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2021-2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,24 +61,6 @@ variable "boa_sql_project_id" {
description = "Project ID for SQL"
}

variable "gke_cluster_1_cidr_block" {
type = string
description = "The primary IPv4 cidr block for the first GKE cluster."
default = "100.64.142.0/28"
}

variable "gke_cluster_2_cidr_block" {
type = string
description = "The primary IPv4 cidr block for the second GKE cluster."
default = "100.65.134.0/28"
}

variable "gke_mci_cluster_cidr_block" {
type = string
description = "The primary IPv4 cidr block for multi-cluster ingress (MCI)."
default = "100.64.134.0/28"
}

variable "enforce_bin_auth_policy" {
type = bool
description = "Enable or Disable creation of binary authorization policy"
Expand Down
29 changes: 29 additions & 0 deletions 5-infrastructure/business_unit_1/non-production/version.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright 2023 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_version = ">= 0.13"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 4.0"
}
}
}
3 changes: 0 additions & 3 deletions 5-infrastructure/business_unit_1/production/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
| boa\_sql\_project\_id | Project ID for SQL | `string` | n/a | yes |
| enforce\_bin\_auth\_policy | Enable or Disable creation of binary authorization policy | `bool` | `true` | no |
| gcp\_shared\_vpc\_project\_id | The host project id of the shared VPC | `string` | n/a | yes |
| gke\_cluster\_1\_cidr\_block | The primary IPv4 cidr block for the first GKE cluster. | `string` | `"100.64.206.0/28"` | no |
| gke\_cluster\_2\_cidr\_block | The primary IPv4 cidr block for the second GKE cluster. | `string` | `"100.65.198.0/28"` | no |
| gke\_mci\_cluster\_cidr\_block | The primary IPv4 cidr block for multi-cluster ingress (MCI). | `string` | `"100.64.198.0/28"` | no |
| location\_primary | The primary region for deployment | `string` | `"us-east1"` | no |
| location\_secondary | The secondary region for deployment | `string` | `"us-west1"` | no |
| shared\_vpc\_name | The shared VPC network name | `string` | n/a | yes |
Expand Down
6 changes: 1 addition & 5 deletions 5-infrastructure/business_unit_1/production/providers.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2021-2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,10 +18,6 @@ locals {
tf_sa = var.terraform_service_account
}

terraform {
required_version = ">= 0.13"
}

/******************************************
Provider credential configuration
*****************************************/
Expand Down
20 changes: 1 addition & 19 deletions 5-infrastructure/business_unit_1/production/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2021-2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,24 +61,6 @@ variable "boa_sql_project_id" {
description = "Project ID for SQL"
}

variable "gke_cluster_1_cidr_block" {
type = string
description = "The primary IPv4 cidr block for the first GKE cluster."
default = "100.64.206.0/28"
}

variable "gke_cluster_2_cidr_block" {
type = string
description = "The primary IPv4 cidr block for the second GKE cluster."
default = "100.65.198.0/28"
}

variable "gke_mci_cluster_cidr_block" {
type = string
description = "The primary IPv4 cidr block for multi-cluster ingress (MCI)."
default = "100.64.198.0/28"
}

variable "enforce_bin_auth_policy" {
type = bool
description = "Enable or Disable creation of binary authorization policy"
Expand Down
29 changes: 29 additions & 0 deletions 5-infrastructure/business_unit_1/production/version.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright 2023 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_version = ">= 0.13"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 4.0"
}
}
}
17 changes: 1 addition & 16 deletions 5-infrastructure/business_unit_1/shared/providers.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2021-2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,21 +18,6 @@ locals {
tf_sa = var.app_cicd_build_sa
}

terraform {
required_version = ">=0.13.0"

required_providers {
google = {
source = "hashicorp/google"
version = ">= 3.50"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 3.50"
}
}
}

/******************************************
Provider credential configuration
*****************************************/
Expand Down
33 changes: 33 additions & 0 deletions 5-infrastructure/business_unit_1/shared/version.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright 2023 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_version = ">= 0.13"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 4.0"
}
random = {
source = "hashicorp/random"
version = ">= 3.3.0"
}
}
}
8 changes: 4 additions & 4 deletions 5-infrastructure/modules/app_cicd_pipeline/binauthz.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2021-2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@
resource "random_string" "keyring_name" {
length = 4
special = false
number = true
numeric = true
upper = false
lower = true
}
Expand All @@ -40,7 +40,7 @@ resource "google_secret_manager_secret" "keyring-secret" {
}

replication {
automatic = true
auto {}
}
}

Expand All @@ -51,7 +51,7 @@ resource "google_secret_manager_secret_version" "keyring-secret-version" {

module "attestors" {
source = "terraform-google-modules/kubernetes-engine/google//modules/binary-authorization"
version = "~> 14.1"
version = "~> 28.0"
for_each = toset(var.attestor_names_prefix)

project_id = var.app_cicd_project_id
Expand Down
Loading
Loading