microsoft / microsoft/AzureTRE
Access Terraform outputs in bundle template pipelines before Main step
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 235
- Forks
- 192
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 13
Description
Is your feature request related to a problem? Please describe.
While looking into #2811 and the bug that was causing Nexus bootstrapping to fail, it was found that because the Firewall step was occurring after the Main bundle step in the template_schema pipeline, the necessary firewall rules weren't in place for the bundle to deploy Nexus successfully.
After moving the Firewall step to before the Main bundle, there were then missing resource properties that were previously derived from Terraform outputs from the main step (such as the SHARED_ADDRESS_PREFIXES). The API has no way of accessing properties like this (address spaces from the core network for example) without the main bundle being ran first to output properties from Terraform and mapping them to bundle resource properties. This means that we can't apply Firewall steps that a bundle might need as a pre-requisite, if they contain dynamic values.
Describe the solution you'd like
A potential solution could be adding a "Load properties" step that bundles can invoke in the template pipeline, accepting a map of properties to retrieve, which runs terraform and populates the resource properties that are then needed by the subsequent firewall or other pre-requisite steps before the main bundle.
Alternatively, we could introduce another keyword (the pipeline currently looks for handlebars and then "resource" to fetch properties from the bundle resource) called environment or outputs which could request a property from terraform, which the API would then retrieve whenever this keyword is detected with a valid reference to a terraform output.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by tracing the template_schema pipeline, especially the Main and Firewall steps, and the existing handlebars/resource property lookup. Compare Terraform output mapping with the proposed Load properties step or environment/outputs reference, then define how dynamic values become available before Main and how Nexus bootstrapping can be verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, terraform
- Domain
- backend-api-design, cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100