AWS CloudFormation resources
Overview
AWS Cloudformation configuration is AWS's native way to manage infrastructure as a code.
In Stacktape, you can use the cloudformationResources
section to extend your Stacktape template with AWS
Cloudformation resources. This enables you to easily configure, manage and interconnect Cloudformation resources with
other resources of your stack. As a result, you are able to leverage full power of AWS in a single unit
configuration.
Usage
Example
The following example shows a Stacktape template with CloudFormation SNS topic resource (SNS is AWS managed messaging service).
Infrastructure includes:
- MySnsTopic - SNS topic - used as communicator between functions (Cloudformation resource)
- processData - function - processing function. If failure occurs, message is sent into MySnsTopic
- analyzeError - function - is invoked once MySnsTopic receives failure message from processData and analyzes the failure.
- slackNotify - function - is invoked once MySnsTopic receives failure message from processData and sends notification about the failure.
Copy
cloudformationResources:MySnsTopic:Type: AWS::SNS::Topicresources:processData:type: 'function'properties:packaging:type: stacktape-lambda-buildpackproperties:entryfilePath: lambdas/process.tsdestinations:onFailure: $CfResourceParam('MySnsTopic', 'Arn')analyzeError:type: 'function'properties:packaging:type: stacktape-lambda-buildpackproperties:entryfilePath: lambdas/analysis.tsevents:- type: snsproperties:topicArn: $CfResourceParam('MySnsTopic', 'Arn')slackNotify:type: 'function'properties:packaging:type: stacktape-lambda-buildpackproperties:entryfilePath: lambdas/notify.tsevents:- type: snsproperties:topicArn: $CfResourceParam('MySnsTopic', 'Arn')