Codify assets to Terraform
Codify assets and create reusable code. This code uses resource descriptions instead of resource IDs so that the code can be used in other subnets.
Last updated
Codify assets and create reusable code. This code uses resource descriptions instead of resource IDs so that the code can be used in other subnets.
Last updated
Select Inventory.
Select the asset(s) and Codify > Terraform.
The code describes the configuration of the dependencies rather than referencing the specific ID. The following codification options are available:
Type | Description |
---|---|
Preview represents an experimental version of the codification feature.
Import existing resources into Terraform and bring them under its management.
Import blocks are only available in Terraform v.1.50 or later.
To generate the block for your Terraform code, switch the Import Blocks toggle.
To preview the import plan and generate configuration for your resources, run the terraform plan
command.
Copy the code, and add the block to your Terraform configuration file.
To create the Terraform provider configuration, generate a provider block.
Switch the Provider Block toggle.
Copy the code, and add the block to your Terraform configuration file.
Terraform imports your existing infrastructure resources and brings them under its management. Each remote object must be imported to only one Terraform resource address.
To import the resource into your state file, select >_ Import Commands, and copy or export the code.
Open the Terraform console, and paste the Terraform code into your Terraform file.
Run the command in your Terraform file.
Roll back any asset to a previous revision.
Select Inventory.
To view your assets with a revision history, select Mutations.
Select the asset and Mutations.
To codify the previous revision of the asset, select Codify Revision.
Add your Terraform resources to your integrated version control system (VCS). Resources can be added to an existing file in your VCS by selecting a target branch and file path.
Select Pull request.
Select a VCS Integration.
Select a Repository.
Optional: Select the Target Branch.
Optional: Add a File Path. Select Browse Repository and locate the destination file.
Select Create.
Alternatively, for a link to the Git commit, select the Revision information icon .
Explicit Values
Creates code for one or multiple assets using the resource IDs of dependencies.
Data Sources
Creates code that describes the configuration of the dependencies rather than referencing the explicit resource IDs.
Codify Unmanaged Dependencies
Creates code that codifies all unmanaged dependencies with explicit resource IDs.
Codify All Dependencies
Creates code for the asset and all of its dependencies, including codified dependencies. For unmanaged dependencies, the configuration of the data source is used rather than the explicit resource ID. Use this code to create multiple instances of the same environment. This code can also be used to create a module.
Module Call
Creates code for the asset and all of its dependencies in the private or public module that you specify. Create a separate module call for each asset. The module is used to create additional instances of the asset. The module is stored in the repository that holds your Terraform files. (If your public module is not included in Terraform AWS or GCP modules, contact us, and we will create it for you).
Create Module
Creates a reusable module for any type of asset and its dependencies. The module can be created either from a private module in your Git or from a public module in the Terraform Registry. After creating the module, you can store it in your Git and import the assets. You can deploy this module in any region or account.