AWS CloudFormation Resources
You can use the cloudformationResources section of your stacktape.yml file to extend your Stacktape template with native Cloudformation resources. This allows you to configure, manage, and interconnect Cloudformation resources with other resources in your stack, giving you the full power of AWS in a single configuration file.
Example
The following example shows a Stacktape template that includes a Cloudformation SNS topic. The infrastructure includes:
- MySnsTopic: An SNS topic that acts as a communicator between functions (a Cloudformation resource).
- processData: A function that processes data. If it fails, a message is sent to
MySnsTopic. - analyzeError: A function that is invoked when
MySnsTopicreceives a failure message fromprocessData. - slackNotify: A function that is invoked when
MySnsTopicreceives a failure message fromprocessDataand sends a notification to Slack.
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')