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

Autogenerate Cloud Build Trigger in Terraform #1145

Merged

Conversation

rileykarson
Copy link
Member

@rileykarson rileykarson commented Jan 3, 2019

Every top level field + every field under build that Terraform supports is added- the docs are hard to parse for the other fields so I split the rest out of this PR since adding them will be easy enough in a followup & it means it will be 2 individually smaller PRs.

id is a server-provided identifier that isn't a unique number in this resource; instead, it's a string (GUID I think?) and works like the name of a self_link style resource. MM took some fiddling to make it work - probably worth considering this resource in https://github.com/GoogleCloudPlatform/magic-modules/issues/937

This also makes the breaking change from hashicorp/terraform-provider-google#2101

Part of https://github.com/GoogleCloudPlatform/magic-modules/issues/1134


[all]

[terraform]

Autogenerate google_cloudbuild_trigger

[terraform-beta]

[ansible]

[inspec]

@modular-magician
Copy link
Collaborator

I am a robot that works on MagicModules PRs!

I built this PR into one or more PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#308
depends: hashicorp/terraform-provider-google#2790

@modular-magician
Copy link
Collaborator

I am (still) a robot that works on MagicModules PRs!

I just wanted to let you know that your changes (as of commit ac2b08f) have been included in your existing downstream PRs.

products/cloudbuild/api.yaml Show resolved Hide resolved
products/cloudbuild/api.yaml Show resolved Hide resolved
products/cloudbuild/terraform.yaml Show resolved Hide resolved
@@ -0,0 +1,14 @@
// `name` is autogenerated from the api so needs to be set post-create
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we'll need one of these for each resource with an id that's set during create - I think there's a lot of those. Do you think it's worth it to make this a magic-modules-level field? set_during_create: true or something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have set_computed_name.erb for the common name case (similar to update mask) but this one is different since we're recording the id, and this is one of the only non-numeric id values. I don't think this is worth templating yet since this particular pattern is still isolated. If we get to 3 that are nearly identical imo that's when it's worth it.

@modular-magician
Copy link
Collaborator

I am (still) a robot that works on MagicModules PRs!

I just wanted to let you know that your changes (as of commit c055029) have been included in your existing downstream PRs.

@rileykarson
Copy link
Member Author

rileykarson commented Jan 3, 2019

Waiting on @paddycarver's response about the shape change to merge.

Edit: We're making the hard cut with this PR since there isn't a great way to make a gradual deprecation here

@modular-magician modular-magician merged commit 17c8cc7 into GoogleCloudPlatform:master Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants