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

Complete instructions to deploy Tessera GCP #86

Merged
merged 8 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 12 additions & 0 deletions deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ the project:
gcloud auth application-default login
```

Then, specify your Google Cloud project ID:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This GCP specific stuff should probably go into a README in the live/example-gcp directory (my fault - I accidentally put the gcloud line in above)

```bash
export GOOGLE_PROJECT={VALUE}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could use this:

export GOOGLE_PROJECT=$(gcloud config get-value project 2> /dev/null)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe that works if you run this command after you've ran gcloud auth from a VM inside a project, but that might not always be the case. Otherwise, how can gcloud know which project it should select? When you authenticate via a web link, it doesn't give you the option to select the project.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sadness :(

```

Eventually, customize the region (defaults to "us-east1"), and bucket name prefix
(defaults to "trillian-tessera"):
```bash
export GOOGLE_REGION={VALUE}
Copy link
Collaborator

Choose a reason for hiding this comment

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

It feels a bit weird to me to have the behaviour of terragrunt be affected by environment vars (I think it's a niggle from "hermetic config as code & checked in" being violated), but:
a) I'm far from a TF/TG expert, and
b) I suppose this is meant to be an easily runnable example and having folks edit config files in a repo is a bit of an anti pattern.

export TESSERA_BASE_NAME={VALUE}
```

Terraforming the project can be done by:
1. `cd` to the relevant `live` directory for the environment to deploy/change
2. Run `terragrunt apply`
Expand Down
6 changes: 3 additions & 3 deletions deployment/live/example-gcp/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ terraform {
}

locals {
project_id = "trillian-tessera"
location = "us-central1"
base_name = "example-gcp"
project_id = get_env("GOOGLE_PROJECT")
location = get_env("GOOGLE_REGION", "us-central1")
base_name = get_env("TESSERA_BASE_NAME", "trillian-tessera")
}

inputs = merge(
Expand Down
Loading