-
Notifications
You must be signed in to change notification settings - Fork 140
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
cannot enable brotli without impacting image optimization #761
Comments
Hi @querry43 Thanks for opening this issue. I completely understand. It's an unfortunate design because of the ambiguity involved and the added complexity tied to the underlying Product Enablement Fastly API endpoints. i.e. Having access to a product (such as image_optimizer) on your account doesn't necessarily mean you have the permissions to programmatically enable/disable that product via the Fastly API. I'm going to do some further research into the Terraform design but I don't know if there is much I can do in the way of the current implementation. So what I will probably end up doing is adding to the Terraform documentation the following information to try and make it clearer for users in the future to understand what exactly will happen with regards to the I'll describe below the CRUD (Create, Read, Update, Delete) flows so you have a better understanding of what the Fastly Terraform provider is doing under the hood, and hopefully, that will help alleviate your concerns about accidentally disabling the Image Optimizer product on your account. SummaryFrom what I understand you don't have the correct permissions to programmatically enable/disable Image Optimizer, and you're adding the If I have that all correct, then although the plan shows CreateWhen defining the Only if the product attribute (e.g. If a product is not defined in the config, it will be given a default value of ReadThe Read function is used to update the Terraform state file. The Terraform provider calls the Fastly API to identify if a product is enabled or not, and it will assign the relevant If the Terraform configuration doesn't align with what the state file determines is how things are set up in the 'real world', then the Terraform plan/apply will indicate this in its diff when it compares the state file to your config file. UpdateThe Update function checks to see if the product has a different value to what it was set to originally (e.g. have you changed a product from If it's set to The key bit here is the 'entitlement' to call the Fastly API. Some customers don't have access to programmatically enable/disable products. Products have to then be set up manually by Fastly customer support. If you do have programmatic access to the Product Enablement APIs, then you should ensure the correct value is assigned in your Terraform configuration to avoid accidentally disabling a product. If you're unsure about whether you have API access, then I would strongly recommend reaching out to [email protected] to have them review your account settings and confirm this.
DeleteWhen deleting the Now if the API returns an error, then that error will be returned to the user and consequently the This means, that if you delete the |
Hi @querry43 I've opened the following PR #763 to try and address some issues I noticed in the original implementation. If you would like to try it out you can pull the code locally, run |
Terraform Version
Affected Fastly Terraform Resource(s)
Please list the affected resources, for example:
fastly_service_vcl
Terraform Configuration Files
Expected Behavior
Terraform should only attempt to enable brotli compression.
Actual Behavior
The other parameters of product_enablement default, including image_optimizer. Our service does not allow us to enable or disable image optimization via the api so setting image_oprimizer = true is not an option. When we apply, it is unclear if optimization will be disabled.
ex:
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids (optional)
Is there anything atypical about your account or set up that we should know?
The text was updated successfully, but these errors were encountered: