logoStacktape docs




Overrides

Introduction

  • Stacktape resources are made of multiple different underyling AWS Cloudformation resources. Overrides allow you to set or override (Cloudformation) properties of these underlying Cloudformation resources.
  • To see the list of and description of all the AWS Cloudformation properties you can configure, refer to AWS Docs

Usage

  • To override the underlying resources, you need a descriptive name of the child resource you want to override. Descriptive names are human-readable names that describe the role of the child resource.
  • To get a list of all the child resources and their descriptive names for the given stacktape configuration, you can use stack-info command.


Let's say we want to override the description of the AWS Lambda resource (Cloudformation type AWS::Lambda::Function) in the following configuration

resources:
myFunction:
type: function
properties:
packageConfig:
filePath: path/to/my/lambda.ts


We can get the descriptive name of the AWS Lambda resource using the stack-info command. We need to specify stage and region - they are needed to get the correct resource names. We also need to use the --detailed flag to get the detailed stack information.

stacktape stack-info --detailed --stage my-stage --region eu-west-1

The (truncated) output will look like this. The descriptive name of the Lambda function resource is highlighted.

resources:
myFunction:
resourceType: function
cloudformationChildResources:
LambdaFunction:
cloudformationResourceType: AWS::Lambda::Function
status: DEPLOYED
referenceableParams:
- Name
- Arn
LogGroup:
cloudformationResourceType: AWS::Logs::LogGroup
status: DEPLOYED
referenceableParams:
- Name
- Arn
logicalName: DeletePostLambdaLogGroup


Now we can use the descriptive name to override the description of the lambda function.

resources:
myFunction:
type: function
properties:
packageConfig:
filePath: path/to/my/lambda.ts
overrides:
LambdaFunction:
Description: 'My overriden lambda function description'