Skip to content

Commit

Permalink
fix: removes policy id env var from int build config (#791)
Browse files Browse the repository at this point in the history
Co-authored-by: Awais Malik <awmalik@google.com>
  • Loading branch information
g-awmalik and g-awmalik committed Mar 3, 2023
1 parent a03c5e8 commit 7e7c37d
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 23 deletions.
6 changes: 0 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ export TF_VAR_folder_id="your_folder_id"
export TF_VAR_billing_account="your_billing_account_id"
export TF_VAR_gsuite_admin_email="your_gsuite_admin_email"
export TF_VAR_gsuite_domain="your_gsuite_domain"
export TF_VAR_policy_id="your_access_context_manager_policy_id"
```

you can find Access Context Manager policy ID by executing following command
```bash
gcloud access-context-manager policies list --organization="your_org_id"
```

With these settings in place, you can prepare the test setup using Docker:
Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Make will use bash instead of sh
SHELL := /usr/bin/env bash

DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.8
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
REGISTRY_URL := gcr.io/cloud-foundation-cicd

Expand All @@ -32,7 +32,6 @@ docker_run:
-e TF_VAR_billing_account \
-e TF_VAR_gsuite_admin_email \
-e TF_VAR_gsuite_domain \
-e TF_VAR_policy_id \
-v "${CURDIR}":/workspace \
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
/bin/bash
Expand All @@ -47,7 +46,6 @@ docker_test_prepare:
-e TF_VAR_billing_account \
-e TF_VAR_gsuite_admin_email \
-e TF_VAR_gsuite_domain \
-e TF_VAR_policy_id \
-v "${CURDIR}":/workspace \
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
/usr/local/bin/execute_with_credentials.sh prepare_environment
Expand All @@ -62,7 +60,6 @@ docker_test_cleanup:
-e TF_VAR_billing_account \
-e TF_VAR_gsuite_admin_email \
-e TF_VAR_gsuite_domain \
-e TF_VAR_policy_id \
-v "${CURDIR}":/workspace \
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
/usr/local/bin/execute_with_credentials.sh cleanup_environment
Expand All @@ -77,7 +74,6 @@ docker_test_integration:
-e TF_VAR_billing_account \
-e TF_VAR_gsuite_admin_email \
-e TF_VAR_gsuite_domain \
-e TF_VAR_policy_id \
-v "${CURDIR}":/workspace \
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
/usr/local/bin/test_integration.sh
Expand Down
3 changes: 1 addition & 2 deletions build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ tags:
- 'integration'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.8'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1'
options:
machineType: 'N1_HIGHCPU_8'
env:
Expand All @@ -175,4 +175,3 @@ options:
- 'TF_VAR_gsuite_admin_email=project-factory-test-admin@test.infra.cft.tips'
- 'TF_VAR_gsuite_domain=test.infra.cft.tips'
- 'TF_VAR_domain=test.infra.cft.tips.'
- 'TF_VAR_policy_id=$_POLICY_ID'
2 changes: 1 addition & 1 deletion build/lint.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ tags:
- 'lint'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.8'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1'
4 changes: 0 additions & 4 deletions test/setup/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,3 @@ output "group_name" {
output "service_account_email" {
value = google_service_account.int_test.email
}

output "policy_id" {
value = var.policy_id
}
5 changes: 0 additions & 5 deletions test/setup/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,3 @@ variable "gsuite_admin_email" {
variable "gsuite_domain" {
description = "Gsuite domain"
}

variable "policy_id" {
type = string
description = "The ID of the access context manager policy the perimeter lies in"
}

0 comments on commit 7e7c37d

Please sign in to comment.