-
Notifications
You must be signed in to change notification settings - Fork 630
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
Add a cloudflare_zone_cache_variants
resource
#1444
Add a cloudflare_zone_cache_variants
resource
#1444
Conversation
Oops! It looks like no changelog entry is attached to this PR. Please include a release note as described in https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/docs/changelog-process.md. Example:
If you do not require a release note to be included, please add the |
8b17699
to
fc211f7
Compare
}, | ||
} | ||
|
||
for _, ext := range supportedCacheVariantsExtensions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really sure how i feel about the dynamic nature of creating schema items due to making it difficult for discovery. i'll have a think about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 My main goal was not to repeat the whole schema over and over again. An alternative would be to do something like:
"avif": extensionSchema(),
"gif": extensionSchema(),
I think an upside with this alternative is that the schema is a little bit easier to read. I'll do that, LMK what you think
func resourceCloudflareZoneCacheVariants() *schema.Resource { | ||
return &schema.Resource{ | ||
Schema: resourceCloudflareZoneCacheVariantsSchema(), | ||
Create: resourceCloudflareZoneCacheVariantsCreate, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given create and update are essentially the same funcitonality, you could point Create
and Update
here to the same method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I merged both function
acceptance tests are green
really solid effort here @maleblond, your first contribution no less! thanks for such a solid PR. |
We'd like to be able to manage cache variants through terraform so I added a.
cloudflare_zone_cache_variants
resource.I added some unit tests + I did some manual testing. A
cloudflare_zone_cache_variants
resource would look like this:It's my first time updating a terraform provider, so there may be some very ugly things in there not following the best practices 😅