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

Terraform support to deploy GCS using custom dual-region #12292

Comments

@vnachimu
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Current Terraform provider is NOT supporting to create a custom dual-region GCS bucket using location field. It works just fine with Google's predefined dual-regions - NAM4, ASIA1, EUR4. When you create a custom-dual region with a location field as US-CENTRAL1+US-EAST1, the terraform state stores the location as US. When we make an update to the bucket next time, there is a mismatch between code and state file, which forces the deployment to be recreated like force replacement.

However, both console and gcloud work fine without any issues. Google handles dual-regions something like this in gcloud-gsutil.

gsutil mb -l MULTI-REGION --placement REGION_1,REGION_2 gs://BUCKET_NAME/

There is an option / switch called "placement" where you can specify the dual-region info. Once the bucket has created, the backend data has been stored as below.

gs://my-bucket/ :
Storage class: STANDARD
Location type: dual-region
Location constraint: US
Placement locations: [US-CENTRAL1, US-WEST1]

GCS Terraform is not offering this switch "placement" to specify 2 regions to create a bucket. Therefore, we pass dual-region info like this,

location = US-CENTRAL1+US-EAST1

New or Affected Resource(s)

Google Cloud Storage (GCS)
storage.googleapis.com

Potential Terraform Configuration

When we create a bucket, there should be an option to say the placement locations info in terraform resource. Something like below.

resource "google_storage_bucket" "auto-expire" {
name = "auto-expiring-bucket"
location = "US"
placement = [US-CENTRAL1, US-WEST1]
}

References

#1229
terraform-google-modules/terraform-google-cloud-storage#182

  • #0000
@c2thorn c2thorn self-assigned this Aug 15, 2022
@c2thorn
Copy link
Collaborator

c2thorn commented Sep 14, 2022

This is possible via the customPlacementConfig field.

@c2thorn c2thorn removed their assignment Sep 14, 2022
@rileykarson rileykarson added this to the Goals milestone Sep 19, 2022
@melinath
Copy link
Collaborator

b/249089097

@github-actions
Copy link

github-actions bot commented Nov 5, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.