Skip to content

Implementation of Azure Resource Manager (azurerm) Backend for Terragrunt's Remote State Management #4307

@raimdev

Description

@raimdev

Summary

The azurerm backend will allow users to leverage the "remote state" feature with Azure storage. This implementation enables the use of the --dependency-fetch-output-from-state option, which significantly improves deployment speed for complex and large infrastructures.

Motivation

As organizations increasingly adopt Azure as their cloud provider, there is a growing need for tools that facilitate infrastructure management in Azure environments. Currently, Terragrunt supports S3 and GCS backends for remote state management, but lacks support for Azure. By implementing an azurerm backend, we can enhance Terragrunt's usability for Azure users, enabling them to manage their Terraform state files more effectively.

Proposal

Implement a remote state backend for azurerm using go-azure-sdk.

Technical Details

The implementation will include the following components:

  • Backend Interface: Implement the backend.Backend interface to ensure compatibility with Terragrunt's existing architecture.
  • Configuration Struct: Define a configuration struct to hold necessary parameters such as storage_account_name, container_name, and key.

The configuration for the azurerm backend will include the following fields:

remote_state {
    backend = "azurerm"
    config = {
        storage_account_name = "mytfstateaccount"
        container_name       = "mytfstatecontainer"
        key                  = "terraform.tfstate"
        use_azuread_auth     = true
        subscription_id      = ""
        tenant_id            = ""
    }
}

Press Release

Terragrunt now supports the Azure backend in remote state configuration, enabling seamless state management for Azure-based infrastructure.

Drawbacks

No response

Alternatives

No response

Migration Strategy

No response

Unresolved Questions

No response

References

No response

Proof of Concept Pull Request

No response

Support Level

  • I have Terragrunt Enterprise Support
  • I am a paying Gruntwork customer

Customer Name

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    azureRelates to Azurepending-decisionPending decision from maintainerspreservedPreserved issues never go stalerfcRequest For Comments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions