Skip to content

feat: separate terraform for project setup and permissions #179

Merged
hessjcg merged 1 commit intomainfrom
gh-65-e2e-job-permissions
Jan 19, 2023
Merged

feat: separate terraform for project setup and permissions #179
hessjcg merged 1 commit intomainfrom
gh-65-e2e-job-permissions

Conversation

@hessjcg
Copy link
Copy Markdown
Collaborator

@hessjcg hessjcg commented Jan 19, 2023

This moves the terraform code that sets up the GCP project APIs and permissions into a separate
terraform project. This will simplify the automated e2e testing jobs.

Related to #65

@hessjcg hessjcg requested a review from a team January 19, 2023 20:43
@hessjcg hessjcg self-assigned this Jan 19, 2023
@hessjcg hessjcg requested a review from enocom January 19, 2023 20:44
Comment thread infra/permissions/main.tf
"servicemanagement.googleapis.com",
"sql-component.googleapis.com",
"sqladmin.googleapis.com",
"storage-api.googleapis.com"])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: let's run all this TF code through tf fmt. https://developer.hashicorp.com/terraform/cli/commands/fmt

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually the recommended formatting generated by terraform fmt. Weird, huh.

Comment thread infra/permissions/vars.tf Outdated
description = "The gcloud project id"
}

variable "landscape_name" {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "landscape" the convention? I would expect to call this environment otherwise.

Copy link
Copy Markdown
Collaborator Author

@hessjcg hessjcg Jan 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm used to using "landscape" because it was standard term used by my former colleagues in Europe. Do Google people usually call this "environment"?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I think environment is the standard in the US (testing environment, staging environment, production environment).

Comment thread infra/permissions/main.tf
version = "4.48.0"
}
}
}
Copy link
Copy Markdown
Member

@enocom enocom Jan 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this the tf state going be stored? Typically it's best to put it in a bucket, e.g.,

terraform {
  backend "gcs" {
    bucket = "gcping-tf-state"
  }
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is only for local development, the state is only stored locally.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression this would be used both for local dev workflows and for CI, is that correct?

@hessjcg hessjcg force-pushed the gh-65-e2e-job-permissions branch 2 times, most recently from 519b180 to 49e832f Compare January 19, 2023 21:40
Comment thread infra/permissions/main.tf Outdated
locals {
tf_output = {
project_id = var.project_id
environment_name = var.environment_name
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this needs another tf fmt

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@hessjcg hessjcg force-pushed the gh-65-e2e-job-permissions branch from 49e832f to 405fb24 Compare January 19, 2023 21:50
@hessjcg hessjcg merged commit 8f43657 into main Jan 19, 2023
@hessjcg hessjcg deleted the gh-65-e2e-job-permissions branch January 19, 2023 23:01
hessjcg pushed a commit that referenced this pull request Feb 21, 2023
Features
- Add new field RolloutStrategy control automatic rollout (#202) (090b88d)
- Add new terraform project for e2e test resources (#181) (0140592)
- Add script to run terraform with input validation. (#182) (857444a)
- Add support for Unix sockets. (#205) (8177a35), closes #47
- Add telemetry settings to configure health check port (#210) (3ede42d)
- Add the e2e test job for Cloud Build (#184) (dc2990c)
- Automatic changes to workloads when an AuthProxyWorload is deleted (#200) (e11caed)
- Automatically trigger pod rollout for appsv1 resources when AuthProxyWorkload changes. (#197) (3b0359b)
- Separate terraform for project setup and permissions (#179) (8f43657)
- Validate AuthProxyWorkload spec.selector field (#209) (98c460b)
- Validate AuthProxyWorkload updates to prevent changes to the workload selector. (#211) (4304283)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Release PR Generate Bot action release-please[bot] <release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants