Stacktape
Stacktape


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 MySnsTopic receives a failure message from processData.
  • slackNotify: A function that is invoked when MySnsTopic receives a failure message from processData and sends a notification to Slack.
cloudformationResources:
MySnsTopic:
Type: AWS::SNS::Topic
resources:
processData:
type: 'function'
properties:
packaging:
type: stacktape-lambda-buildpack
properties:
entryfilePath: lambdas/process.ts
destinations:
onFailure: $CfResourceParam('MySnsTopic', 'Arn')
analyzeError:
type: 'function'
properties:
packaging:
type: stacktape-lambda-buildpack
properties:
entryfilePath: lambdas/analysis.ts
events:
- type: sns
properties:
topicArn: $CfResourceParam('MySnsTopic', 'Arn')
slackNotify:
type: 'function'
properties:
packaging:
type: stacktape-lambda-buildpack
properties:
entryfilePath: lambdas/notify.ts
events:
- type: sns
properties:
topicArn: $CfResourceParam('MySnsTopic', 'Arn')

Contents

  •  Example