-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
google_cloud_run_service using environment variables from secret manager is ordering sensitive making it difficult to use #9175
google_cloud_run_service using environment variables from secret manager is ordering sensitive making it difficult to use #9175
Comments
@txomon you mentioned there are two issues here. Mind file separate issues so they can be tracked properly. Also can you post the debug logs for each case? I noticed your analysis below. I am not quite clear. Here is what the doc suggests. Following is a test that runs everyday. Can you share the debug log so I can get clearer picture of what the problem is?
|
This one is related to #9159 |
I can see the problem of |
Let's then keep this ticket for the ordering env blocks, and I will tackle the documentation in the other one |
Hi @txomon ! Sorry you're running into this issue. Unfortunately, I wasn't able to reproduce it, but I have a fix in that if the order of |
Hello @megan07 , I have tested the latest version, and although the difference when ordering is different is solved, when there is an actual removal of an env block, something like this displays:
To reproduce, apply a cloud run config with two env vars, apply, and then remove one of them. |
Hi @txomon ! This will be released in our next version. Did you build the provider locally and see this or were you using |
Hello megan,
Sorry, I thought it had been released already, I will wait until it's
released and report back,
Cheers, Javier
…On Fri, Jun 18, 2021 at 9:09 PM megan07 ***@***.***> wrote:
Hi @txomon <https://github.com/txomon> ! This will be released in our
next version. Did you build the provider locally and see this or were you
using 3.72.0? Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9175 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABXXGVUVRGWRJA2QIWINWLTTOKW5ANCNFSM45DBHE4Q>
.
|
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. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Problem overview
The main objective is to be able to deploy cloud_run instances with secret_manager resources referenced. There are two main problems that get on the way of supporting deployments external to terraform (the ability to also deploy new images from outside terraform):
Documentation
The current documentation is not correct, https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_service#example-usage---cloud-run-service-secret-environment-variables says the following syntax is correct:
However this would never work, as the validation requires it to only contain valid kubernetes secret references, and a
secret_id
is of the formprojects/myproject/secrets/mysecret
. Instead, one needs to populate the annotations with an attributerun.googleapis.com/secrets
of key:value comma separated list, wherekey
is a string starting withsecret-
and a random UUID, and value is the secret id of the formprojects/myproject/secrets/mysecret
like this instead:Ordering of env blocks
The current implementation of the
google_cloud_run_service
's template uses blocks for configuration, and when using dynamic as in the terraform file pasted below, after agcloud run deploy
, the blocks need to be ordered in the same way (which is not possible to my knowledge) to avoid having a change like the following:Terraform Version
Terraform v0.15.0
on linux_amd64
Your version of Terraform is out of date! The latest version
is 0.15.3. You can update by downloading from https://www.terraform.io/downloads.html
Affected Resource(s)
google_cloud_run_service
Terraform Configuration Files
Expected Behavior
When applying through terraform after creating a deployment from
gcloud
, there should be no changes detected if the key-values invar.env_secrets
don't show diferencesActual Behavior
Terraform detects changes in the order of the env blocks created dynamically
Steps to Reproduce
terraform apply
gcloud run deploy <cloud_run_instance_name> --project <project_id> --region <region_name> --image <image> --platform managed --quiet
terraform apply
# Shouldn't show changes but it doesImportant Factoids
The code is trying to make sure that external deployments are accepted from outside terraform
References
The text was updated successfully, but these errors were encountered: