Skip to content

Commit

Permalink
Cleanup (#4)
Browse files Browse the repository at this point in the history
* Correct branch filtering.

* Remove references to deleted vars.

* Remove context.

* Update README.
  • Loading branch information
jtreutel authored Jan 18, 2023
1 parent 52378ef commit 4c4d569
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ workflows:
requires:
- checkout
- validate:
context: gcp-tf-testing
#context: gcp-tf-testing
requires:
- checkout
- sandbox-deploy:
Expand All @@ -66,8 +66,6 @@ workflows:
branches:
only:
- master
- main
- dev
- hold:
type: approval
requires:
Expand All @@ -76,3 +74,5 @@ workflows:
context: gcp-tf-testing
requires:
- hold

# VS Code Extension Version: 1.5.1
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Terraform plan to deploy GCP infra necessary for authenticating with GCP using C
| Name | Default | Description|
|------|---------|------------|
|circleci_org_id|none|Your CircleCI org ID. Can be found under "Organization Settings" in the CircleCI application.|
|gcp_project_name|none|Name of GCP project in which to create resources.|
|gcp_region|none|Name of GCP region in which to create resources.|


### Optional
Expand Down Expand Up @@ -85,4 +83,29 @@ attribute.project_id=='76543210-ba98-fedc-3210-edcba0987654'
If you choose to automatically create a new service account, you can add a single condition to restrict impersonation of this service account. Configure the variables `sa_impersonation_filter_attribute` and `sa_impersonation_filter_value` with the provider attribute and desired value, respectively. For example:

sa_impersonation_filter_attribute = "attribute.project_id"
sa_impersonation_filter_value = "01234567-89ab-cdef-0123-4567890abcde"
sa_impersonation_filter_value = "01234567-89ab-cdef-0123-4567890abcde"


## CI/CD Terraform Module Testing

The pipeline config in this project will perform a sandbox deploy/destroy to validate the module. The prerequsite configuration is as follows:

#### GCP

- A GCP project
- A service account in that project with a valid key

#### CircleCI

The following variables should be configured in a context or at the project level:

| Name | Value | Description|
|------|---------|------------|
|BASE64_SA_KEY|(base-64 string)|Base-64 encoded GCP service account key.|
|BASE64_TFVARS|(base-64 string)|Base-64 encoded contents of terraform.tfvars for your sandbox deployment target.|
|GOOGLE_APPLICATION_CREDENTIALS|`key.json`|Path to the SA key file.|
|GOOGLE_DNS_ZONE_NAME|(varies)|For Terraform GCP auth.|
|GOOGLE_PROJECT|(varies)|For Terraform GCP auth.|
|GOOGLE_REGION|(varies)|For Terraform GCP auth.|
|GOOGLE_ZONE|(varies)|For Terraform GCP auth.|

2 changes: 0 additions & 2 deletions terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#### REQUIRED VARS

gcp_project_name =
gcp_region =
circleci_org_id =

#### OPTIONAL VARS
Expand Down

0 comments on commit 4c4d569

Please sign in to comment.