mirror of
https://github.com/eledio-cloud/standard-redirects-for-cloudfront.git
synced 2025-10-30 16:12:30 +01:00
44 lines
1.3 KiB
YAML
44 lines
1.3 KiB
YAML
AWSTemplateFormatVersion: '2010-09-09'
|
|
Transform: AWS::Serverless-2016-10-31
|
|
Outputs:
|
|
StandardRedirectsForCloudFrontVersionOutput:
|
|
Description: The ARN of the function, including the version
|
|
Value: !Ref StandardRedirectsForCloudFront.Version
|
|
Export:
|
|
Name: StandardRedirectsForCloudFrontARN
|
|
Resources:
|
|
StandardRedirectsForCloudFront:
|
|
Type: AWS::Serverless::Function
|
|
Properties:
|
|
Handler: index.handler
|
|
Runtime: nodejs14.x
|
|
Description: 'Standard Redirects for CloudFront by Digital Sailors via the Serverless Application Repository.'
|
|
Role: !GetAtt LambdaRole.Arn
|
|
MemorySize: 128
|
|
Timeout: 3
|
|
AutoPublishAlias: 'CurrentProd'
|
|
|
|
LambdaRole:
|
|
Type: AWS::IAM::Role
|
|
Properties:
|
|
AssumeRolePolicyDocument:
|
|
Version: '2012-10-17'
|
|
Statement:
|
|
Effect: Allow
|
|
Principal:
|
|
Service:
|
|
- lambda.amazonaws.com
|
|
- edgelambda.amazonaws.com
|
|
Action: sts:AssumeRole
|
|
Policies:
|
|
- PolicyName: edgelambda-policy
|
|
PolicyDocument:
|
|
Version: "2012-10-17"
|
|
Statement:
|
|
- Effect: Allow
|
|
Action:
|
|
- logs:CreateLogGroup
|
|
- logs:CreateLogStream
|
|
- logs:PutLogEvents
|
|
Resource: '*'
|