-
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
Terraform ignores Cloud Function module when plan/apply #4712
Comments
Strange. The field is marked I attempted to reproduce locally with a cloudfunction module that uses
What version of the google provider are you running? |
@slevenick thanks for the quick reply! This is the list of providers I am using: Terraform v0.12.11
+ provider.google v2.17.0
+ provider.google-beta v2.17.0
+ provider.null v2.1.2 Worth to mention I have used the
I use a module output that exposes pubsub topic name. Hope this helps. |
I'm not sure what is happening here, but it seems like an issue with your module setup rather than the terraform provider. If you combine your modules into a single one temporarily, does it create the cloud function? I'd guess there is something strange happening with trying to depend on the output of one module in another, but really without access to the modules I can only guess. |
The modules are very simple. You can find them along with the main file I am using are here. I'll give it a shot putting both cloud function and pubsub topic in the same module. My guess is it should work just fine although it kind of defeats the purpose I wanted to achieve since not all our cloud functions depend on PubSub. I will let you know the outcome. |
@HebertCL are you still needing help on this issue ? or can i go head and close it if you have what you needed. |
@venkykuberan I haven't had the chance to revisit this issue. For now I have integrated it to my workflow using gcloud, so for now it's safe to close it. If I get back to it and find it happening, I will reopen it. |
Thank you @HebertCL. I am closing it. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Description
I've been working on a Cloud Function module that uses PubSub topic as trigger. My
main.tf
looks like this:To provide complete context, I am using a couple null resources called
provision_ready
and<RESOURCE>_complete
. This is a trick to be able to chain small modules together and have the ability to give them dependency between each other. This is how the actual cloud function module looks like:Theoretically, both plan and apply of this module should fail because
trigger_topic
config have been deprecated in favor ofevent_trigger
. Not only configuration plans and applies with no errors, but in fact is straight up ignoring cloud function resource. It even provisions both null resources that come with cloud function module even thoughfunction_complete
resource depends on cloud function resource completion. This is an example:I noticed this behavior couple days ago. I was using a similar cloud function configuration which deployed successfully, and suddenly noticed my cloud functions were not being provisioned anymore.
Right now I cannot provision anymore cloud functions at the moment, but that seems to be a different issue I plan to report separately. I also share a gist with debug mode execution. Thanks for checking this out.
Terraform Version
Terraform v0.12.11
Terraform v0.12.9
Affected Resource(s)
google_cloudfunctions_function.function
Debug Output
https://gist.github.com/HebertCL/aa83b5b7073812c42e887977e4cc6d82
Expected Behavior
Terraform should either create all resources in the modules or fail due deprecated configuration used in the modules.
Actual Behavior
Terraform applies and create all resources but cloud function resource. It creates resources that depend from cloud function resource as well.
Steps to Reproduce
Use this gist as reference:
https://gist.github.com/HebertCL/a5756ea86a871fda9ddf548772a0883a
terraform init
terraform apply
The text was updated successfully, but these errors were encountered: