Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

feat(terraform): automate firestore setup #163

Merged
merged 9 commits into from
Sep 15, 2021
Merged

Conversation

grayside
Copy link
Collaborator

@grayside grayside commented Sep 3, 2021

Fixes #114

This change is based on proven work in another project. I did not test as part of Emblem because our current Emblem Terraform setup is not compatible with how I understand how to test Terraform. Sending PR to get reviews started, but flagging as do-not-merge for now while I sort out what needs to happen.

@grayside grayside added the component: delivery Related to automation, testing, deployment of the application. label Sep 3, 2021
@grayside grayside self-assigned this Sep 3, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 3, 2021
@grayside grayside added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 3, 2021
terraform/prod.tf Outdated Show resolved Hide resolved
terraform/prod.tf Outdated Show resolved Hide resolved
terraform/stage.tf Outdated Show resolved Hide resolved
terraform/stage.tf Outdated Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@google-cla
Copy link

google-cla bot commented Sep 3, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Sep 3, 2021
@grayside grayside added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Sep 3, 2021
@google-cla
Copy link

google-cla bot commented Sep 3, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Sep 3, 2021
@grayside grayside added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Sep 3, 2021
@grayside grayside added this to the v0.5.0 milestone Sep 7, 2021
resource "google_app_engine_application" "prod_app" {
project = "emblem-prod-${var.suffix}"
# us-central1 not recognized by App Engine resource.
location_id = "us-central"
Copy link
Contributor

@dinagraves dinagraves Sep 7, 2021

Choose a reason for hiding this comment

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

This should be a variable.

Suggested change
location_id = "us-central"
location_id = var.google_region

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Once I saw this suggestion in code, I realized this is a problem. Terraform expects app engine regions in a different formation, e.g., us-central. At the same time, Cloud Run expects standard regions us-central1.

From https://cloud.google.com/appengine/docs/locations it looks like we can adapt the Cloud Run region to App Engine by removing the numeric suffix. I'll need to investigate string manipulation options in Terraform.

@dinagraves should the comment above location_id be more emphatic? Even seeing it in the GitHub UI neither of us noticed it providing critical context to this discussion.

terraform/stage.tf Outdated Show resolved Hide resolved
@dinagraves dinagraves requested a review from a team as a code owner September 7, 2021 23:06
@google-cla
Copy link

google-cla bot commented Sep 7, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Sep 7, 2021
@grayside grayside added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Sep 7, 2021
@google-cla
Copy link

google-cla bot commented Sep 8, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Sep 8, 2021
@grayside grayside added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Sep 8, 2021
@google-cla
Copy link

google-cla bot commented Sep 13, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Sep 13, 2021
resource "google_app_engine_application" "prod_app" {
project = "emblem-prod-${var.suffix}"
# us-central1 not recognized by App Engine resource.
# https://cloud.google.com/appengine/docs/locations
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add what this is expected to return?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Overhauled the comment.

terraform/prod.tf Outdated Show resolved Hide resolved
terraform/stage.tf Outdated Show resolved Hide resolved
Co-authored-by: Dina Graves Portman <dinagraves@google.com>
@google-cla
Copy link

google-cla bot commented Sep 15, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link

google-cla bot commented Sep 15, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@grayside grayside added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Sep 15, 2021
@grayside grayside merged commit 748db4f into main Sep 15, 2021
@pattishin pattishin deleted the automate-firestore branch January 6, 2023 16:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement. component: delivery Related to automation, testing, deployment of the application.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Firestore setup automation
2 participants