Skip to content

Latest commit

 

History

History
127 lines (105 loc) · 12.7 KB

File metadata and controls

127 lines (105 loc) · 12.7 KB

Terraform configuration for deploying to Microsoft Azure

Specific cloud prerequisites

Before deploying your extension app on Azure, complete the following setup steps:

  1. Sign up for an Azure Free Account (if you don’t already have one).

  2. Configure Azure CLI: Install and configure the Azure CLI to interact with your Azure account. You can follow the instructions here.

  3. Authenticate Azure CLI: Log in to your Azure account using the Azure CLI:

    az login
  4. Set Subscription: Set the Azure subscription you want to use:

    az account set --subscription "your-subscription-id"

    It's also necessary to set the Azure subscription when running the azurerm Terraform provider with version 4.0 or above. This can be done by specifying the subscription_id Terraform variable or by exporting the ARM_SUBSCRIPTION_ID environment variable. For instance,

    export ARM_SUBSCRIPTION_ID="your-subscription-id"
  5. Make sure you have the correct permissions Terraform needs sufficient permissions to create resources. Make sure your Azure user has the Contributor role:

    az role assignment list --assignee <your-email> --output table

    If needed, assign the correct role:

    az role assignment create --assignee <your-email> --role "Contributor" --scope "/subscriptions/your-subscription-id"

In that case azurerm Terraform provider is authenticated to Azure using the Azure CLI, but you may use other methods for authenticating to Azure.

Now that you’ve set up your Azure environment, continue with the Terraform deployment guide to provision your infrastructure.

Requirements

Name Version
terraform >= 1.0.0, < 2.0.0
azurerm ~> 4.16
docker ~> 3.0
local ~> 2.5
random ~> 3.6
time ~> 0.12

Providers

Name Version
azurerm ~> 4.16
random ~> 3.6
terraform n/a

Modules

Name Source Version
generate_authorization_code ../common/modules/generate n/a
generate_jwt_secret_key ../common/modules/generate n/a
generate_oauth_client_id ../common/modules/generate n/a
generate_oauth_client_secret ../common/modules/generate n/a
image ../common/modules/docker n/a
manifest ../common/modules/template n/a

Resources

Name Type
azurerm_container_registry.this resource
azurerm_linux_web_app.this resource
azurerm_resource_group.this resource
azurerm_role_assignment.pull_image resource
azurerm_service_plan.this resource
random_id.container_registry resource
random_id.web_app resource
terraform_data.login_container_registry resource
terraform_data.push_docker_image resource
azurerm_subscription.current data source

Inputs

Name Description Type Default Required
application_authorization_code The authorization code for the application. If empty, a random code will be generated. string "" no
application_build_base_image_name The name of the base image to use for the application build string "node:lts-alpine" no
application_build_context The relative path to the build context for the application. The build context is the directory from which the Dockerfile is read. If it is empty the current working directory will be used. string "../.." no
application_build_image_tag The tag to apply to the application build image. If empty the timestamp tag will be used. string "" no
application_build_labels The labels to apply to the application build image map(string)
{
"org.opencontainers.image.authors": "DocuSign Inc.",
"org.opencontainers.image.description": "This reference implementation models the implementation of connected fields functionalities in an extension app.",
"org.opencontainers.image.licenses": "MIT",
"org.opencontainers.image.source": "https://github.com/docusign/extension-app-connected-fields-reference-implementation",
"org.opencontainers.image.title": "Connected Fields Extension App Reference Implementation",
"org.opencontainers.image.vendor": "DocuSign Inc."
}
no
application_build_paths Paths of files relative to the build context, changes to which lead to a rebuild of the image. Supported pattern matches are the same as for the fileset Terraform function (https://developer.hashicorp.com/terraform/language/functions/fileset). list(string)
[
"public/",
"src/
",
"views/**",
"package.json",
"tsconfig.json",
"Dockerfile",
".dockerignore"
]
no
application_environment_mode The environment mode for the application string "production" no
application_jwt_secret_key The secret key to use for signing JWT tokens. If empty, a random key will be generated. string "" no
application_name The name of the application string "extension-app-data-io" no
application_oauth_client_id The OAuth client ID for the application. If empty, a random client ID will be generated. string "" no
application_oauth_client_secret The OAuth client secret for the application. If empty, a random client secret will be generated. string "" no
application_port The port the application listens on number 3000 no
application_service_plan_name The name of the application service plan. If it is not defined, the prefixed application name will be used string null no
application_service_plan_sku_name The SKU name of the application service plan string "F1" no
application_service_plan_worker_count The number of workers to allocate for the application service plan number 1 no
application_webapp_name The name of the application web app. If it is not defined, the prefixed application name will be used string null no
container_registry_name The name of the container registry. If it is not defined, the prefixed application name will be used string null no
container_registry_sku The SKU of the container registry string "Basic" no
container_tool The container tool to use for building and pushing images string "docker" no
do_enable_admin_access Whether to enable admin access to the container registry bool true no
do_randomize_resource_names Whether to randomize the resource names that should be globally unique bool true no
docker_host The Docker host (e.g. 'tcp://127.0.0.1:2376' or 'unix:///var/run/docker.sock') to connect to. If empty, the default Docker host will be used string null no
is_application_webapp_always_on Whether the application web app should always be on bool false no
location The location/region where the resources will be created string "West Europe" no
manifest_files_paths The list of manifest files relative paths to generate list(string)
[
"../../manifest.json"
]
no
output_manifest_files_directory The directory to output the generated manifest files string ".terraform" no
resource_group_name The name of the resource group. If it is not defined, the prefixed application name will be used string null no
subscription_id The Azure subscription ID string null no
tags A map of the tags to apply to various resources map(string) {} no
tenant_id The Azure tenant ID string null no

Outputs

Name Description
application_service_url The base URL of the application service
output_manifest_files_paths The absolute paths to the output manifest files