Once you have registered type handler (see deployment guide), you can use resource in your templates:
Resources: RewritesFunction: Type: "WrzasqPl::AWS::EdgeDeploy" Properties: Name: "edge-feeds-rewrites" RoleArn: !GetAtt "RewritesLambdaRole.Arn" Handler: "index.handler" Runtime: "nodejs14.x" Memory: 128 Timeout: 5 PackageBucket: "your-bucket" PackageKey: "input-lambda.zip" Config: rewrites: - pattern: "^/tag,([a-zA-Z0-9-_]+)\\.atom$" rewrite: "/feeds/tags/$1" - pattern: "^/([a-zA-Z0-9-_]+)\\.atom$" rewrite: "/feeds/categories/$1"
Name
(required, physical resource ID) - stringAccount name.
Note: Forces replacement.
Description
- stringLambda function description.
RoleArn
(required) - string (ARN format)ARN of Lambda execution role.
Runtime
(required) - stringRuntime for running the Lambda (note that Lambda@Edge has reduced set of supported runtimes).
Handler
(required) - stringLambda entry point.
Memory
(required) - integerMemory size (in MB) for the Lambda.
Timeout
(required) - integerLambda timeout (in seconds).
PackageBucket
(required) - stringPackage S3 bucket.
PackageKey
(required) - stringPackage S3 key.
ConfigFile
- stringFilename for the injected configuration.
Defaults to config.json
.
Config
- objectCustom configuration to bundle with the package.
Tags
- TagsResource tags.
Arn
- string (ARN format)Account ARN.
Even though Lambda@Edge can only be managed from us-east-1
region, functions deployed as Lambda@Edge (bound to CloudFront distribution) are being replicated across all regions in AWS when only they are used in other location.
Unfortunately replicas can’t be deleted manually. This will cause automated resource deletion, triggered by CloudFormation to fail.
This will not break stack update process, as unused resources are deleted in UPDATE_COMPLETE_CLEANUP_IN_PROGRESS
phase, but will leave the function in us-east-1
region deployed. You will have to wait until all replicas are purged (usually few hours) and manually delete.