Stacktape

Sign up



Cloudformation Resources

Overview and basic concepts

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 failue.
  • slackNotify - function - is invoked once MySnsTopic receives failure message from processData and sends notification about the failure.

Copy

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')

Need help? Ask a question on SlackDiscord or info@stacktape.com.