This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Lambda function deployed by the stack | |
| MyLambdaFunction: | |
| DependsOn: | |
| - CopyZips | |
| Type: AWS::Lambda::Function | |
| Properties: | |
| Description: 'Lambda function to index data to ES when object is added to S3' | |
| Handler: my_lambda.lambda_handler | |
| Runtime: python2.7 | |
| Role: !GetAtt 'MyLambdaFunctionRole.Arn' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Custom Resource: Used to copy all specified lambda zip packages in the 'Objects' list to the LambdaZipsBucket | |
| CopyZips: | |
| Type: Custom::CopyZips | |
| Properties: | |
| ServiceToken: !GetAtt 'CopyZipsFunction.Arn' | |
| DestBucket: !Ref 'LambdaZipsBucket' | |
| SourceBucket: !Ref 'LambdaSourceBucket' | |
| Prefix: !Ref 'LambdaSourceBucketPrefix' | |
| Objects: | |
| - !Ref 'LambdaFunctionPackage' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # INSTRUCTIONS TO RUN: | |
| # 1 --> copy this script to centos machine | |
| # 2 --> chmod 775 script_name.sh | |
| # 3 --> ./script_name.sh | |
| function log() { | |
| echo "$( date '+[%F_%T]' )" "${HOSTNAME}:" "${LOG_PREFIX}:" "$@" | |
| } |