-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial impl * add tests * fmt * address comments * fix checksums for 0.13.6 * fix validator version * update readmes * update docs
- Loading branch information
1 parent
8c13603
commit c3b19e8
Showing
57 changed files
with
1,252 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| alert\_pubsub\_topic | The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form of `projects/{project_id}/topics/{topic_id}` | `string` | `null` | no | | ||
| alert\_spent\_percents | A list of percentages of the budget to alert on when threshold is exceeded | `list(number)` | <pre>[<br> 0.5,<br> 0.75,<br> 0.9,<br> 0.95<br>]</pre> | no | | ||
| billing\_account | The ID of the billing account to associated this project with | `string` | n/a | yes | | ||
| budget\_amount | The amount to use as the budget | `number` | `1000` | no | | ||
| folder\_prefix | Name prefix to use for folders created. | `string` | `"fldr"` | no | | ||
| org\_id | The organization id for the associated services | `string` | n/a | yes | | ||
| parent\_folder | Optional - if using a folder for testing. | `string` | `""` | no | | ||
| project\_prefix | Name prefix to use for projects created. | `string` | `"prj"` | no | | ||
| terraform\_service\_account | Service account email of the account to impersonate to run Terraform | `string` | n/a | yes | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| apply\_triggers | CB apply triggers | | ||
| artifact\_buckets | GCS Buckets to store Cloud Build Artifacts | | ||
| cloudbuild\_project\_id | n/a | | ||
| cloudbuild\_sa | Cloud Build service account | | ||
| plan\_triggers | CB plan triggers | | ||
| repos | CSRs to store source code | | ||
| state\_buckets | GCS Buckets to store TF state | | ||
|
||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../common.auto.example.tfvars |
45 changes: 45 additions & 0 deletions
45
4-projects/business_unit_1/shared/example_infra_pipeline.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
module "app_infra_cloudbuild_project" { | ||
source = "../../modules/single_project" | ||
impersonate_service_account = var.terraform_service_account | ||
org_id = var.org_id | ||
billing_account = var.billing_account | ||
folder_id = data.google_active_folder.common.name | ||
environment = "shared" | ||
alert_spent_percents = var.alert_spent_percents | ||
alert_pubsub_topic = var.alert_pubsub_topic | ||
budget_amount = var.budget_amount | ||
project_prefix = var.project_prefix | ||
activate_apis = ["cloudbuild.googleapis.com", "sourcerepo.googleapis.com", "cloudkms.googleapis.com"] | ||
|
||
# Metadata | ||
project_suffix = "sample-infra" | ||
application_name = "app-infra-pipelines" | ||
billing_code = "1234" | ||
primary_contact = "example@example.com" | ||
secondary_contact = "example2@example.com" | ||
business_code = "bu1" | ||
} | ||
|
||
module "infra_pipelines" { | ||
source = "../../modules/infra_pipelines" | ||
cloudbuild_project_id = module.app_infra_cloudbuild_project.project_id | ||
billing_account = var.billing_account | ||
app_infra_repos = ["bu1-example-app"] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
data "google_active_folder" "common" { | ||
display_name = "${var.folder_prefix}-common" | ||
parent = var.parent_folder != "" ? "folders/${var.parent_folder}" : "organizations/${var.org_id}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
output "cloudbuild_project_id" { | ||
value = module.app_infra_cloudbuild_project.project_id | ||
} | ||
|
||
output "cloudbuild_sa" { | ||
description = "Cloud Build service account" | ||
value = module.infra_pipelines.cloudbuild_sa | ||
} | ||
|
||
output "repos" { | ||
description = "CSRs to store source code" | ||
value = module.infra_pipelines.repos | ||
} | ||
|
||
output "artifact_buckets" { | ||
description = "GCS Buckets to store Cloud Build Artifacts" | ||
value = module.infra_pipelines.artifact_buckets | ||
} | ||
|
||
output "state_buckets" { | ||
description = "GCS Buckets to store TF state" | ||
value = module.infra_pipelines.state_buckets | ||
} | ||
|
||
output "plan_triggers" { | ||
description = "CB plan triggers" | ||
value = module.infra_pipelines.plan_triggers | ||
} | ||
|
||
output "apply_triggers" { | ||
description = "CB apply triggers" | ||
value = module.infra_pipelines.apply_triggers | ||
} |
Oops, something went wrong.