Close
logoStacktape docs



Overrides

Overview

Overrides allow you to override properties of Cloudformation resources which are underlying resources to Stacktape resources.

In other words, if needed, you can drop to the lower level of resource configuration below the abstraction Stacktape provides.

Overrides are considered an advanced feature. They should be only used by experienced developers and with caution.

The main concepts of overrides are:

  • Each Stacktape resource specified in the resources section of a template is composed of multiple Cloudformation resources. Using the overrides section of the Stacktape resource, it is possible to access and override the properties of these inner Cloudformation resources.

  • To list all Cloudformation resources contained within a Stacktape resource, use describe-stack command.

Overriding example

Consider the following Stacktape template file named stacktape.yml

  • In the template file, we are using override to change which ECS cluster is used for our container-workload ECS service.

stackName: my-stack
resources:
myContainer:
Type: 'container-workload'
Properties:
containers:
- name: myContainer
imageConfig:
filePath: containers/ts-container.ts
resources:
cpu: 0.25
memory: 512
overrides:
Service:
Cluster: 'my-custom-cluster-to-use'
smallPostgres:
Type: 'relational-database'
Properties:
credentials:
masterUserName: alexandro
masterUserPassword: <<my-secret-pass>>
engine:
type: postgres
properties:
port: 5432
storage:
diskSizeGB: 20
instance:
dbInstanceSize: db.t3.micro

Describe-stack command

describe-stack command:

  • prints an overview of resources specified in the Stacktape template file
  • prints all underlying Cloudformation resources which are part of the Stacktape resources.

Consider the following command.

stacktape describe-stack --stage my-stage --configPath stacktape.yml --region eu-west-1

If we would run the presented command on the template file in overriding example section, the output would look like this.

Output is shortened for the sake of brevity and contains explanations.

OUTPUT:

Output of describe-stack command
Output of describe-stack command

  • The output shows resource myContainer as well as the underlying Cloudformation resources. We can also see the Service Cloudformation resource on which we used an override in overriding example.
  • When referencing a resource in an override, use its descriptive name.
  • To see full reference of the describe-stack command see describe-stack command page.