-
Notifications
You must be signed in to change notification settings - Fork 22
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
Can we have an option to conditionally disable or enable this plugin? #7
Comments
@aghadiry are you maintaining this project? I also need an "enabled" property; assuming I submit a pull request, will you merge and publish it? |
I've added a PR that might help you with this. #21 With this PR you could disable the |
@mihaerzen I just added this plugin to my serverless project but the My configuration is: cloudfrontInvalidate:
- distributionIdKey: "CDNDistributionId" #conditional, distributionId or distributionIdKey is required.
autoInvalidate: false # Can be set to false to avoid automatic invalidation after the deployment. Useful if you want to manually trigger the invalidation later. Defaults to true.
items: # one or more paths required
- "/*" But the deploy pipeline is still invalidating twice. Looking into the code i'm wondering if this line is correct serverless-cloudfront-invalidate/index.js Line 44 in 581b8f8
because autoInvalidate is not an attribute of cloudfrontInvalidate but is an attribute of every element of the list.
Am I wrong ? |
@Ingordigia Yes, you are correct. It was broken via #19 . I've made a PR which should fix this #24 |
@Ingordigia the PR #24 was merged and I've tested it on production Today. I found there is a small issue with it, basically, manual invalidation doesn't work anymore. Meaning if you were to invoke |
@mihaerzen thank you for your efforts. |
@mihaerzen |
I sometimes want to invalidate the cache only if the CI is deploying from the
master
branch. It would be convenient to be able to disable this plugin conditionally.I can take a stab at this 😃
The text was updated successfully, but these errors were encountered: