Terraform module for storage bucket in GCP
This upgrade will rename the load-balancer resource(s) for them to be coherently identifiable in the GCP console as Bucket LB resource(s) which helps for faster troubleshooting.
- First, ensure that you have applied
v2.4.1
of this module before proceeding. - Then upgrade
gcs_bucket
module version from2.4.1
to2.5.0
- Run
terraform plan
- DO NOT APPLY this plan yet. - If your bucket module at
v2.4.1
hadvar.create_bucket_lb = true
(this value was automatically set totrue
for domain-named-buckets), then you maybe seeing several changes being planned by terraform here. Otherwise, you SHOULD NOT see any changes for your module in this plan. If you STILL see any changes being planned here, then please ensure that you have first reconciled and appliedv2.4.1
properly before proceeding with the next steps. - Ensure that the changes being planned by terraform for
v2.5.0
are ONLY for the following 6 resources and nothing more than that:- google_compute_backend_bucket.bucket_backend[0]
- renames from
backend-bucket-___
tobucket-backend-___"
- renames from
- google_compute_global_address.lb_ip[0]
- renames from
lb-ip-___
tobucket-lbip-___"
-⚠️ we will revisit this change in coming steps
- renames from
- google_compute_global_forwarding_rule.fw_rule[0]
- changes
ip_address
-⚠️ we will revisit this change in coming steps - renames from
forwarding-rule-___
tobucket-fwd-rule-___"
- changes
- google_compute_managed_ssl_certificate.mcrt[0]
- renames from
cert-___
tobucket-cert-___"
- renames from
- google_compute_target_https_proxy.https_proxy[0]
- renames from
https-proxy-___
tobucket-proxy-___"
- renames from
- google_compute_url_map.url_map[0]
- renames from
lb-___
tobucket-lb-___"
- renames from
- google_compute_backend_bucket.bucket_backend[0]
- Must not contain any other changes
- You SHOULD NOT see any other changes in this plan other than the 6 changes listed above. If you see any other changes, then please ensure that you have first reconciled and applied
v2.4.1
before proceeding with the rest of the steps. - In the next steps, we will revisit the IP address changes (marked with
⚠️ above) for backward-compatibility.
- You SHOULD NOT see any other changes in this plan other than the 6 changes listed above. If you see any other changes, then please ensure that you have first reconciled and applied
- Use the module variable called
lb_ip_name
to override the name change of thelb_ip
resource.- NOTE: This ability is provided only for backward-compatibility so that existing systems that maybe referring to this IP address (eg: DNS etc) do not break due to changes in this IP address.
- RECOMMENDATION: If you do not have any such systems depending on this IP address (or if you have the means of updating the IP address value in those systems) then we recommend you to not use this variable at all. Instead, go ahead with applying the changes presented in this plan and then update the IP address values in those external systems with the new IP address produced here.
- You can find the current IP address of the load-balancer from the output attribute called
lb_ip_address
.
- You can find the current IP address of the load-balancer from the output attribute called
- After deciding between 7.1 vs 7.2, run
terraform plan
again and inspect the plans being proposed.- If you see ANY OTHER CHANGES than the ones elaborated above, then please ensure that you have first reconciled and applied
v2.4.1
and then repeat the above instructions before proceeding with the rest of the steps.
- If you see ANY OTHER CHANGES than the ones elaborated above, then please ensure that you have first reconciled and applied
- Run
terraform apply
- The changes discussed above may take a maximum of 1 to 2 minutes.
- If you decided to go with option 7.2 above, remember to update your external systems (if any) with the new IP address produced here.
- You can find the current IP address of the load-balancer from the output attribute called
lb_ip_address
.
- You can find the current IP address of the load-balancer from the output attribute called
- Done!
First make sure you've planned & applied v2.0.1
. Then, upon upgrading from v2.0.1
to v2.1.0
, you may (or may not) see a plan that destroys & creates an equal number of google_storage_bucket_iam_member
resources. It is OK to apply these changes as it will only change the data-structure of these resources from an array to a hashmap. Note that, after you plan & apply these changes, you may (or may not) get a "Provider produced inconsistent result after apply" error. Just re-plan and re-apply and that would resolve the error.