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
| AWSTemplateFormatVersion: '2010-09-09' Description: "This stack creates a Lambda function that gets its code from an S3 bucket and makes use of 2 different Lambda layers" Parameters: LambdaBucket: Description: S3 URI where the Lambda code zip will be located. Type: String Default: org-env-account-stack-templates-s3 LambdaDescription: Description: Description of the Lambda Function. Type: String Default: Lambda for tests. LambdaHandler: Description: Handler of the Lambda Function. Type: String Default: lambda_function.lambda_handler LambdaMemory: Description: Memory available to the Lambda Function. Type: Number Default: 832 LambdaName: Description: Name of the Lambda function. Type: String Default: TestLambda LambdaObject: Description: Name of the zip file that includes the Lambda code. Type: String Default: MyTest/Lambda_Test.zip LambdaObjectVersion: Description: Version of the Lambda code. Type: String Default: abcdeFGHij12LmN3opqRSTuV45wx67yz LambdaRole: Description: IAM role with permissions required to execute the Lambda function. Type: String Default: arn:aws:iam::123456789012:role/service-role/ChromelessTest-role-a1bcd2ef LambdaRuntime: Description: IAM role with permissions required to execute the Lambda function. Type: String Default: python3.7 LambdaTimeout: Description: Timeout (in seconds) to execute the Lambda Function. Type: Number Default: 63 TracingMode: Description: Tracing mode for integration with AWS X-Ray if needed. Type: String Default: Active LambdaLayer1: Description: ARNs of the layers that will be applied to the Lambda function, in case you need dependencies. Type: String Default: arn:aws:lambda:eu-west-1:123456789012:layer:LambdaInsightsExtension:10 LambdaLayer2: Description: ARNs of the layers that will be applied to the Lambda function, in case you need dependencies. Type: String Default: arn:aws:lambda:eu-west-1:01234567890:layer:selenium-python-dependencies:12 Resources: LambdaFunction: Type: 'AWS::Lambda::Function' Properties: MemorySize: !Ref LambdaMemory Description: !Ref LambdaDescription TracingConfig: Mode: !Ref TracingMode Timeout: !Ref LambdaTimeout Code: S3ObjectVersion: !Ref LambdaObjectVersion S3Bucket: !Ref LambdaBucket S3Key: !Ref LambdaObject Role: !Ref LambdaRole Handler: !Ref LambdaHandler FunctionName: !Ref LambdaName Runtime: !Ref LambdaRuntime PackageType: "Zip" Layers: - !Ref LambdaLayer1 - !Ref LambdaLayer2
|