Self-service capability for requesting GCS bucket creation
In my previous blog posts, I shared the details about the self-service template I created for creating BigQuery datasets. In this post, I will share the details of the template I created for creating GCS buckets.
Many options must be chosen for creating GCS buckets, like Region, Lifecycle Rule, Retention Policy, and Storage Class. I designed the template so the end user can choose different combinations of these options in different environments. This template design helps lower the storage cost in non-prod environments and provides flexibility in creating the GCS buckets with different Storage classes in different environments.
This is a sample input, which would be passed from the self-service template to the terraform code.
In this input, you can notice that different options are passed to different environments. This will happen when the terraform code processes this input.
- In Dev, test-gcs1 and test-gcs2 buckets will be created in the US-WEST1 region, with COLDLINE Storage Class, and files are deleted after the Lifecycle Rule conditions {30 days, 0 new version} are met.
- In QA, test-gcs1 and test-gcs2 buckets will be created in the US-SOUTH1 region, with STANDARD Storage Class, and files will be moved to ARCHIVE Storage Class after the Lifecycle Rule conditions {45 days, 1 new version} are met.
- In Prod, test-gcs1 and test-gcs2 buckets will be created in the NAM4 dual region, with STANDARD Storage Class, and files will be deleted after the Retention Period 7776000 seconds (90 days) is met.
This terraform code processes the input file from the self-service template.
Disclaimer: The posts here represent my personal views and not those of my employer or any specific vendor. Any technical advice or instructions are based on my own personal knowledge and experience.