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
resourcessection of a template is composed of multiple Cloudformation resources. Using the
overridessection 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.
Consider the following Stacktape template file named
- In the template file, we are using override to change which ECS cluster is used for our
stackName: my-stackresources:myContainer:Type: 'container-workload'Properties:containers:- name: myContainerimageConfig:filePath: containers/ts-container.tsresources:cpu: 0.25memory: 512overrides:Service:Cluster: 'my-custom-cluster-to-use'smallPostgres:Type: 'relational-database'Properties:credentials:masterUserName: alexandromasterUserPassword: <<my-secret-pass>>engine:type: postgresproperties:port: 5432storage:diskSizeGB: 20instance:dbInstanceSize: db.t3.micro
- 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.
- The output shows resource
myContaineras well as the underlying Cloudformation resources. We can also see the
ServiceCloudformation 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.