{"id":25345589,"url":"https://github.com/baseline-js/serverless-baseline-invalidate-cloudfront","last_synced_at":"2026-02-27T19:41:25.321Z","repository":{"id":228107201,"uuid":"773176550","full_name":"Baseline-JS/serverless-baseline-invalidate-cloudfront","owner":"Baseline-JS","description":"Serverless plugin that allows you to invalidate Cloudfront Cache","archived":false,"fork":false,"pushed_at":"2025-01-16T04:31:31.000Z","size":51,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T06:11:32.158Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Baseline-JS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-17T00:03:27.000Z","updated_at":"2025-01-16T04:31:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"067aea09-ea28-481b-9fe7-e569e4174a7f","html_url":"https://github.com/Baseline-JS/serverless-baseline-invalidate-cloudfront","commit_stats":null,"previous_names":["baseline-js/serverless-baseline-invalidate-cloudfront"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Baseline-JS/serverless-baseline-invalidate-cloudfront","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseline-JS%2Fserverless-baseline-invalidate-cloudfront","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseline-JS%2Fserverless-baseline-invalidate-cloudfront/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseline-JS%2Fserverless-baseline-invalidate-cloudfront/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseline-JS%2Fserverless-baseline-invalidate-cloudfront/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Baseline-JS","download_url":"https://codeload.github.com/Baseline-JS/serverless-baseline-invalidate-cloudfront/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseline-JS%2Fserverless-baseline-invalidate-cloudfront/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263046188,"owners_count":23405147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-14T12:39:05.209Z","updated_at":"2026-02-27T19:41:20.291Z","avatar_url":"https://github.com/Baseline-JS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-baseline-invalidate-cloudfront\n\nServerless 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`.\n\n## Install\n\nInstall the updated plugin in your Serverless project.\n\n```sh\n$ npm install --save serverless-baseline-invalidate-cloudfront\n```\n\n## Setup\n\nIncorporate the plugin into your serverless.yml file as the final plugin.\n\n```yaml\nplugins:\n  - serverless-baseline-invalidate-cloudfront # Add this as the last plugin.\n```\n\nFor CloudFront distributions created within the same serverless.yml, you can specify the `distributionIdKey` and output the DomainId (as illustrated below).\n\n```yaml\ncustom:\n  cloudfrontInvalidate:\n    - distributionId: \"CLOUDFRONT_DIST_ID\" # Either distributionId or distributionIdKey is required.\n      distributionIdKey: \"CDNDistributionId\" # Either distributionId or distributionIdKey is required.\n      autoInvalidate: true # Set to false to prevent automatic invalidation post-deployment. Defaults to true.\n      items: # Specify one or more paths\n        - \"/index.html\"\n      stage:\n        \"staging\" # Specify the deployment stage for this invalidation\n        # This should align with the provider's stage, e.g., \"staging\" instead of \"prod\"\n        # Invalidation for this distribution will be initiated with `sls deploy --stage staging`\n    - distributionId: \"CLOUDFRONT_DIST_ID\" # Either distributionId or distributionIdKey is required.\n      distributionIdKey: \"CDNDistributionId\" # Either distributionId or distributionIdKey is required.\n      items: # Specify one or more paths\n        - \"/index.html\"\n      # Omitting `stage` will trigger invalidation for this distribution across all stages\nresources:\n  Resources:\n    CDN:\n      Type: \"AWS::CloudFront::Distribution\"\n      Properties: ....\n  Outputs:\n    CDNDistributionId:\n      Description: \"CDN distribution id.\"\n      Value:\n        Ref: CDN\n```\n\n## Usage\n\nExecute `sls deploy`. Post-deployment, CloudFront Invalidation will commence.\nTo trigger a standalone invalidation, run `sls cloudfrontInvalidate`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaseline-js%2Fserverless-baseline-invalidate-cloudfront","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaseline-js%2Fserverless-baseline-invalidate-cloudfront","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaseline-js%2Fserverless-baseline-invalidate-cloudfront/lists"}