{"id":20540667,"url":"https://github.com/serverless-operations/serverless-lambda-edge-pre-existing-cloudfront","last_synced_at":"2025-04-09T22:15:23.317Z","repository":{"id":37699586,"uuid":"247847027","full_name":"serverless-operations/serverless-lambda-edge-pre-existing-cloudfront","owner":"serverless-operations","description":"A Serverless Framework plugin to create your Lambda@Edge against a pre-existing CloudFront.","archived":false,"fork":false,"pushed_at":"2023-05-08T21:33:09.000Z","size":935,"stargazers_count":56,"open_issues_count":17,"forks_count":17,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T22:15:11.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverless-operations.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2020-03-17T00:50:19.000Z","updated_at":"2024-03-12T11:17:53.000Z","dependencies_parsed_at":"2024-06-19T13:32:56.903Z","dependency_job_id":"5d017cc7-aad1-44b0-84e5-4ce0b1ee5ae0","html_url":"https://github.com/serverless-operations/serverless-lambda-edge-pre-existing-cloudfront","commit_stats":{"total_commits":34,"total_committers":11,"mean_commits":3.090909090909091,"dds":0.7058823529411764,"last_synced_commit":"ed639ec2f44289e8a1c259e316b6b614ad53b018"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-operations%2Fserverless-lambda-edge-pre-existing-cloudfront","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-operations%2Fserverless-lambda-edge-pre-existing-cloudfront/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-operations%2Fserverless-lambda-edge-pre-existing-cloudfront/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-operations%2Fserverless-lambda-edge-pre-existing-cloudfront/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverless-operations","download_url":"https://codeload.github.com/serverless-operations/serverless-lambda-edge-pre-existing-cloudfront/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119290,"owners_count":21050755,"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":"2024-11-16T01:17:00.705Z","updated_at":"2025-04-09T22:15:23.284Z","avatar_url":"https://github.com/serverless-operations.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless Lambda Edge PreExisting CloudFront\nA Serverless Framework plugin which associates Lambda@Edge against pre-existing CloudFront distributions.\n\n## Install\n\nYou can install this plugin from npm registry.\n\n```shell\n$ npm install --save-dev serverless-lambda-edge-pre-existing-cloudfront\n```\n\n## How it works\n\nConfigure serverless.yml\n\n```yaml\nfunctions:\n  viewerRequest:\n    handler: lambdaEdge/viewerRequest.handler\n    events:\n      - preExistingCloudFront:\n        # ---- Mandatory Properties -----\n          distributionId: xxxxxxx # CloudFront distribution ID you want to associate\n          eventType: viewer-request # Choose event to trigger your Lambda function, which are `viewer-request`, `origin-request`, `origin-response` or `viewer-response`\n          pathPattern: '*' # Specifying the CloudFront behavior\n          includeBody: false # Whether including body or not within request\n        # ---- Optional Property -----\n          stage: dev # Specify the stage at which you want this CloudFront distribution to be updated\n\nplugins:\n  - serverless-lambda-edge-pre-existing-cloudfront\n```\n\nRun deploy\n```\n$ serverless deploy\n```\n\nYou can specify additional configurations a `lambdaEdgePreExistingCloudFront` value in the custom section of your serverless.yml file.\nA `validStages` value allows you to specify valid stage names for deploy Lambda@Edge.\n\n```yaml\nlambdaEdgePreExistingCloudFront:\n  validStages:\n    - staging\n    - production\n```\n\n### How `validStages` and `stage` properties work\nThis plugin will first check for `validStages` property defined in the `custom` section. If `validStages` is used, then all the `preExistingCloudFront` events are only possible to be updated at the `validStages`. If not used, all the `preExistingCloudFront` events are possible to be updated at any stage.\n\nThen at all valid stages, the plugin checks - for each `preExistingCloudFront` event - if the provider's stage is the same as the `stage` property defined for each `preExistingCloudFront` event. If they match, then that particular `preExistingCloudFront` event will be updated.\n\nIf `stage` is not used for a `preExistingCloudFront` event, then that event will be updated at all `validStages` or all stages if `validStages` is not used.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-operations%2Fserverless-lambda-edge-pre-existing-cloudfront","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverless-operations%2Fserverless-lambda-edge-pre-existing-cloudfront","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-operations%2Fserverless-lambda-edge-pre-existing-cloudfront/lists"}