Cloudformation templates and code to deploy secure AWS Elasticsearch solution
- Create and upload Lambda packages using create_lambda_package.sh
- Deploy CFN, with ARN of Cognito identity auth role
- Go to AWS Console, and configure Cognito auth
- Change the code as needed.
- Go to the 'functions' folder and run command "sam build --template lambda_template.yaml". This will create dir .aws-sam if it does not exist and add the packages there.
- Run the command "sam package --s3-bucket elasticsearch-lambda-functions". This will package the lambda function code along with its dependencies and upload the package to the staging bucket.
- Since the previous step generates a random name, update the names of the deployed function pacakges using CLI. Example: aws s3 mv s3://elasticsearch-lambda-functions/ s3://elasticsearch-lambda-functions/index_data_
- Now, update the name of the lambda function Mapping in the Cloudformation template: Mappings: LambdaFunctionPackage: IndexDataFunction: Package: index_data_9a2b8349d1fd859e394dc43ae8d5d040