Google backends: gcs and firestore (#35) @goruha (#36)
## whatUse google services to store state (gcs) and metadata (firestore)
why
For those who use google cloud it is hard to adopt atmos as all the GH tooling is built around AWS. This PR and several other fixes that.
references
See also related PRs in:
- cloudposse/github-action-atmos-terraform-plan#93
- cloudposse/github-action-atmos-terraform-apply#64
- cloudposse/github-action-atmos-affected-stacks#55
Usage
To use the GCP implementation, specify planRepositoryType as gcs and metadataRepositoryType as firestore, then provide the following GCP-specific settings: googleProjectId to specify the project for both GCS bucket and Firestore, bucketName for GCS storage, and googleFirestoreDatabaseName/googleFirestoreCollectionName for Firestore metadata.
The component, stack, planPath, and action parameters work the same way as in AWS and Azure examples.
- name: Store Plan
uses: cloudposse/github-action-terraform-plan-storage@v2
id: store-plan
with:
action: storePlan
planPath: my-plan.tfplan
component: mycomponent
stack: core-mycomponent-use1
planRepositoryType: gcs
metadataRepositoryType: firestore
bucketName: my-terraform-plans
gcpProjectId: my-gcp-project
gcpFirestoreDatabaseName: terraform-plan-metadata
gcpFirestoreCollectionName: terraform-plan-storage
- name: Get Plan
uses: cloudposse/github-action-terraform-plan-storage@v2
id: get-plan
with:
action: getPlan
planPath: my-plan.tfplan
component: mycomponent
stack: core-mycomponent-use1
planRepositoryType: gcs
metadataRepositoryType: firestore
bucketName: my-terraform-plans
gcpProjectId: my-gcp-project
gcpFirestoreDatabaseName: terraform-plan-metadata
gcpFirestoreCollectionName: terraform-plan-storage