Firefly Documentation Portal
  • Welcome to the Documentation Portal
  • Contacting Firefly support
  • User Guides
    • QuickStart Guide
      • Onboarding
      • Dashboard
      • FAQ
      • Glossary
        • IaC status
    • Exploring the Inventory
    • Compose: Generating new configuration
    • Navigating the IaC Explorer
    • Workflows
      • Guardrails
    • Integrations
      • Integrate your providers and tools
        • Integrate your data sources
          • Integrate PagerDuty
          • Integrate MongoDB Atlas
          • Integrate AWS
            • Integrate AWS using Terraform
            • Integrate AWS using CloudFormation
            • Upgrading AWS integration to event-driven
            • AWS Discovery Status
          • Integrate Google Cloud
            • Integrate Google Cloud using a service account key
            • Integrate Google Cloud using Terraform
            • Google Cloud Discovery Status
          • Integrate Kubernetes
          • Integrate Datadog
          • Integrate New Relic
          • Integrate Okta
          • Integrate GitHub service
          • Integrate Cloudflare
          • Integrate NS1
          • Integrate Microsoft Azure
            • Integrate Microsoft Azure using Terraform
            • Azure Discovery Status
          • Integrate HashiCorp Vault
        • Integrate your IaC remote states
          • Integrate Terraform Cloud
          • Integrate Terraform Enterprise
          • Integrate HashiCorp Consul
          • Integrate remote stacks in Google Cloud Storage
          • Integrate env0
        • Integrate your version control system
          • Integrate GitHub
          • Integrate GitLab
          • Integrate Bitbucket
            • Integrate Bitbucket Data Center
            • Integrate Bitbucket Cloud
          • Integrate AWS CodeCommit
          • Integrate Azure DevOps
        • Send Firefly notifications to your messaging tools
          • Send Firefly notifications to Slack
            • Send notifications to Slack using the Slack App
            • Sending notifications to Slack using a webhook
          • Send Firefly notifications to Microsoft Teams
          • Send Firefly notifications to Torq
          • Send Firefly notifications to webhooks
          • Send Firefly notifications to Opsgenie
          • Send Firefly notifications to PagerDuty
            • Integration Key
            • General Access REST API Key
          • Send Firefly notifications to Google Chat
        • Integrate project management tools
          • Integrate Jira
    • Governance
    • Event-Center
    • How-to Guides
      • Manage assets
        • Codify assets
          • Codify assets to Config Connector
          • Codify assets to Manifest
          • Codify assets to Helm
          • Codify assets to CDK8S
          • Codify assets to Terraform
          • Codify assets to Pulumi
          • Codify assets to CloudFormation
          • Codify assets to CDK
          • Codify assets to Crossplane
          • Codify assets to Ansible
        • Delete unmanaged assets
        • Fix drifts
        • Remove asset Terraform code
        • Excluded drifts
        • IaC-Ignored assets
      • Monitor events
      • Manage notifications
      • Manage user roles
    • Deep Dive articles
      • Disaster recovery
      • Drifts
      • Codification
      • Notifications
      • Governance
      • Event-driven
      • IaC-Ignored assets
  • Appendix
    • Migrating CloudFormation resources to Terraform
    • Terraform Cloud Run Tasks
    • Creating a key pair
    • SSO Configuration
    • Firefly API Documentation
    • Support Matrix
    • Data privacy and AI usage
  • Firefly MCP
  • Firefly Backstage Plugin
Powered by GitBook
On this page
  • Procedure
  • Generating Import Blocks
  • Generating Provider Blocks
  • Using the Terraform import command
  • Codify Revision
  • Procedure
  • Creating a pull request

Was this helpful?

  1. User Guides
  2. How-to Guides
  3. Manage assets
  4. Codify assets

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.

Procedure

  1. Select Inventory.

  2. 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

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

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.

Preview represents an experimental version of the codification feature.

Generating Import Blocks

Import existing resources into Terraform and bring them under its management.

Import blocks are only available in Terraform v.1.50 or later.

Procedure

  1. To generate the block for your Terraform code, switch the Import Blocks toggle.

  2. To preview the import plan and generate configuration for your resources, run the terraform plan command.

  3. Copy the code, and add the block to your Terraform configuration file.

Generating Provider Blocks

To create the Terraform provider configuration, generate a provider block.

Procedure

  1. Switch the Provider Block toggle.

  2. Copy the code, and add the block to your Terraform configuration file.

Using the Terraform import command

Terraform imports your existing infrastructure resources and brings them under its management. Each remote object must be imported to only one Terraform resource address.

Procedure

  1. To import the resource into your state file, select >_ Import Commands, and copy or export the code.

  2. Open the Terraform console, and paste the Terraform code into your Terraform file.

  3. Run the command in your Terraform file.

Codify Revision

Roll back any asset to a previous revision.

Procedure

  1. Select Inventory.

  2. To view your assets with a revision history, select Mutations.

  3. Select the asset and Mutations.

  4. To codify the previous revision of the asset, select Codify Revision.

Creating a pull request

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.

Procedure

  1. Select Pull request.

  2. Select a VCS Integration.

  3. Select a Repository.

    • Optional: Select the Target Branch.

    • Optional: Add a File Path. Select Browse Repository and locate the destination file.

  4. Select Create.

PreviousCodify assets to CDK8SNextCodify assets to Pulumi

Last updated 9 months ago

Was this helpful?

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, , and we will create it for you).

Alternatively, for a link to the Git commit, select the Revision information icon .

contact us