Overrides
Introduction
- Stacktape resources are made of multiple different underlying 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
Copy
resources:myFunction:type: functionproperties:packaging:type: stacktape-lambda-buildpackproperties:entryfilePath: 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.
Copy
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.
Copy
resources:myFunction:resourceType: functioncloudformationChildResources:LambdaFunction:cloudformationResourceType: AWS::Lambda::Functionstatus: DEPLOYEDreferenceableParams:- Name- ArnLogGroup:cloudformationResourceType: AWS::Logs::LogGroupstatus: DEPLOYEDreferenceableParams:- Name- ArnlogicalName: DeletePostLambdaLogGroup
Now we can use the descriptive name to override the description of the lambda function.
Copy
resources:myFunction:type: functionproperties:packaging:type: stacktape-lambda-buildpackproperties:entryfilePath: path/to/my/lambda.tsoverrides:LambdaFunction:Description: 'My overriden lambda function description'