123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- {
- "AWSTemplateFormatVersion": "2010-09-09",
- "Description": "The AWS CloudFormation template for this Serverless application",
- "Resources": {
- "ServerlessDeploymentBucket": {
- "Type": "AWS::S3::Bucket",
- "Properties": {
- "BucketEncryption": {
- "ServerSideEncryptionConfiguration": [
- {
- "ServerSideEncryptionByDefault": {
- "SSEAlgorithm": "AES256"
- }
- }
- ]
- }
- }
- },
- "ServerlessDeploymentBucketPolicy": {
- "Type": "AWS::S3::BucketPolicy",
- "Properties": {
- "Bucket": {
- "Ref": "ServerlessDeploymentBucket"
- },
- "PolicyDocument": {
- "Statement": [
- {
- "Action": "s3:*",
- "Effect": "Deny",
- "Principal": "*",
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:",
- {
- "Ref": "AWS::Partition"
- },
- ":s3:::",
- {
- "Ref": "ServerlessDeploymentBucket"
- },
- "/*"
- ]
- ]
- },
- {
- "Fn::Join": [
- "",
- [
- "arn:",
- {
- "Ref": "AWS::Partition"
- },
- ":s3:::",
- {
- "Ref": "ServerlessDeploymentBucket"
- }
- ]
- ]
- }
- ],
- "Condition": {
- "Bool": {
- "aws:SecureTransport": false
- }
- }
- }
- ]
- }
- }
- },
- "PrepDashfLogGroup": {
- "Type": "AWS::Logs::LogGroup",
- "Properties": {
- "LogGroupName": "/aws/lambda/hdci-wallpad-raw-to-prep"
- }
- },
- "IamRoleLambdaExecution": {
- "Type": "AWS::IAM::Role",
- "Properties": {
- "AssumeRolePolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": {
- "Service": [
- "lambda.amazonaws.com"
- ]
- },
- "Action": [
- "sts:AssumeRole"
- ]
- }
- ]
- },
- "Policies": [
- {
- "PolicyName": {
- "Fn::Join": [
- "-",
- [
- "hnw-wallpad-etl",
- "dev",
- "lambda"
- ]
- ]
- },
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": [
- "logs:CreateLogStream",
- "logs:CreateLogGroup"
- ],
- "Resource": [
- {
- "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/hdci-wallpad-raw-to-prep:*"
- }
- ]
- },
- {
- "Effect": "Allow",
- "Action": [
- "logs:PutLogEvents"
- ],
- "Resource": [
- {
- "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/hdci-wallpad-raw-to-prep:*:*"
- }
- ]
- },
- {
- "Effect": "Allow",
- "Action": [
- "s3:ListBucket",
- "s3:GetObject"
- ],
- "Resource": "arn:aws:s3:::homenetwork-data/*"
- },
- {
- "Effect": "Allow",
- "Action": [
- "s3:PutObject"
- ],
- "Resource": "arn:aws:s3:::hdci-wallpad-prep/*"
- }
- ]
- }
- }
- ],
- "Path": "/",
- "RoleName": {
- "Fn::Join": [
- "-",
- [
- "hnw-wallpad-etl",
- "dev",
- {
- "Ref": "AWS::Region"
- },
- "lambdaRole"
- ]
- ]
- }
- }
- },
- "PrepDashfLambdaFunction": {
- "Type": "AWS::Lambda::Function",
- "Properties": {
- "Code": {
- "S3Bucket": {
- "Ref": "ServerlessDeploymentBucket"
- },
- "S3Key": "serverless/hnw-wallpad-etl/dev/1617779857545-2021-04-07T07:17:37.545Z/preprocess-hdci-wallpad-raw-to-prep.zip"
- },
- "Handler": "preprocess/lambda_function.lambda_handler",
- "Runtime": "python3.8",
- "FunctionName": "hdci-wallpad-raw-to-prep",
- "MemorySize": 1024,
- "Timeout": 180,
- "Environment": {
- "Variables": {
- "PREP_BUCKET": "hdci-wallpad-prep"
- }
- },
- "Role": {
- "Fn::GetAtt": [
- "IamRoleLambdaExecution",
- "Arn"
- ]
- }
- },
- "DependsOn": [
- "PrepDashfLogGroup"
- ]
- },
- "PrepDashfLambdaVersion6kG0JfRlaV9PcfPIfqXoZs7UXmFownZER3v6tOps6iY": {
- "Type": "AWS::Lambda::Version",
- "DeletionPolicy": "Retain",
- "Properties": {
- "FunctionName": {
- "Ref": "PrepDashfLambdaFunction"
- },
- "CodeSha256": "pzZFpQxx/iOmdihZHN62crmDKmGlSChnGjtFpayNX28="
- }
- },
- "PrepDashfCustomS31": {
- "Type": "Custom::S3",
- "Version": 1,
- "DependsOn": [
- "PrepDashfLambdaFunction",
- "CustomDashresourceDashexistingDashs3LambdaFunction"
- ],
- "Properties": {
- "ServiceToken": {
- "Fn::GetAtt": [
- "CustomDashresourceDashexistingDashs3LambdaFunction",
- "Arn"
- ]
- },
- "FunctionName": "hdci-wallpad-raw-to-prep",
- "BucketName": "homenetwork-data",
- "BucketConfigs": [
- {
- "Event": "s3:ObjectCreated:*",
- "Rules": []
- }
- ]
- }
- },
- "IamRoleCustomResourcesLambdaExecution": {
- "Type": "AWS::IAM::Role",
- "Properties": {
- "AssumeRolePolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": {
- "Service": [
- "lambda.amazonaws.com"
- ]
- },
- "Action": [
- "sts:AssumeRole"
- ]
- }
- ]
- },
- "Policies": [
- {
- "PolicyName": {
- "Fn::Join": [
- "-",
- [
- "dev",
- "hnw-wallpad-etl",
- "custom-resources-lambda"
- ]
- ]
- },
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Resource": {
- "Fn::Join": [
- ":",
- [
- "arn",
- {
- "Ref": "AWS::Partition"
- },
- "s3",
- "",
- "",
- "homenetwork-data"
- ]
- ]
- },
- "Action": [
- "s3:PutBucketNotification",
- "s3:GetBucketNotification"
- ]
- },
- {
- "Effect": "Allow",
- "Resource": {
- "Fn::Join": [
- ":",
- [
- "arn",
- {
- "Ref": "AWS::Partition"
- },
- "lambda",
- {
- "Ref": "AWS::Region"
- },
- {
- "Ref": "AWS::AccountId"
- },
- "function",
- "*"
- ]
- ]
- },
- "Action": [
- "lambda:AddPermission",
- "lambda:RemovePermission"
- ]
- }
- ]
- }
- }
- ]
- }
- },
- "CustomDashresourceDashexistingDashs3LambdaFunction": {
- "Type": "AWS::Lambda::Function",
- "Properties": {
- "Code": {
- "S3Bucket": {
- "Ref": "ServerlessDeploymentBucket"
- },
- "S3Key": "serverless/hnw-wallpad-etl/dev/1617779857545-2021-04-07T07:17:37.545Z/custom-resources.zip"
- },
- "FunctionName": "hnw-wallpad-etl-undefined-custom-resource-existing-s3",
- "Handler": "s3/handler.handler",
- "MemorySize": 1024,
- "Runtime": "nodejs12.x",
- "Timeout": 180,
- "Role": {
- "Fn::GetAtt": [
- "IamRoleCustomResourcesLambdaExecution",
- "Arn"
- ]
- }
- },
- "DependsOn": [
- "IamRoleCustomResourcesLambdaExecution"
- ]
- }
- },
- "Outputs": {
- "ServerlessDeploymentBucketName": {
- "Value": {
- "Ref": "ServerlessDeploymentBucket"
- }
- },
- "PrepDashfLambdaFunctionQualifiedArn": {
- "Description": "Current Lambda function version",
- "Value": {
- "Ref": "PrepDashfLambdaVersion6kG0JfRlaV9PcfPIfqXoZs7UXmFownZER3v6tOps6iY"
- }
- }
- }
- }
|