-
Notifications
You must be signed in to change notification settings - Fork 0
/
aws_sam.yaml
76 lines (76 loc) · 2.5 KB
/
aws_sam.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This AWS SAM template has been generated from your function's configuration. If
# your function has one or more triggers, note that the AWS resources associated
# with these triggers aren't fully specified in this template and include
# placeholder values. Open this template in AWS Application Composer or your
# favorite IDE and modify it to specify a serverless application with other AWS
# resources.
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Execute a complete migration from a MySQL database to an S3 bucket datalake
Resources:
migrationLambda:
Type: AWS::Serverless::Function
Properties:
CodeUri: .
Description: ''
MemorySize: 1024
Timeout: 600
Handler: index.handler
Runtime: nodejs18.x
Architectures:
- x86_64
EphemeralStorage:
Size: 2048
EventInvokeConfig:
MaximumEventAgeInSeconds: 21600
MaximumRetryAttempts: 2
FunctionUrlConfig:
AuthType: NONE
InvokeMode: BUFFERED
Cors:
AllowOrigins:
- '*'
MaxAge: 0
PackageType: Zip
Policies:
- Statement:
- Sid: FullAccessOnSingleBucket
Effect: Allow
Action:
- s3:*
- s3-object-lambda:*
Resource: arn:aws:s3:::BUCKET_NAME/*
- Effect: Allow
Action:
- logs:CreateLogGroup
Resource: arn:aws:logs:us-east-1:AWS_ACCOUNT_ID:*
- Effect: Allow
Action:
- logs:CreateLogStream
- logs:PutLogEvents
Resource:
- >-
arn:aws:logs:AWS_REGION:AWS_ACCOUNT_ID:log-group:/aws/lambda/LAMBDA_NAME:*
- Sid: AWSLambdaVPCAccessExecutionPermissions
Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
- ec2:CreateNetworkInterface
- ec2:DescribeNetworkInterfaces
- ec2:DescribeSubnets
- ec2:DeleteNetworkInterface
- ec2:AssignPrivateIpAddresses
- ec2:UnassignPrivateIpAddresses
Resource: '*'
SnapStart:
ApplyOn: None
VpcConfig:
SecurityGroupIds:
- SECURITY:GROUP
SubnetIds:
- SUBNET1
- SUBNET2
Ipv6AllowedForDualStack: false
RuntimeManagementConfig: {}