Skip to content

Add support for CloudFormationTemplate Parameter Overrides - #2071

Merged
zentron merged 11 commits into
mainfrom
robe/cloudformation-parameter-overrides
Jul 23, 2026
Merged

Add support for CloudFormationTemplate Parameter Overrides#2071
zentron merged 11 commits into
mainfrom
robe/cloudformation-parameter-overrides

Conversation

@zentron

@zentron zentron commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Background

CloudFormationTemplates currently don't allow passing through parameter overrides directly and instead a parameter json file must be provided. This is unwieldy when just a few simple parameters need to be supplied and you dont want to have to create an Octopus specific template file.

Result

A new Octopus.Action.Aws.CloudFormationTemplateParameterOverrides variable can be provided as a key-value array of properties to be passed down into the final invocation.

@zentron zentron changed the title Robe/cloudformation parameter overrides Add support for CloudFormationTemplate Parameter Overrides Jul 16, 2026
@zentron
zentron marked this pull request as ready for review July 16, 2026 10:48
zentron added 9 commits July 16, 2026 20:48
Outlines allowing key/value CloudFormation stack parameters to be
supplied directly (merged over the existing file/S3 mechanisms)
instead of always requiring a parameters file.
Costs nothing extra on the Calamari side since Inline already shares
the same merge point as Package/GitRepository, and it keeps the
feature consistent across all template sources.
…ameters

Adds Octopus.Action.Aws.CloudFormationTemplateParameterOverrides, read in
DeployCloudFormationCommand.Execute and merged into CloudFormationTemplate.Create's
file-based parameters via CloudFormationParameterMerge. Also fixes two other
CloudFormationTemplate constructor call sites broken by the inputs parameter
type change (ITemplateInputs<Parameter> -> IEnumerable<Parameter>).
…eters

Wires Octopus.Action.Aws.CloudFormationTemplateParameterOverrides through
CloudFormationS3Template.Create, the S3 template-source path used when
templateS3Url is set.
Both wrapper types were left with no callers after their two call sites
were updated to pass IEnumerable<Parameter> directly instead of an
ITemplateInputs<Parameter> wrapper.
@zentron
zentron force-pushed the robe/cloudformation-parameter-overrides branch from 8d55107 to d212888 Compare July 16, 2026 10:48
@zentron
zentron requested a review from Copilot July 16, 2026 21:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new way to supply CloudFormation parameter overrides directly (via Octopus.Action.Aws.CloudFormationTemplateParameterOverrides) and merges those overrides with any parameters loaded from the existing parameters file/URL, so users don’t need to create a separate parameters file for small changes.

Changes:

  • Introduces CloudFormationParameterMerge and applies it in both file-based and S3-based CloudFormation template builders.
  • Wires a new special variable (Octopus.Action.Aws.CloudFormationTemplateParameterOverrides) through DeployAwsCloudFormationCommand into template creation.
  • Refactors CloudFormation template constructors/call sites to accept IEnumerable<Parameter> directly and adds test coverage for merge behavior.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
source/Calamari.Tests/AWS/CloudFormation/CloudFormationTemplateFixture.cs Adds tests verifying overrides merge over parameters loaded from a file.
source/Calamari.Tests/AWS/CloudFormation/CloudFormationS3TemplateFixture.cs Adds test verifying S3 template creation uses overrides when no parameters URL is provided.
source/Calamari.Tests/AWS/CloudFormation/CloudFormationParameterMergeFixture.cs Adds focused unit tests for merge semantics (replace/append/empty cases).
source/Calamari.Common/Util/ITemplate.cs Removes unused template input/output helper types from common utilities.
source/Calamari.Aws/Integration/Ecs/Deploy/EcsDeployParameterGeneration.cs Removes ListTemplateInputs<T> helper now that templates accept IEnumerable<Parameter>.
source/Calamari.Aws/Integration/CloudFormation/Templates/CloudFormationTemplate.cs Adds override parameter input and merges overrides with file parameters before building requests.
source/Calamari.Aws/Integration/CloudFormation/Templates/CloudFormationS3Template.cs Adds override parameter input and merges overrides with downloaded parameters before building requests.
source/Calamari.Aws/Integration/CloudFormation/Templates/CloudFormationParameterMerge.cs New helper to merge primary parameters with override parameters.
source/Calamari.Aws/Deployment/Conventions/DeployEcsServiceConvention.cs Updates ECS deployment convention to pass parameters directly as IEnumerable<Parameter>.
source/Calamari.Aws/Deployment/AwsSpecialVariables.cs Adds new TemplateParameterOverrides special variable constant.
source/Calamari.Aws/Commands/DeployAwsCloudFormationCommand.cs Reads override parameters from variables and passes them to template creation.
source/Calamari.Aws/Commands/CreateAwsS3Command.cs Replaces EmptyTemplateInputs<Parameter> with Enumerable.Empty<Parameter>().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zentron
zentron force-pushed the robe/cloudformation-parameter-overrides branch from 1c36f2d to 2823240 Compare July 23, 2026 00:26

@liam-mackie liam-mackie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor nits but should be fine!

@zentron
zentron enabled auto-merge (squash) July 23, 2026 12:10
@zentron
zentron merged commit 9403d64 into main Jul 23, 2026
35 checks passed
@zentron
zentron deleted the robe/cloudformation-parameter-overrides branch July 23, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants