├── .dockerignore ├── .gitignore ├── .npmignore ├── Dockerfile ├── LICENSE ├── LICENSE-3RD-PARTY ├── README.md ├── bin └── app.ts ├── infra ├── .gitignore ├── .npmignore ├── bin │ └── app.ts ├── cdk.json ├── jest.config.js ├── lib │ └── puppeteer-stack.ts ├── package-lock.json ├── package.json ├── res │ ├── compute │ │ └── lambda │ │ │ ├── function-invoke │ │ │ ├── index.js │ │ │ └── props.yaml │ │ │ └── function-puppeteer │ │ │ └── props.yaml │ ├── security-identity-compliance │ │ └── iam │ │ │ └── role-lambda │ │ │ └── props.yaml │ └── storage │ │ └── s3 │ │ └── bucket │ │ └── props.yaml ├── test │ └── app.test.ts └── tsconfig.json ├── jest.config.js ├── package-lock.json ├── package.json ├── test └── app.test.ts └── tsconfig.json /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !jest.config.js 3 | *.d.ts 4 | node_modules 5 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | !*.d.ts 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amazon/aws-lambda-nodejs:12 2 | 3 | ARG AWS_ACCESS_KEY_ID 4 | ARG AWS_SECRET_ACCESS_KEY 5 | ARG AWS_REGION=us-east-1 6 | 7 | # Install Chrome to get all of the dependencies installed 8 | RUN yum install -y amazon-linux-extras 9 | RUN amazon-linux-extras install epel -y 10 | RUN yum install -y chromium 11 | 12 | ENV AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ 13 | AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \ 14 | AWS_REGION=$AWS_REGION 15 | 16 | COPY jest.config.js package*.json tsconfig.json ${LAMBDA_TASK_ROOT}/ 17 | COPY bin/app.ts ${LAMBDA_TASK_ROOT}/bin/ 18 | COPY test/app.test.ts ${LAMBDA_TASK_ROOT}/test/ 19 | 20 | RUN npm install 21 | RUN npm run build 22 | RUN npm test 23 | 24 | CMD [ "bin/app.lambdaHandler" ] 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 SHI International Corp. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /LICENSE-3RD-PARTY: -------------------------------------------------------------------------------- 1 | This file contains 3rd party software licenses for software used by this app. 2 | 3 | -------------------------------------------------------------------------------- 4 | 5 | The sample app was modified from: 6 | 7 | https://github.com/paulbouwer/hello-kubernetes 8 | 9 | MIT License 10 | 11 | Copyright (c) 2017 Paul Bouwer 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining a copy 14 | of this software and associated documentation files (the "Software"), to deal 15 | in the Software without restriction, including without limitation the rights 16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | copies of the Software, and to permit persons to whom the Software is 18 | furnished to do so, subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be included in all 21 | copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 29 | SOFTWARE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lambda / Container / Puppeteer 2 | 3 | Example of how to deploy an AWS Lambda function as a container containing [Puppeteer](https://pptr.dev), with [CRPM](https://shi.github.io/crpm). 4 | 5 | This example uses one Lambda function to asynchronously invoke multiple instances of another Lambda function, which takes a screenshot of a website. 6 | This enables you to take several screenshots in parallel and scale horizontally. The screenshots are stored in an S3 bucket. 7 | 8 | ## Instructions 9 | 10 | Deploy the cloud infrastructure. 11 | 12 | ## Deploy Stack 13 | 14 | ```bash 15 | # Change to infrastructure directory 16 | cd infra 17 | 18 | # Install and build the CDK application 19 | npm i 20 | npm run build 21 | 22 | # Deploy the CDK bootstrap stack 23 | cdk bootstrap aws://unknown-account/unknown-region 24 | 25 | # Deploy the CloudFormation stack 26 | cdk deploy puppeteer 27 | ``` 28 | 29 | ## Test 30 | 31 | In the AWS Console, open the Invoke Lambda function that was created by CDK above. 32 | Create a test with the following JSON, and run it. 33 | 34 | ```bash 35 | ["https://news.yahoo.com/", 36 | "https://news.google.com/", 37 | "https://www.huffpost.com/", 38 | "https://www.cnn.com/", 39 | "https://www.nytimes.com/", 40 | "https://www.foxnews.com/", 41 | "https://www.nbcnews.com/", 42 | "https://www.washingtonpost.com/", 43 | "https://www.wsj.com/", 44 | "https://abcnews.go.com/", 45 | "https://www.usatoday.com/"] 46 | ``` 47 | 48 | ## Destroy Stack 49 | 50 | In the AWS Console, manually empty the bucket that was created by CDK above. 51 | Then, run the following command. 52 | 53 | ```bash 54 | # Destroy the CloudFormation stack 55 | cdk destroy puppeteer 56 | ``` 57 | 58 | -------------------------------------------------------------------------------- /bin/app.ts: -------------------------------------------------------------------------------- 1 | import { Context } from 'aws-lambda'; 2 | import * as aws from 'aws-sdk'; 3 | import * as puppeteer from 'puppeteer'; 4 | 5 | export const lambdaHandler = async(event: any, context: Context) => { 6 | const url = event.url; 7 | console.log(`URL: ${url}`); 8 | 9 | let attempt = 0; 10 | do { 11 | attempt++; 12 | try { 13 | const browser = await puppeteer.launch({ 14 | args: [ 15 | '--no-sandbox', 16 | '--disable-setuid-sandbox', 17 | '--disable-dev-shm-usage', 18 | '--single-process' 19 | ] 20 | }); 21 | const browserVersion = await browser.version() 22 | console.log(`Started ${browserVersion}`); 23 | const page = await browser.newPage(); 24 | page.setDefaultNavigationTimeout(60000); 25 | await page.setViewport({ width: 1920, height: 1080 }); 26 | await page.goto(url); 27 | const screenshot = await page.screenshot({ fullPage: true }) as Buffer; 28 | await page.close(); 29 | await browser.close(); 30 | 31 | const s3 = new aws.S3(); 32 | const key = `screenshots/${context.awsRequestId}.png`; 33 | console.log(`Screenshot location: ${event.bucketName}/${key}`); 34 | await s3.putObject({ 35 | Bucket: event.bucketName, 36 | Key: key, 37 | Body: screenshot, 38 | ContentType: 'image' 39 | }).promise(); 40 | 41 | return { 42 | statusCode: 200, 43 | body: key 44 | } 45 | } catch (err) { 46 | console.log('Error:', err); 47 | if (attempt <= 3) { 48 | console.log('Trying again'); 49 | } 50 | } 51 | } while (attempt <= 3) 52 | 53 | return { 54 | statusCode: 400, 55 | body: 'Error' 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /infra/.gitignore: -------------------------------------------------------------------------------- 1 | !res/**/*.js 2 | 3 | # CDK asset staging directory 4 | .cdk.staging 5 | cdk.out 6 | -------------------------------------------------------------------------------- /infra/.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | !*.d.ts 3 | 4 | # CDK asset staging directory 5 | .cdk.staging 6 | cdk.out 7 | -------------------------------------------------------------------------------- /infra/bin/app.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import 'source-map-support/register'; 3 | import * as cdk from '@aws-cdk/core'; 4 | import { PuppeteerStack } from '../lib/puppeteer-stack'; 5 | 6 | const app = new cdk.App(); 7 | new PuppeteerStack(app, 'puppeteer', { 8 | stackName: 'lambda-puppeteer', 9 | description: 'Example of how to deploy an AWS Lambda function as a container containing Puppeteer' 10 | }); 11 | -------------------------------------------------------------------------------- /infra/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "npx ts-node --prefer-ts-exts bin/app.ts", 3 | "context": { 4 | "@aws-cdk/core:enableStackNameDuplicates": "true", 5 | "aws-cdk:enableDiffNoFail": "true", 6 | "@aws-cdk/core:stackRelativeExports": "true", 7 | "@aws-cdk/aws-ecr-assets:dockerIgnoreSupport": true, 8 | "@aws-cdk/aws-secretsmanager:parseOwnedSecretName": true, 9 | "@aws-cdk/aws-kms:defaultKeyPolicies": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /infra/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | roots: ['/test'], 3 | testMatch: ['**/*.test.ts'], 4 | transform: { 5 | '^.+\\.tsx?$': 'ts-jest' 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /infra/lib/puppeteer-stack.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from '@aws-cdk/core'; 2 | import * as crpm from 'crpm'; 3 | import * as ecra from '@aws-cdk/aws-ecr-assets' 4 | import * as fs from 'fs'; 5 | import * as iam from '@aws-cdk/aws-iam'; 6 | import * as lambda from '@aws-cdk/aws-lambda'; 7 | import * as s3 from '@aws-cdk/aws-s3'; 8 | 9 | export class PuppeteerStack extends cdk.Stack { 10 | constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { 11 | super(scope, id, props); 12 | 13 | const bucketProps = crpm.load(`${__dirname}/../res/storage/s3/bucket/props.yaml`); 14 | const bucket = new s3.CfnBucket(this, 'Bucket', bucketProps); 15 | 16 | const dockerImage = new ecra.DockerImageAsset(this, 'DockerImage', {directory: '../', exclude: ['node_modules', 'infra']}); 17 | 18 | const fnRoleProps = crpm.load(`${__dirname}/../res/security-identity-compliance/iam/role-lambda/props.yaml`); 19 | const fnRole = new iam.CfnRole(this, 'LambdaRole', fnRoleProps); 20 | 21 | const appFnProps = crpm.load(`${__dirname}/../res/compute/lambda/function-puppeteer/props.yaml`); 22 | appFnProps.code = { 23 | imageUri: dockerImage.imageUri 24 | }; 25 | appFnProps.role = fnRole.attrArn; 26 | const appFn = new lambda.CfnFunction(this, 'PuppeteerFunction', appFnProps); 27 | 28 | const invokeFnDir = `${__dirname}/../res/compute/lambda/function-invoke`; 29 | const invokeFnProps = crpm.load(`${__dirname}/../res/compute/lambda/function-invoke/props.yaml`); 30 | invokeFnProps.code = { 31 | zipFile: fs.readFileSync(`${invokeFnDir}/index.js`, 'utf8') 32 | }; 33 | invokeFnProps.role = fnRole.attrArn; 34 | invokeFnProps.environment = { 35 | variables: { 36 | 'puppeteerFunctionName': appFn.ref, 37 | 'bucketName': bucket.ref 38 | } 39 | } 40 | const invokeFn = new lambda.CfnFunction(this, 'InvokeFunction', invokeFnProps); 41 | 42 | new cdk.CfnOutput(this, 'ECRImageURI', {value: dockerImage.imageUri}); 43 | new cdk.CfnOutput(this, 'InvokeLambdaFunctionName', {value: invokeFn.ref}); 44 | new cdk.CfnOutput(this, 'BucketName', {value: bucket.ref}); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /infra/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lambda-puppeteer-infra", 3 | "version": "1.0.0", 4 | "description": "Example of how to deploy an AWS Lambda function as a container containing Puppeteer", 5 | "license": "Apache-2.0", 6 | "author": { 7 | "name": "SHI International Corp.", 8 | "url": "https://www.shi.com", 9 | "organization": true 10 | }, 11 | "bin": { 12 | "tmp": "bin/app.js" 13 | }, 14 | "scripts": { 15 | "build": "tsc", 16 | "watch": "tsc -w", 17 | "test": "jest", 18 | "cdk": "cdk", 19 | "update-dependencies": "ncu -u" 20 | }, 21 | "devDependencies": { 22 | "@aws-cdk/assert": "1.110.1", 23 | "@types/jest": "^26.0.20", 24 | "@types/node": "14.14.20", 25 | "jest": "^26.6.3", 26 | "npm-check-updates": "~11.7.1", 27 | "ts-jest": "^26.4.2", 28 | "aws-cdk": "1.110.1", 29 | "ts-node": "^9.1.1", 30 | "typescript": "~4.3.4" 31 | }, 32 | "dependencies": { 33 | "@aws-cdk/aws-apigatewayv2": "^1.110.1", 34 | "@aws-cdk/aws-iam": "^1.110.1", 35 | "@aws-cdk/aws-lambda": "^1.110.1", 36 | "@aws-cdk/aws-s3": "^1.110.1", 37 | "@aws-cdk/core": "1.110.1", 38 | "crpm": "^2.6.0", 39 | "source-map-support": "^0.5.19" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /infra/res/compute/lambda/function-invoke/index.js: -------------------------------------------------------------------------------- 1 | const aws = require('aws-sdk'); 2 | const lambda = new aws.Lambda({apiVersion: '2015-03-31'}); 3 | 4 | exports.handler = async function(event, context) { 5 | const puppeteerFunctionName = process.env.puppeteerFunctionName; 6 | const bucketName = process.env.bucketName; 7 | console.log('Puppeteer Lambda Function Name:', puppeteerFunctionName); 8 | console.log('Bucket Name:', bucketName); 9 | console.log('Invoking Puppeteer Lambda function for each URL'); 10 | await Promise.all(event.map(async (url) => { 11 | console.log('URL:', url); 12 | await lambda.invoke({ 13 | FunctionName: puppeteerFunctionName, 14 | InvocationType: 'Event', 15 | LogType: 'None', 16 | Payload: JSON.stringify({ 17 | 'url': url, 18 | 'bucketName': bucketName 19 | }) 20 | }).promise(); 21 | })); 22 | }; -------------------------------------------------------------------------------- /infra/res/compute/lambda/function-invoke/props.yaml: -------------------------------------------------------------------------------- 1 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-code 2 | # Type: object 3 | # Required 4 | #code: 5 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3bucket 6 | # Type: string 7 | # Optional 8 | # s3Bucket: '' 9 | 10 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3key 11 | # Type: string 12 | # Optional 13 | # s3Key: '' 14 | 15 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3objectversion 16 | # Type: string 17 | # Optional 18 | # s3ObjectVersion: '' 19 | 20 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-zipfile 21 | # Type: string 22 | # Optional 23 | # zipFile: '' 24 | 25 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-handler 26 | # Type: string 27 | # Required 28 | handler: 'index.handler' 29 | 30 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-role 31 | # Type: string 32 | # Required 33 | #role: '' 34 | 35 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-runtime 36 | # Type: string 37 | # Required 38 | runtime: 'nodejs12.x' 39 | 40 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-deadletterconfig 41 | # Type: object 42 | # Optional 43 | #deadLetterConfig: 44 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html#cfn-lambda-function-deadletterconfig-targetarn 45 | # Type: string 46 | # Optional 47 | # targetArn: '' 48 | 49 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-description 50 | # Type: string 51 | # Optional 52 | description: 'Invokes Puppeteer Lambda function multiple times to run in parallel' 53 | 54 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-environment 55 | # Type: object 56 | # Optional 57 | #environment: 58 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html#cfn-lambda-function-environment-variables 59 | # Type: object 60 | # Optional 61 | # variables: 62 | 63 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-functionname 64 | # Type: string 65 | # Optional 66 | #functionName: '' 67 | 68 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-kmskeyarn 69 | # Type: string 70 | # Optional 71 | #kmsKeyArn: '' 72 | 73 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-layers 74 | # Type: list 75 | # Optional 76 | #layers: 77 | # - 78 | 79 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-memorysize 80 | # Type: number 81 | # Optional 82 | #memorySize: 0 83 | 84 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-reservedconcurrentexecutions 85 | # Type: number 86 | # Optional 87 | #reservedConcurrentExecutions: 0 88 | 89 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tags 90 | # Type: list 91 | # Optional 92 | #tags: 93 | # - 94 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-key 95 | # Type: string 96 | # Required 97 | # key: '' 98 | 99 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-value 100 | # Type: string 101 | # Required 102 | # value: '' 103 | 104 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-timeout 105 | # Type: number 106 | # Optional 107 | timeout: 300 108 | 109 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tracingconfig 110 | # Type: object 111 | # Optional 112 | #tracingConfig: 113 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tracingconfig.html#cfn-lambda-function-tracingconfig-mode 114 | # Type: string 115 | # Optional 116 | # mode: '' 117 | 118 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-vpcconfig 119 | # Type: object 120 | # Optional 121 | #vpcConfig: 122 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-securitygroupids 123 | # Type: list 124 | # Required 125 | # securityGroupIds: 126 | # - 127 | 128 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-subnetids 129 | # Type: list 130 | # Required 131 | # subnetIds: 132 | # - 133 | -------------------------------------------------------------------------------- /infra/res/compute/lambda/function-puppeteer/props.yaml: -------------------------------------------------------------------------------- 1 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-code 2 | # Type: object 3 | # Required 4 | #code: 5 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3bucket 6 | # Type: string 7 | # Optional 8 | # s3Bucket: '' 9 | 10 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3key 11 | # Type: string 12 | # Optional 13 | # s3Key: '' 14 | 15 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3objectversion 16 | # Type: string 17 | # Optional 18 | # s3ObjectVersion: '' 19 | 20 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-zipfile 21 | # Type: string 22 | # Optional 23 | # zipFile: '' 24 | 25 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-imageuri 26 | # Type: string 27 | # Optional 28 | # imageUri: '' 29 | 30 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-handler 31 | # Type: string 32 | # Optional 33 | #handler: '' 34 | 35 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-role 36 | # Type: string 37 | # Required 38 | #role: '' 39 | 40 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-runtime 41 | # Type: string 42 | # Optional 43 | #runtime: '' 44 | 45 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-codesigningconfigarn 46 | # Type: string 47 | # Optional 48 | #codeSigningConfigArn: '' 49 | 50 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-deadletterconfig 51 | # Type: object 52 | # Optional 53 | #deadLetterConfig: 54 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html#cfn-lambda-function-deadletterconfig-targetarn 55 | # Type: string 56 | # Optional 57 | # targetArn: '' 58 | 59 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-description 60 | # Type: string 61 | # Optional 62 | description: 'Puppeteer example' 63 | 64 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-environment 65 | # Type: object 66 | # Optional 67 | #environment: 68 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html#cfn-lambda-function-environment-variables 69 | # Type: object 70 | # Optional 71 | # variables: 72 | 73 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-filesystemconfigs 74 | # Type: list 75 | # Optional 76 | #fileSystemConfigs: 77 | # - 78 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-filesystemconfig.html#cfn-lambda-function-filesystemconfig-arn 79 | # Type: string 80 | # Required 81 | # arn: '' 82 | 83 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-filesystemconfig.html#cfn-lambda-function-filesystemconfig-localmountpath 84 | # Type: string 85 | # Required 86 | # localMountPath: '' 87 | 88 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-functionname 89 | # Type: string 90 | # Optional 91 | #functionName: '' 92 | 93 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig 94 | # Type: object 95 | # Optional 96 | #imageConfig: 97 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-imageconfig.html#cfn-lambda-function-imageconfig-command 98 | # Type: list 99 | # Optional 100 | # command: 101 | # - 102 | 103 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-imageconfig.html#cfn-lambda-function-imageconfig-entrypoint 104 | # Type: list 105 | # Optional 106 | # entryPoint: 107 | # - 108 | 109 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-imageconfig.html#cfn-lambda-function-imageconfig-workingdirectory 110 | # Type: string 111 | # Optional 112 | # workingDirectory: '' 113 | 114 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-kmskeyarn 115 | # Type: string 116 | # Optional 117 | #kmsKeyArn: '' 118 | 119 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-layers 120 | # Type: list 121 | # Optional 122 | #layers: 123 | # - 124 | 125 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-memorysize 126 | # Type: number 127 | # Optional 128 | memorySize: 1920 129 | 130 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-packagetype 131 | # Type: string 132 | # Optional 133 | packageType: 'Image' 134 | 135 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-reservedconcurrentexecutions 136 | # Type: number 137 | # Optional 138 | #reservedConcurrentExecutions: 0 139 | 140 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tags 141 | # Type: list 142 | # Optional 143 | #tags: 144 | # - 145 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-key 146 | # Type: string 147 | # Required 148 | # key: '' 149 | 150 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-value 151 | # Type: string 152 | # Required 153 | # value: '' 154 | 155 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-timeout 156 | # Type: number 157 | # Optional 158 | timeout: 210 159 | 160 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tracingconfig 161 | # Type: object 162 | # Optional 163 | #tracingConfig: 164 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tracingconfig.html#cfn-lambda-function-tracingconfig-mode 165 | # Type: string 166 | # Optional 167 | # mode: '' 168 | 169 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-vpcconfig 170 | # Type: object 171 | # Optional 172 | #vpcConfig: 173 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-securitygroupids 174 | # Type: list 175 | # Required 176 | # securityGroupIds: 177 | # - 178 | 179 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-subnetids 180 | # Type: list 181 | # Required 182 | # subnetIds: 183 | # - 184 | -------------------------------------------------------------------------------- /infra/res/security-identity-compliance/iam/role-lambda/props.yaml: -------------------------------------------------------------------------------- 1 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-assumerolepolicydocument 2 | # Type: object 3 | # Required 4 | assumeRolePolicyDocument: 5 | Version: 2012-10-17 6 | Statement: 7 | - Effect: Allow 8 | Principal: 9 | Service: lambda.amazonaws.com 10 | Action: 11 | - sts:AssumeRole 12 | 13 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-description 14 | # Type: string 15 | # Optional 16 | description: 'Allow Lambda invocation, logging and putting objects in S3' 17 | 18 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-managepolicyarns 19 | # Type: list 20 | # Optional 21 | #managedPolicyArns: 22 | # - 23 | 24 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-maxsessionduration 25 | # Type: number 26 | # Optional 27 | #maxSessionDuration: 0 28 | 29 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-path 30 | # Type: string 31 | # Optional 32 | #path: '' 33 | 34 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-permissionsboundary 35 | # Type: string 36 | # Optional 37 | #permissionsBoundary: '' 38 | 39 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-policies 40 | # Type: list 41 | # Optional 42 | policies: 43 | - 44 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html#cfn-iam-policies-policydocument 45 | # Type: object 46 | # Required 47 | policyDocument: 48 | Version: 2012-10-17 49 | Statement: 50 | - Effect: Allow 51 | Action: 52 | - 'lambda:InvokeFunction' 53 | - 'logs:CreateLogGroup' 54 | - 'logs:CreateLogStream' 55 | - 'logs:PutLogEvents' 56 | - 's3:PutObject' 57 | Resource: '*' 58 | 59 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html#cfn-iam-policies-policyname 60 | # Type: string 61 | # Required 62 | policyName: 'root' 63 | 64 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-rolename 65 | # Type: string 66 | # Optional 67 | #roleName: '' 68 | 69 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-tags 70 | # Type: list 71 | # Optional 72 | #tags: 73 | # - 74 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-key 75 | # Type: string 76 | # Required 77 | # key: '' 78 | 79 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-value 80 | # Type: string 81 | # Required 82 | # value: '' 83 | -------------------------------------------------------------------------------- /infra/res/storage/s3/bucket/props.yaml: -------------------------------------------------------------------------------- 1 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-accelerateconfiguration 2 | # Type: object 3 | # Optional 4 | #accelerateConfiguration: 5 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accelerateconfiguration.html#cfn-s3-bucket-accelerateconfiguration-accelerationstatus 6 | # Type: string 7 | # Required 8 | # accelerationStatus: '' 9 | 10 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-accesscontrol 11 | # Type: string 12 | # Optional 13 | #accessControl: '' 14 | 15 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-analyticsconfigurations 16 | # Type: list 17 | # Optional 18 | #analyticsConfigurations: 19 | # - 20 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-id 21 | # Type: string 22 | # Required 23 | # id: '' 24 | 25 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-prefix 26 | # Type: string 27 | # Optional 28 | # prefix: '' 29 | 30 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-storageclassanalysis 31 | # Type: object 32 | # Required 33 | # storageClassAnalysis: 34 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-storageclassanalysis.html#cfn-s3-bucket-storageclassanalysis-dataexport 35 | # Type: object 36 | # Optional 37 | # dataExport: 38 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-dataexport.html#cfn-s3-bucket-dataexport-destination 39 | # Type: object 40 | # Required 41 | # destination: 42 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-bucketaccountid 43 | # Type: string 44 | # Optional 45 | # bucketAccountId: '' 46 | 47 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-bucketarn 48 | # Type: string 49 | # Required 50 | # bucketArn: '' 51 | 52 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-format 53 | # Type: string 54 | # Required 55 | # format: '' 56 | 57 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-prefix 58 | # Type: string 59 | # Optional 60 | # prefix: '' 61 | 62 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-dataexport.html#cfn-s3-bucket-dataexport-outputschemaversion 63 | # Type: string 64 | # Required 65 | # outputSchemaVersion: '' 66 | 67 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-tagfilters 68 | # Type: list 69 | # Optional 70 | # tagFilters: 71 | # - 72 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-key 73 | # Type: string 74 | # Required 75 | # key: '' 76 | 77 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-value 78 | # Type: string 79 | # Required 80 | # value: '' 81 | 82 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-bucketencryption 83 | # Type: object 84 | # Optional 85 | #bucketEncryption: 86 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-bucketencryption.html#cfn-s3-bucket-bucketencryption-serversideencryptionconfiguration 87 | # Type: list 88 | # Required 89 | # serverSideEncryptionConfiguration: 90 | # - 91 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionrule.html#cfn-s3-bucket-serversideencryptionrule-serversideencryptionbydefault 92 | # Type: object 93 | # Optional 94 | # serverSideEncryptionByDefault: 95 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionbydefault.html#cfn-s3-bucket-serversideencryptionbydefault-kmsmasterkeyid 96 | # Type: string 97 | # Optional 98 | # kmsMasterKeyId: '' 99 | 100 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionbydefault.html#cfn-s3-bucket-serversideencryptionbydefault-ssealgorithm 101 | # Type: string 102 | # Required 103 | # sseAlgorithm: '' 104 | 105 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-name 106 | # Type: string 107 | # Optional 108 | #bucketName: '' 109 | 110 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-crossoriginconfig 111 | # Type: object 112 | # Optional 113 | #corsConfiguration: 114 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors.html#cfn-s3-bucket-cors-corsrule 115 | # Type: list 116 | # Required 117 | # corsRules: 118 | # - 119 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedheaders 120 | # Type: list 121 | # Optional 122 | # allowedHeaders: 123 | # - 124 | 125 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedmethods 126 | # Type: list 127 | # Required 128 | # allowedMethods: 129 | # - 130 | 131 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedorigins 132 | # Type: list 133 | # Required 134 | # allowedOrigins: 135 | # - 136 | 137 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-exposedheaders 138 | # Type: list 139 | # Optional 140 | # exposedHeaders: 141 | # - 142 | 143 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-id 144 | # Type: string 145 | # Optional 146 | # id: '' 147 | 148 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-maxage 149 | # Type: number 150 | # Optional 151 | # maxAge: 0 152 | 153 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-intelligenttieringconfigurations 154 | # Type: list 155 | # Optional 156 | #intelligentTieringConfigurations: 157 | # - 158 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-intelligenttieringconfiguration.html#cfn-s3-bucket-intelligenttieringconfiguration-id 159 | # Type: string 160 | # Required 161 | # id: '' 162 | 163 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-intelligenttieringconfiguration.html#cfn-s3-bucket-intelligenttieringconfiguration-prefix 164 | # Type: string 165 | # Optional 166 | # prefix: '' 167 | 168 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-intelligenttieringconfiguration.html#cfn-s3-bucket-intelligenttieringconfiguration-status 169 | # Type: string 170 | # Required 171 | # status: '' 172 | 173 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-intelligenttieringconfiguration.html#cfn-s3-bucket-intelligenttieringconfiguration-tagfilters 174 | # Type: list 175 | # Optional 176 | # tagFilters: 177 | # - 178 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-key 179 | # Type: string 180 | # Required 181 | # key: '' 182 | 183 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-value 184 | # Type: string 185 | # Required 186 | # value: '' 187 | 188 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-intelligenttieringconfiguration.html#cfn-s3-bucket-intelligenttieringconfiguration-tierings 189 | # Type: list 190 | # Required 191 | # tierings: 192 | # - 193 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tiering.html#cfn-s3-bucket-tiering-accesstier 194 | # Type: string 195 | # Required 196 | # accessTier: '' 197 | 198 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tiering.html#cfn-s3-bucket-tiering-days 199 | # Type: number 200 | # Required 201 | # days: 0 202 | 203 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-inventoryconfigurations 204 | # Type: list 205 | # Optional 206 | #inventoryConfigurations: 207 | # - 208 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-destination 209 | # Type: object 210 | # Required 211 | # destination: 212 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-bucketaccountid 213 | # Type: string 214 | # Optional 215 | # bucketAccountId: '' 216 | 217 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-bucketarn 218 | # Type: string 219 | # Required 220 | # bucketArn: '' 221 | 222 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-format 223 | # Type: string 224 | # Required 225 | # format: '' 226 | 227 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-prefix 228 | # Type: string 229 | # Optional 230 | # prefix: '' 231 | 232 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-enabled 233 | # Type: boolean 234 | # Required 235 | # enabled: false 236 | 237 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-id 238 | # Type: string 239 | # Required 240 | # id: '' 241 | 242 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-includedobjectversions 243 | # Type: string 244 | # Required 245 | # includedObjectVersions: '' 246 | 247 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-optionalfields 248 | # Type: list 249 | # Optional 250 | # optionalFields: 251 | # - 252 | 253 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-prefix 254 | # Type: string 255 | # Optional 256 | # prefix: '' 257 | 258 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-schedulefrequency 259 | # Type: string 260 | # Required 261 | # scheduleFrequency: '' 262 | 263 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-lifecycleconfig 264 | # Type: object 265 | # Optional 266 | #lifecycleConfiguration: 267 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig.html#cfn-s3-bucket-lifecycleconfig-rules 268 | # Type: list 269 | # Required 270 | # rules: 271 | # - 272 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-rule-abortincompletemultipartupload 273 | # Type: object 274 | # Optional 275 | # abortIncompleteMultipartUpload: 276 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-abortincompletemultipartupload.html#cfn-s3-bucket-abortincompletemultipartupload-daysafterinitiation 277 | # Type: number 278 | # Required 279 | # daysAfterInitiation: 0 280 | 281 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-expirationdate 282 | # Type: timestamp 283 | # Optional 284 | # expirationDate: 0 285 | 286 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-expirationindays 287 | # Type: number 288 | # Optional 289 | # expirationInDays: 0 290 | 291 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-id 292 | # Type: string 293 | # Optional 294 | # id: '' 295 | 296 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversionexpirationindays 297 | # Type: number 298 | # Optional 299 | # noncurrentVersionExpirationInDays: 0 300 | 301 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition 302 | # Type: object 303 | # Optional 304 | # noncurrentVersionTransition: 305 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition-storageclass 306 | # Type: string 307 | # Required 308 | # storageClass: '' 309 | 310 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition-transitionindays 311 | # Type: number 312 | # Required 313 | # transitionInDays: 0 314 | 315 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransitions 316 | # Type: list 317 | # Optional 318 | # noncurrentVersionTransitions: 319 | # - 320 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition-storageclass 321 | # Type: string 322 | # Required 323 | # storageClass: '' 324 | 325 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition-transitionindays 326 | # Type: number 327 | # Required 328 | # transitionInDays: 0 329 | 330 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-prefix 331 | # Type: string 332 | # Optional 333 | # prefix: '' 334 | 335 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-status 336 | # Type: string 337 | # Required 338 | # status: '' 339 | 340 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-rule-tagfilters 341 | # Type: list 342 | # Optional 343 | # tagFilters: 344 | # - 345 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-key 346 | # Type: string 347 | # Required 348 | # key: '' 349 | 350 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-value 351 | # Type: string 352 | # Required 353 | # value: '' 354 | 355 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-transition 356 | # Type: object 357 | # Optional 358 | # transition: 359 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-storageclass 360 | # Type: string 361 | # Required 362 | # storageClass: '' 363 | 364 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-transitiondate 365 | # Type: timestamp 366 | # Optional 367 | # transitionDate: 0 368 | 369 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-transitionindays 370 | # Type: number 371 | # Optional 372 | # transitionInDays: 0 373 | 374 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-transitions 375 | # Type: list 376 | # Optional 377 | # transitions: 378 | # - 379 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-storageclass 380 | # Type: string 381 | # Required 382 | # storageClass: '' 383 | 384 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-transitiondate 385 | # Type: timestamp 386 | # Optional 387 | # transitionDate: 0 388 | 389 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-transitionindays 390 | # Type: number 391 | # Optional 392 | # transitionInDays: 0 393 | 394 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-loggingconfig 395 | # Type: object 396 | # Optional 397 | #loggingConfiguration: 398 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfig.html#cfn-s3-bucket-loggingconfig-destinationbucketname 399 | # Type: string 400 | # Optional 401 | # destinationBucketName: '' 402 | 403 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfig.html#cfn-s3-bucket-loggingconfig-logfileprefix 404 | # Type: string 405 | # Optional 406 | # logFilePrefix: '' 407 | 408 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-metricsconfigurations 409 | # Type: list 410 | # Optional 411 | #metricsConfigurations: 412 | # - 413 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html#cfn-s3-bucket-metricsconfiguration-id 414 | # Type: string 415 | # Required 416 | # id: '' 417 | 418 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html#cfn-s3-bucket-metricsconfiguration-prefix 419 | # Type: string 420 | # Optional 421 | # prefix: '' 422 | 423 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html#cfn-s3-bucket-metricsconfiguration-tagfilters 424 | # Type: list 425 | # Optional 426 | # tagFilters: 427 | # - 428 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-key 429 | # Type: string 430 | # Required 431 | # key: '' 432 | 433 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-value 434 | # Type: string 435 | # Required 436 | # value: '' 437 | 438 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-notification 439 | # Type: object 440 | # Optional 441 | #notificationConfiguration: 442 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig 443 | # Type: list 444 | # Optional 445 | # lambdaConfigurations: 446 | # - 447 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig-event 448 | # Type: string 449 | # Required 450 | # event: '' 451 | 452 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig-filter 453 | # Type: object 454 | # Optional 455 | # filter: 456 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key 457 | # Type: object 458 | # Required 459 | # s3Key: 460 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules 461 | # Type: list 462 | # Required 463 | # rules: 464 | # - 465 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules-name 466 | # Type: string 467 | # Required 468 | # name: '' 469 | 470 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules-value 471 | # Type: string 472 | # Required 473 | # value: '' 474 | 475 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig-function 476 | # Type: string 477 | # Required 478 | # function: '' 479 | 480 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html#cfn-s3-bucket-notificationconfig-queueconfig 481 | # Type: list 482 | # Optional 483 | # queueConfigurations: 484 | # - 485 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-queueconfig.html#cfn-s3-bucket-notificationconfig-queueconfig-event 486 | # Type: string 487 | # Required 488 | # event: '' 489 | 490 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-queueconfig.html#cfn-s3-bucket-notificationconfig-queueconfig-filter 491 | # Type: object 492 | # Optional 493 | # filter: 494 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key 495 | # Type: object 496 | # Required 497 | # s3Key: 498 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules 499 | # Type: list 500 | # Required 501 | # rules: 502 | # - 503 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules-name 504 | # Type: string 505 | # Required 506 | # name: '' 507 | 508 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules-value 509 | # Type: string 510 | # Required 511 | # value: '' 512 | 513 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-queueconfig.html#cfn-s3-bucket-notificationconfig-queueconfig-queue 514 | # Type: string 515 | # Required 516 | # queue: '' 517 | 518 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html#cfn-s3-bucket-notificationconfig-topicconfig 519 | # Type: list 520 | # Optional 521 | # topicConfigurations: 522 | # - 523 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-topicconfig.html#cfn-s3-bucket-notificationconfig-topicconfig-event 524 | # Type: string 525 | # Required 526 | # event: '' 527 | 528 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-topicconfig.html#cfn-s3-bucket-notificationconfig-topicconfig-filter 529 | # Type: object 530 | # Optional 531 | # filter: 532 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key 533 | # Type: object 534 | # Required 535 | # s3Key: 536 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules 537 | # Type: list 538 | # Required 539 | # rules: 540 | # - 541 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules-name 542 | # Type: string 543 | # Required 544 | # name: '' 545 | 546 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules-value 547 | # Type: string 548 | # Required 549 | # value: '' 550 | 551 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-topicconfig.html#cfn-s3-bucket-notificationconfig-topicconfig-topic 552 | # Type: string 553 | # Required 554 | # topic: '' 555 | 556 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-objectlockconfiguration 557 | # Type: object 558 | # Optional 559 | #objectLockConfiguration: 560 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockconfiguration.html#cfn-s3-bucket-objectlockconfiguration-objectlockenabled 561 | # Type: string 562 | # Optional 563 | # objectLockEnabled: '' 564 | 565 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockconfiguration.html#cfn-s3-bucket-objectlockconfiguration-rule 566 | # Type: object 567 | # Optional 568 | # rule: 569 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockrule.html#cfn-s3-bucket-objectlockrule-defaultretention 570 | # Type: object 571 | # Optional 572 | # defaultRetention: 573 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html#cfn-s3-bucket-defaultretention-days 574 | # Type: number 575 | # Optional 576 | # days: 0 577 | 578 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html#cfn-s3-bucket-defaultretention-mode 579 | # Type: string 580 | # Optional 581 | # mode: '' 582 | 583 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html#cfn-s3-bucket-defaultretention-years 584 | # Type: number 585 | # Optional 586 | # years: 0 587 | 588 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-objectlockenabled 589 | # Type: boolean 590 | # Optional 591 | #objectLockEnabled: false 592 | 593 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-ownershipcontrols 594 | # Type: object 595 | # Optional 596 | #ownershipControls: 597 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ownershipcontrols.html#cfn-s3-bucket-ownershipcontrols-rules 598 | # Type: list 599 | # Required 600 | # rules: 601 | # - 602 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ownershipcontrolsrule.html#cfn-s3-bucket-ownershipcontrolsrule-objectownership 603 | # Type: string 604 | # Optional 605 | # objectOwnership: '' 606 | 607 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-publicaccessblockconfiguration 608 | # Type: object 609 | # Optional 610 | #publicAccessBlockConfiguration: 611 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-blockpublicacls 612 | # Type: boolean 613 | # Optional 614 | # blockPublicAcls: false 615 | 616 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-blockpublicpolicy 617 | # Type: boolean 618 | # Optional 619 | # blockPublicPolicy: false 620 | 621 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-ignorepublicacls 622 | # Type: boolean 623 | # Optional 624 | # ignorePublicAcls: false 625 | 626 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-restrictpublicbuckets 627 | # Type: boolean 628 | # Optional 629 | # restrictPublicBuckets: false 630 | 631 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-replicationconfiguration 632 | # Type: object 633 | # Optional 634 | #replicationConfiguration: 635 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration.html#cfn-s3-bucket-replicationconfiguration-role 636 | # Type: string 637 | # Required 638 | # role: '' 639 | 640 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration.html#cfn-s3-bucket-replicationconfiguration-rules 641 | # Type: list 642 | # Required 643 | # rules: 644 | # - 645 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationrule-deletemarkerreplication 646 | # Type: object 647 | # Optional 648 | # deleteMarkerReplication: 649 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-deletemarkerreplication.html#cfn-s3-bucket-deletemarkerreplication-status 650 | # Type: string 651 | # Optional 652 | # status: '' 653 | 654 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationconfiguration-rules-destination 655 | # Type: object 656 | # Required 657 | # destination: 658 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationdestination-accesscontroltranslation 659 | # Type: object 660 | # Optional 661 | # accessControlTranslation: 662 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accesscontroltranslation.html#cfn-s3-bucket-accesscontroltranslation-owner 663 | # Type: string 664 | # Required 665 | # owner: '' 666 | 667 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationdestination-account 668 | # Type: string 669 | # Optional 670 | # account: '' 671 | 672 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationconfiguration-rules-destination-bucket 673 | # Type: string 674 | # Required 675 | # bucket: '' 676 | 677 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationdestination-encryptionconfiguration 678 | # Type: object 679 | # Optional 680 | # encryptionConfiguration: 681 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-encryptionconfiguration.html#cfn-s3-bucket-encryptionconfiguration-replicakmskeyid 682 | # Type: string 683 | # Required 684 | # replicaKmsKeyId: '' 685 | 686 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationdestination-metrics 687 | # Type: object 688 | # Optional 689 | # metrics: 690 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metrics.html#cfn-s3-bucket-metrics-eventthreshold 691 | # Type: object 692 | # Optional 693 | # eventThreshold: 694 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationtimevalue.html#cfn-s3-bucket-replicationtimevalue-minutes 695 | # Type: number 696 | # Required 697 | # minutes: 0 698 | 699 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metrics.html#cfn-s3-bucket-metrics-status 700 | # Type: string 701 | # Required 702 | # status: '' 703 | 704 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationdestination-replicationtime 705 | # Type: object 706 | # Optional 707 | # replicationTime: 708 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationtime.html#cfn-s3-bucket-replicationtime-status 709 | # Type: string 710 | # Required 711 | # status: '' 712 | 713 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationtime.html#cfn-s3-bucket-replicationtime-time 714 | # Type: object 715 | # Required 716 | # time: 717 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationtimevalue.html#cfn-s3-bucket-replicationtimevalue-minutes 718 | # Type: number 719 | # Required 720 | # minutes: 0 721 | 722 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationconfiguration-rules-destination-storageclass 723 | # Type: string 724 | # Optional 725 | # storageClass: '' 726 | 727 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationrule-filter 728 | # Type: object 729 | # Optional 730 | # filter: 731 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationrulefilter.html#cfn-s3-bucket-replicationrulefilter-and 732 | # Type: object 733 | # Optional 734 | # and: 735 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationruleandoperator.html#cfn-s3-bucket-replicationruleandoperator-prefix 736 | # Type: string 737 | # Optional 738 | # prefix: '' 739 | 740 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationruleandoperator.html#cfn-s3-bucket-replicationruleandoperator-tagfilters 741 | # Type: list 742 | # Optional 743 | # tagFilters: 744 | # - 745 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-key 746 | # Type: string 747 | # Required 748 | # key: '' 749 | 750 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-value 751 | # Type: string 752 | # Required 753 | # value: '' 754 | 755 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationrulefilter.html#cfn-s3-bucket-replicationrulefilter-prefix 756 | # Type: string 757 | # Optional 758 | # prefix: '' 759 | 760 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationrulefilter.html#cfn-s3-bucket-replicationrulefilter-tagfilter 761 | # Type: object 762 | # Optional 763 | # tagFilter: 764 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-key 765 | # Type: string 766 | # Required 767 | # key: '' 768 | 769 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-value 770 | # Type: string 771 | # Required 772 | # value: '' 773 | 774 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationconfiguration-rules-id 775 | # Type: string 776 | # Optional 777 | # id: '' 778 | 779 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationconfiguration-rules-prefix 780 | # Type: string 781 | # Optional 782 | # prefix: '' 783 | 784 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationrule-priority 785 | # Type: number 786 | # Optional 787 | # priority: 0 788 | 789 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationrule-sourceselectioncriteria 790 | # Type: object 791 | # Optional 792 | # sourceSelectionCriteria: 793 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-sourceselectioncriteria.html#cfn-s3-bucket-sourceselectioncriteria-ssekmsencryptedobjects 794 | # Type: object 795 | # Optional 796 | # sseKmsEncryptedObjects: 797 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ssekmsencryptedobjects.html#cfn-s3-bucket-ssekmsencryptedobjects-status 798 | # Type: string 799 | # Required 800 | # status: '' 801 | 802 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationconfiguration-rules-status 803 | # Type: string 804 | # Required 805 | # status: '' 806 | 807 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-tags 808 | # Type: list 809 | # Optional 810 | #tags: 811 | # - 812 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-key 813 | # Type: string 814 | # Required 815 | # key: '' 816 | 817 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-value 818 | # Type: string 819 | # Required 820 | # value: '' 821 | 822 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-versioning 823 | # Type: object 824 | # Optional 825 | #versioningConfiguration: 826 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-versioningconfig.html#cfn-s3-bucket-versioningconfig-status 827 | # Type: string 828 | # Required 829 | # status: '' 830 | 831 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-websiteconfiguration 832 | # Type: object 833 | # Optional 834 | #websiteConfiguration: 835 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-errordocument 836 | # Type: string 837 | # Optional 838 | # errorDocument: '' 839 | 840 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-indexdocument 841 | # Type: string 842 | # Optional 843 | # indexDocument: '' 844 | 845 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-redirectallrequeststo 846 | # Type: object 847 | # Optional 848 | # redirectAllRequestsTo: 849 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-redirectallrequeststo.html#cfn-s3-websiteconfiguration-redirectallrequeststo-hostname 850 | # Type: string 851 | # Required 852 | # hostName: '' 853 | 854 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-redirectallrequeststo.html#cfn-s3-websiteconfiguration-redirectallrequeststo-protocol 855 | # Type: string 856 | # Optional 857 | # protocol: '' 858 | 859 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-routingrules 860 | # Type: list 861 | # Optional 862 | # routingRules: 863 | # - 864 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules.html#cfn-s3-websiteconfiguration-routingrules-redirectrule 865 | # Type: object 866 | # Required 867 | # redirectRule: 868 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-hostname 869 | # Type: string 870 | # Optional 871 | # hostName: '' 872 | 873 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-httpredirectcode 874 | # Type: string 875 | # Optional 876 | # httpRedirectCode: '' 877 | 878 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-protocol 879 | # Type: string 880 | # Optional 881 | # protocol: '' 882 | 883 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-replacekeyprefixwith 884 | # Type: string 885 | # Optional 886 | # replaceKeyPrefixWith: '' 887 | 888 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-replacekeywith 889 | # Type: string 890 | # Optional 891 | # replaceKeyWith: '' 892 | 893 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules.html#cfn-s3-websiteconfiguration-routingrules-routingrulecondition 894 | # Type: object 895 | # Optional 896 | # routingRuleCondition: 897 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-routingrulecondition.html#cfn-s3-websiteconfiguration-routingrules-routingrulecondition-httperrorcodereturnedequals 898 | # Type: string 899 | # Optional 900 | # httpErrorCodeReturnedEquals: '' 901 | 902 | # Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-routingrulecondition.html#cfn-s3-websiteconfiguration-routingrules-routingrulecondition-keyprefixequals 903 | # Type: string 904 | # Optional 905 | # keyPrefixEquals: '' 906 | -------------------------------------------------------------------------------- /infra/test/app.test.ts: -------------------------------------------------------------------------------- 1 | import { expect as expectCDK, haveResource } from '@aws-cdk/assert'; 2 | import * as cdk from '@aws-cdk/core'; 3 | import { PuppeteerStack } from '../lib/puppeteer-stack'; 4 | 5 | test('Stack', () => { 6 | const cdkApp = new cdk.App(); 7 | const test = new PuppeteerStack(cdkApp, 'puppeteer'); 8 | expectCDK(test).to(haveResource('AWS::Lambda::Function')); 9 | }); 10 | -------------------------------------------------------------------------------- /infra/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "declaration": true, 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "strictNullChecks": true, 10 | "noImplicitThis": true, 11 | "alwaysStrict": true, 12 | "noUnusedLocals": false, 13 | "noUnusedParameters": false, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": false, 16 | "inlineSourceMap": true, 17 | "inlineSources": true, 18 | "experimentalDecorators": true, 19 | "strictPropertyInitialization": false, 20 | "typeRoots": ["./node_modules/@types"] 21 | }, 22 | "exclude": ["cdk.out"] 23 | } 24 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | roots: ['/test'], 3 | testMatch: ['**/*.test.ts'], 4 | transform: { 5 | '^.+\\.tsx?$': 'ts-jest' 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lambda-puppeteer", 3 | "version": "1.0.0", 4 | "description": "Example of how to deploy an AWS Lambda function as a container containing Puppeteer", 5 | "license": "Apache-2.0", 6 | "author": { 7 | "name": "SHI International Corp.", 8 | "url": "https://www.shi.com", 9 | "organization": true 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/shi/crpm-lambda-container-puppeteer.git" 14 | }, 15 | "scripts": { 16 | "build": "tsc", 17 | "watch": "tsc -w", 18 | "test": "jest", 19 | "update-dependencies": "ncu -u" 20 | }, 21 | "devDependencies": { 22 | "@types/aws-lambda": "^8.10.77", 23 | "@types/jest": "^26.0.23", 24 | "@types/puppeteer": "^5.4.2", 25 | "jest": "~27.0.6", 26 | "npm-check-updates": "~11.7.1", 27 | "ts-jest": "~27.0.3", 28 | "typescript": "~4.3.4" 29 | }, 30 | "dependencies": { 31 | "aws-sdk": "^2.936.0", 32 | "puppeteer": "^5.5.0" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/app.test.ts: -------------------------------------------------------------------------------- 1 | import * as puppeteer from 'puppeteer'; 2 | 3 | it('test browser', async () => { 4 | const browser = await puppeteer.launch({ 5 | args: [ 6 | '--no-sandbox', 7 | '--disable-setuid-sandbox', 8 | '--disable-dev-shm-usage', 9 | '--single-process' 10 | ] 11 | }); 12 | const browserVersion = await browser.version() 13 | console.log(`Started ${browserVersion}`); 14 | const page = await browser.newPage(); 15 | console.log('Browser page created'); 16 | await page.close(); 17 | console.log('Browser page closed'); 18 | await browser.close(); 19 | console.log('Browser closed'); 20 | }); 21 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "alwaysStrict": true, 4 | "declaration": true, 5 | "experimentalDecorators": true, 6 | "inlineSourceMap": true, 7 | "inlineSources": true, 8 | "lib": ["es2018"], 9 | "module": "commonjs", 10 | "noFallthroughCasesInSwitch": false, 11 | "noImplicitAny": false, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "skipLibCheck": true, 17 | "strict": true, 18 | "strictNullChecks": false, 19 | "strictPropertyInitialization": false, 20 | "target": "ES2018", 21 | }, 22 | "include": [ 23 | "**/*.ts", 24 | "**/*.d.ts" 25 | ], 26 | "exclude": ["infra"] 27 | } 28 | --------------------------------------------------------------------------------