Skip to content

Latest commit

 

History

History
69 lines (48 loc) · 2.61 KB

File metadata and controls

69 lines (48 loc) · 2.61 KB

Terraform Deployment

This directory contains Terraform modules and a deployment script for provisioning Azure services in LocalStack for Azure. Refer to the ACI Blob Storage guide for details about the sample application.

Prerequisites

Installing azlocal CLI

pip install azlocal

Architecture Overview

The deploy.sh script first builds and pushes the Docker image to a pre-created ACR, then the main.tf Terraform module creates the following Azure resources:

  1. Azure Storage Account: Provides blob storage for vacation activity data.
  2. Azure Container Instances: Runs the containerized Flask application with public IP and DNS label.

Note: Key Vault is not included in the Terraform deployment as the Azure Terraform provider does not yet support LocalStack's Key Vault URI format. The storage connection string is passed directly to ACI as a secure environment variable.

For more information on the sample application, see ACI Blob Storage.

Configuration

When using LocalStack for Azure, configure the metadata_host and subscription_id settings in the Azure Provider for Terraform:

provider "azurerm" {
  features {
    resource_group {
      prevent_deletion_if_contains_resources = false
    }
  }
  metadata_host="localhost.localstack.cloud:4566"
  subscription_id = "00000000-0000-0000-0000-000000000000"
}

Deployment

cd samples/aci-blob-storage/python
bash terraform/deploy.sh

Cleanup

bash scripts/cleanup.sh

To also clean up Terraform state:

cd terraform
rm -rf .terraform terraform.tfstate terraform.tfstate.backup .terraform.lock.hcl tfplan

Related Documentation