Export Your IaC
When you're ready to deploy your infrastructure, StackGen offers two methods for exporting your Infrastructure as Code (IaC) to streamline your workflow. You can either download your IaC in a .zip
file or push it directly to a Git repository.
You can export your IaC in following ways:
Hashicorp configuration language (HCL) is the default format for Infrastructure as Code (IaC) exports, making it easier to maintain consistency, streamline your CI/CD workflows, and support reusability. You’ll see HCL pre-selected in the following scenarios:
- Exporting and deploying built-in resources for AWS, GCP, and Azure.
- Exporting and deploying custom modules.
- Creating
tfvars
with complex types such aslist(map(string))
andlist(string)
. - Pushing IaC exports to GitHub.
If you are an existing customer and would prefer maintaining your .json
file format, please email us at support@stackgen.com, and we can change your preferences from the new default HCL to the previous default JSON.
Download IaC (.zip)
This method is ideal for local deployments or when you need to inspect the generated IaC before pushing it to a version control system.
This method allows you to download the generated IaC for manual deployment.
- In the Topology Canvas, click Export IaC.
- Choose Download as .zip.
- Unzip the file to access your Terraform configuration files.
- Deploy the infrastructure manually using your preferred cloud provider’s CLI or UI.
Push to Git
Ideal for teams leveraging CI/CD to automatically deploy infrastructure changes.
This method enables direct integration with Git, allowing you to automate deployments through CI/CD pipelines.
- In the Topology Canvas, click Export IaC.
- Select Push to Git.
- Enter the Git repository URL and configure the branch.
- Click Push to Git to export the IaC.
Configure Git Repositories for IfC
To use the Push to Git option, your Git repository must be properly configured. Follow these steps to configure your Git provider in StackGen:
- Create or Select a Repository: Ensure the repository exists in GitHub, GitLab, Bitbucket, or other Git providers.
- Set up Branches: Select or create a dedicated branch for IaC management.
- Configure Authentication:
- Use Personal Access Tokens (PATs) for secure API authentication.
- Set up SSH keys for repository access.
- Use OAuth authentication for organization-managed repositories.
- Monitor Commits: Track changes using Git’s version control, ensuring a traceable history of infrastructure modifications.
This streamlined approach helps you efficiently configure, export, and manage their IaC for smooth infrastructure deployment.