Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
serverless-baseline-invalidate-cloudfront
Advanced tools
Serverless plugin that allows you to invalidate Cloudfront Cache
Serverless plugin that allows you to invalidate Cloudfront Cache securely, addressing previous security concerns with the vm2 dependency. Based on the original package serverless-cloudfront-invalidate
.
Install the updated plugin in your Serverless project.
$ npm install --save serverless-baseline-invalidate-cloudfront
Incorporate the plugin into your serverless.yml file as the final plugin.
plugins:
- serverless-baseline-invalidate-cloudfront # Add this as the last plugin.
For CloudFront distributions created within the same serverless.yml, you can specify the distributionIdKey
and output the DomainId (as illustrated below).
custom:
cloudfrontInvalidate:
- distributionId: "CLOUDFRONT_DIST_ID" # Either distributionId or distributionIdKey is required.
distributionIdKey: "CDNDistributionId" # Either distributionId or distributionIdKey is required.
autoInvalidate: true # Set to false to prevent automatic invalidation post-deployment. Defaults to true.
items: # Specify one or more paths
- "/index.html"
stage:
"staging" # Specify the deployment stage for this invalidation
# This should align with the provider's stage, e.g., "staging" instead of "prod"
# Invalidation for this distribution will be initiated with `sls deploy --stage staging`
- distributionId: "CLOUDFRONT_DIST_ID" # Either distributionId or distributionIdKey is required.
distributionIdKey: "CDNDistributionId" # Either distributionId or distributionIdKey is required.
items: # Specify one or more paths
- "/index.html"
# Omitting `stage` will trigger invalidation for this distribution across all stages
resources:
Resources:
CDN:
Type: "AWS::CloudFront::Distribution"
Properties: ....
Outputs:
CDNDistributionId:
Description: "CDN distribution id."
Value:
Ref: CDN
Execute sls deploy
. Post-deployment, CloudFront Invalidation will commence.
To trigger a standalone invalidation, run sls cloudfrontInvalidate
.
FAQs
Serverless plugin that allows you to invalidate Cloudfront Cache
The npm package serverless-baseline-invalidate-cloudfront receives a total of 26 weekly downloads. As such, serverless-baseline-invalidate-cloudfront popularity was classified as not popular.
We found that serverless-baseline-invalidate-cloudfront demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.