These are the input parameters for this template. All of these parameters must be supplied for this template to be deployed.
The S3 bucket name where the Lambda functions live. This is used to create an IAM access policy to permit the application EC2 instances access to the S3 bucket.
S3 path to the zip file containing the code.
These are all of the resources deployed by this stack.
This function will tag any EC2 instances created via OpsWorks with Tag data from the custom JSON on the parent OpsWorks stack.
Be sure to update the handler with the correct file name and function name!
This 'resource' calls a Lambda function to simply sleep for 30 seconds. This ensures that the LambdaExecutionRole has finished fully being created so that we can then create the lambda function itself.
Create a CloudWatch Log Group for this Lambda function to log to. This allows us to set the retention timeframe.
This is the IAM role that will be used by Lambda when trying to execute this function. Anything the lambda function needs to do with AWS needs to be allowed in here.
This creates a CloudWatch Event Rule to listen for ec2:RunInstance events and then invoke our lambda function.
This allows CloudWatch Events to invoke this lambda function
Output values that can be viewed from the AWS CloudFormation console.
Lambda Function CloudFormation Deployment
This CloudFormation template will deploy a set of Lambda functions to an account.
Note due to timing constraints, all IAM roles required by these functions must be pre-existing. They should be defined in the foundatin-iam portfolio.