Infrastructure as Code (IaC) Templates
This guide explains how Infrastructure as Code (IaC) templates work in DevPortal, enabling your team to provision infrastructure through a self-service scaffolder workflow rather than running tools manually.
Step 1: Understand the Basics
IaC templates in DevPortal are scaffolder templates (like software templates) that generate infrastructure repositories — typically containing Terraform, CloudFormation, Pulumi, or similar IaC files. Provisioning happens through the CI/CD pipeline that the template wires up, not by the developer running infrastructure tools locally.
The typical flow is:
- Developer fills in the template form (resource sizes, region, network settings, etc.).
- The scaffolder creates a new repository with the IaC configuration files.
- A CI/CD pipeline (GitHub Actions, GitLab CI, etc.) is triggered and runs the infrastructure tool (e.g.,
terraform apply). - The resulting infrastructure resource is registered in the catalog as a
Resourceentity.
Step 2: Access Available Templates
- Log in to your Developer Portal.
- Navigate to the Templates Page and explore the list of preconfigured IaC templates available.
Step 3: Select the Appropriate Template
- Review the available templates and select the one that aligns with your project needs.
- Consider resource types (e.g., virtual machines, storage), deployment scale, and additional infrastructure requirements.
Step 4: Customize the Template
- Read the documentation associated with the chosen template.
- Fill in the form parameters, which typically include:
- Resource sizes: CPU, memory, or storage requirements.
- Network configurations: subnets, routing, and security rules.
- Security settings: permissions or encryption protocols.
- Repository settings: provider, owner, repository name, visibility.
Step 5: Create and Monitor the Pipeline
- Review all inputs on the Overview Page and click "Create".
- The scaffolder creates the IaC repository and triggers the CI/CD pipeline.
- Monitor the creation log in the DevPortal scaffolder UI for real-time updates.
- Once the pipeline completes, the infrastructure resource may be registered in the catalog automatically (depending on the template) or require manual registration.
You do not need to run terraform apply, aws cloudformation deploy, or any other infrastructure CLI locally. The CI/CD pipeline configured by the template handles deployment in your target environment.
Step 6: Validate the Infrastructure
- Verify that the deployed infrastructure matches your requirements.
- Test the environment for functionality, security, and stability using your standard validation tooling.
Tips for Using IaC Templates
- Leverage Version Control: All IaC files are stored in Git — use PRs and code review for infrastructure changes.
- Promote Collaboration: Developers and operations teams co-own the generated repository.
- Document Changes: The catalog entity for the resource tracks ownership and metadata; keep it updated.
Benefits of IaC Templates
- Consistency: Eliminate configuration drift by ensuring uniform deployments.
- Scalability: Easily replicate infrastructure to meet growing demands.
- Self-Service: Developers can provision infrastructure without waiting for manual ops work.
By adopting IaC templates, you enable your team to create and manage infrastructure efficiently through the portal, with CI/CD as the enforcement layer.
IaC templates in the composition model
An IaC template execution produces the same catalog artifacts as a software template: a repository, a catalog-info.yaml, and a registered Location entity — except the entity kind is Resource rather than Component. That resource entity appears in the catalog, carries ownership metadata, and can have annotations that attach it to observability plugins (Grafana dashboards scoped to the provisioned infrastructure, for example).
The resource entity is the catalog's representation of the infrastructure. It is queryable via the Relations API, visible on dependency graphs, and subject to the same RBAC rules as any other entity.
Template-of-templates: app + infra as a single Golden Path
An IaC template can be a step inside a software template. The software template orchestrates both: it scaffolds the application repository and invokes the IaC template (or an equivalent scaffolder action) to provision the required infrastructure in the same workflow. The developer fills in one form; both a Component entity and a Resource entity emerge, linked via the dependsOn relation in catalog-info.yaml.
This is the mechanism behind a complete Golden Path: the template encodes the organization's standard for what a production-ready service looks like — application code, CI/CD configuration, and infrastructure — as a single self-service operation.
For the three-layer model that governs how the resulting entities connect to plugins, see Composing a Portal. For the software template side of this pattern, see Software Templates.
For further assistance, refer to your platform's documentation or contact us.