Skip to content

feat(sentinel): implement support for sentinel default variables in module calls#4

Merged
glucaci merged 1 commit into
mainfrom
sentinel
Mar 5, 2026
Merged

feat(sentinel): implement support for sentinel default variables in module calls#4
glucaci merged 1 commit into
mainfrom
sentinel

Conversation

@glucaci
Copy link
Copy Markdown
Member

@glucaci glucaci commented Mar 5, 2026

This pull request adds support for handling "sentinel default" variables in Terraform modules—variables that have a placeholder default value (like "inject-at-runtime") to indicate their true value should be supplied externally (e.g., by a CI/CD pipeline). The new functionality allows these variables to be auto-filled, tracked, and rendered as commented-out entries in emitted .tfvars files, making it clear to users which variables are expected to be provided externally. The documentation, API surface, and tests have all been updated to support and describe this feature.

Sentinel default variable support:

  • Added a FillSentinel method to ModuleCallBuilder that auto-fills variables whose default matches a specified sentinel value, tracks them, and ensures they are rendered as commented-out entries in emitted .tfvars files. [1] [2] [3] [4] [5] [6] [7] [8]
  • Added HasSentinelDefault to TerraformVariable and GetSentinelVariables to TerraformModule to identify and retrieve variables using a sentinel default. [1] [2] [3] [4]

Documentation updates:

  • Updated docs/terraformdotnet.md to document the sentinel default variable feature, including usage examples, API additions, and .tfvars output format. [1] [2] [3]

Testing:

  • Added comprehensive tests for FillSentinel in ModuleCallBuilderTests, covering argument population, skipping of already set variables, exclusion from optional comments, and error handling.

Public API changes:

  • Updated PublicAPI.Shipped.txt to include the new methods and properties for sentinel variable support. [1] [2] [3]

@glucaci glucaci merged commit 833f968 into main Mar 5, 2026
2 checks passed
@glucaci glucaci deleted the sentinel branch March 5, 2026 09:13
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.

1 participant