Octopus - Create Octoterra Space (Azure Backend)

Octopus.TerraformApply exported 2023-12-20 by mcasperson belongs to ‘Octopus’ category.

This step exposes the fields required to create the initial blank space serialized with octoterra using Terraform. The new space is then populated using the Octopus - Populate Octoterra Space (Azure Backend) step.

This step configures a Terraform Azure backend.

It is recommended that this step be run with the octopuslabs/terraform-workertools worker image.

Parameters

When steps based on the template are included in a project’s deployment process, the parameters below can be set.

Octopus Space Name

OctoterraApply.Octopus.Space.NewName = #{Octopus.Deployment.Tenant.Name}

The name of the new space to create. The default value assumes that the step is run against a tenant, and the tenant name matches the space.

Octopus Space Managers

OctoterraApply.Octopus.Space.Managers = teams-administrators

The name of a team to assign as the space manager.

Terraform Workspace

OctoterraApply.Terraform.Workspace.Name = #{OctoterraApply.Octopus.Space.NewName | Replace "[^A-Za-z0-9]" "_"}

The name of the Terraform workspace. This must be unique for every project this module is deployed to. The default value is based on the space ID that the module is applied to: #{OctoterraApply.Octopus.SpaceID}. Leave this as the default value unless you have a specific reason to change it.

Terraform Module Package

OctoterraApply.Terraform.Package.Id =

The package created by octoterra. It must include the space_creation and space_population directories.

Octopus Server URL

OctoterraApply.Octopus.ServerUrl = #{Octopus.Web.ServerUri}

The Octopus server URL.

Octopus API key

OctoterraApply.Octopus.ApiKey =

The Octopus API key. See the documentation for details on creating an API key.

Azure Account Variable

OctoterraApply.Azure.Account =

The Azure account variable.

Azure Backend Resource Group

OctoterraApply.Azure.Storage.ResourceGroup =

The name of the resource group holding the Azure storage account. See the Terraform documentation for details on using Azure storage accounts as a backend.

Azure Storage Account Name

OctoterraApply.Azure.Storage.AccountName =

The name of the Azure storage account used to hold the Terraform state. See the Terraform documentation for details on using Azure storage accounts as a backend.

Azure Storage Container

OctoterraApply.Azure.Storage.Container =

The name of the Azure storage account container used to hold the Terraform state. See the Terraform documentation for details on using Azure storage accounts as a backend.

Azure Storage Key

OctoterraApply.Azure.Storage.Key = Space_#{OctoterraApply.Octopus.Space.NewName | Replace "[^A-Za-z0-9]" "_"}

The file used to hold the Terraform state. See the Terraform documentation for details on using Azure as a backend. The combination of the workspace name and this key must be unique.

The default value is the name of the space and a prefix to indicate the type of resource: Space_#{OctoterraApply.Octopus.Space.NewName | Replace "[^A-Za-z0-9]" "_"}.

Terraform Additional Apply Params

OctoterraApply.Terraform.AdditionalApplyParams =

This field can be used to define additional parameters passed to the terraform apply command. This field can be left blank. See the Terraform documentation for details on the apply command.

Terraform Additional Init Params

OctoterraApply.Terraform.AdditionalInitParams =

This field can be used to define additional parameters passed to the terraform init command. This field can be left blank. See the Terraform documentation for details on the init command.

Script body

Steps based on this template will execute the following undefined script.

undefined

Provided under the Apache License version 2.0.

Report an issue

To use this template in Octopus Deploy, copy the JSON below and paste it into the Library → Step templates → Import dialog.

{
  "Id": "c9c5a6a2-0ce7-4d7a-8eb5-111ac44df24e",
  "Name": "Octopus - Create Octoterra Space (Azure Backend)",
  "Description": "This step exposes the fields required to create the initial blank space serialized with [octoterra](https://github.com/OctopusSolutionsEngineering/OctopusTerraformExport) using Terraform. The new space is then populated using the `Octopus - Populate Octoterra Space (Azure Backend)` step.\n\nThis step configures a Terraform Azure backend.\n\nIt is recommended that this step be run with the `octopuslabs/terraform-workertools` worker image.",
  "Version": 1,
  "ExportedAt": "2023-12-20T22:22:32.372Z",
  "ActionType": "Octopus.TerraformApply",
  "Author": "mcasperson",
  "Packages": [
    {
      "Id": "093b1515-15a9-4446-8dc2-6297018a77e7",
      "Name": "",
      "PackageId": null,
      "FeedId": null,
      "AcquisitionLocation": "Server",
      "Properties": {
        "SelectionMode": "deferred",
        "PackageParameterName": "OctoterraApply.Terraform.Package.Id"
      }
    }
  ],
  "Parameters": [
    {
      "Id": "281f1167-aa9b-4061-9550-2c4a08d20256",
      "Name": "OctoterraApply.Octopus.Space.NewName",
      "Label": "Octopus Space Name",
      "HelpText": "The name of the new space to create. The default value assumes that the step is run against a tenant, and the tenant name matches the space.",
      "DefaultValue": "#{Octopus.Deployment.Tenant.Name}",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "ec7890fd-6a73-49a1-b4c4-f53e5a76e0dd",
      "Name": "OctoterraApply.Octopus.Space.Managers",
      "Label": "Octopus Space Managers",
      "HelpText": "The name of a team to assign as the space manager.",
      "DefaultValue": "teams-administrators",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "ea73512f-aab0-4fdc-8381-ad37a3f31220",
      "Name": "OctoterraApply.Terraform.Workspace.Name",
      "Label": "Terraform Workspace",
      "HelpText": "The name of the Terraform workspace. This must be unique for every project this module is deployed to. The default value is based on the space ID that the module is applied to: `#{OctoterraApply.Octopus.SpaceID}`. Leave this as the default value unless you have a specific reason to change it.",
      "DefaultValue": "#{OctoterraApply.Octopus.Space.NewName  | Replace \"[^A-Za-z0-9]\" \"_\"}",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "d675cd1e-4306-4b8c-91fc-7090377dc34c",
      "Name": "OctoterraApply.Terraform.Package.Id",
      "Label": "Terraform Module Package",
      "HelpText": "The package created by [octoterra](https://github.com/OctopusSolutionsEngineering/OctopusTerraformExport). It must include the `space_creation` and `space_population` directories.",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "Package"
      }
    },
    {
      "Id": "1d039630-0602-4491-b906-e29b45876411",
      "Name": "OctoterraApply.Octopus.ServerUrl",
      "Label": "Octopus Server URL",
      "HelpText": "The Octopus server URL.",
      "DefaultValue": "#{Octopus.Web.ServerUri}",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "0eab90d6-c7a0-482c-a386-e254a477c291",
      "Name": "OctoterraApply.Octopus.ApiKey",
      "Label": "Octopus API key",
      "HelpText": "The Octopus API key. See the [documentation](https://octopus.com/docs/octopus-rest-api/how-to-create-an-api-key) for details on creating an API key.",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "Sensitive"
      }
    },
    {
      "Id": "dd0fe15d-c377-45d2-86b8-61d326e7e411",
      "Name": "OctoterraApply.Azure.Account",
      "Label": "Azure Account Variable",
      "HelpText": "The Azure account variable.",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "AzureAccount"
      }
    },
    {
      "Id": "9442e8fb-056b-4a24-a129-adfe9726ea8d",
      "Name": "OctoterraApply.Azure.Storage.ResourceGroup",
      "Label": "Azure Backend Resource Group",
      "HelpText": "The name of the resource group holding the Azure storage account. See the [Terraform documentation](https://developer.hashicorp.com/terraform/language/settings/backends/azurerm) for details on using Azure storage accounts as a backend.",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "d3098333-99ac-463f-83eb-f66aca3d1055",
      "Name": "OctoterraApply.Azure.Storage.AccountName",
      "Label": "Azure Storage Account Name",
      "HelpText": "The name of the Azure storage account used to hold the Terraform state. See the [Terraform documentation](https://developer.hashicorp.com/terraform/language/settings/backends/azurerm) for details on using Azure storage accounts as a backend.",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "514db3ac-89a7-4537-abfc-cf7bf7c6ac8c",
      "Name": "OctoterraApply.Azure.Storage.Container",
      "Label": "Azure Storage Container",
      "HelpText": "The name of the Azure storage account container used to hold the Terraform state. See the [Terraform documentation](https://developer.hashicorp.com/terraform/language/settings/backends/azurerm) for details on using Azure storage accounts as a backend.",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "e34b942b-f99b-48d1-9989-6810a2d0a71b",
      "Name": "OctoterraApply.Azure.Storage.Key",
      "Label": "Azure Storage Key",
      "HelpText": "The file used to hold the Terraform state. See the [Terraform documentation](https://developer.hashicorp.com/terraform/language/settings/backends/azurerm) for details on using Azure as a backend. The combination of the workspace name and this key must be unique. \n\nThe default value is the name of the space and a prefix to indicate the type of resource: `Space_#{OctoterraApply.Octopus.Space.NewName | Replace \"[^A-Za-z0-9]\" \"_\"}`.",
      "DefaultValue": "Space_#{OctoterraApply.Octopus.Space.NewName | Replace \"[^A-Za-z0-9]\" \"_\"}",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "05715061-fda9-48b1-8bec-960b9fa56e89",
      "Name": "OctoterraApply.Terraform.AdditionalApplyParams",
      "Label": "Terraform Additional Apply Params",
      "HelpText": "This field can be used to define additional parameters passed to the `terraform apply` command. This field can be left blank. See the [Terraform documentation](https://developer.hashicorp.com/terraform/cli/commands/apply) for details on the `apply` command.",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "e6ffdabd-5009-4e55-aab8-eeafc2291e47",
      "Name": "OctoterraApply.Terraform.AdditionalInitParams",
      "Label": "Terraform Additional Init Params",
      "HelpText": "This field can be used to define additional parameters passed to the `terraform init` command. This field can be left blank.  See the [Terraform documentation](https://developer.hashicorp.com/terraform/cli/commands/init) for details on the `init` command.",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    }
  ],
  "Properties": {
    "Octopus.Action.GoogleCloud.UseVMServiceAccount": "False",
    "Octopus.Action.GoogleCloud.ImpersonateServiceAccount": "False",
    "Octopus.Action.Terraform.GoogleCloudAccount": "False",
    "Octopus.Action.Terraform.AzureAccount": "True",
    "Octopus.Action.Terraform.ManagedAccount": "None",
    "Octopus.Action.Terraform.AllowPluginDownloads": "True",
    "Octopus.Action.Script.ScriptSource": "Package",
    "Octopus.Action.Terraform.RunAutomaticFileSubstitution": "False",
    "Octopus.Action.Terraform.PlanJsonOutput": "False",
    "Octopus.Action.Terraform.Workspace": "#{OctoterraApply.Terraform.Workspace.Name}",
    "Octopus.Action.Terraform.AdditionalInitParams": "-backend-config=\"resource_group_name=#{OctoterraApply.Azure.Storage.ResourceGroup}\" -backend-config=\"storage_account_name=#{OctoterraApply.Azure.Storage.AccountName}\" -backend-config=\"container_name=#{OctoterraApply.Azure.Storage.Container}\" -backend-config=\"key=#{OctoterraApply.Azure.Storage.Key}\" #{if OctoterraApply.Terraform.AdditionalInitParams}#{OctoterraApply.Terraform.AdditionalInitParams}#{/if}",
    "Octopus.Action.Terraform.AdditionalActionParams": "-var=octopus_server=#{OctoterraApply.Octopus.ServerUrl} -var=octopus_apikey=#{OctoterraApply.Octopus.ApiKey} \"-var=octopus_space_name=#{OctoterraApply.Octopus.Space.NewName}\" -var=octopus_space_managers=#{OctoterraApply.Octopus.Space.Managers} #{if OctoterraApply.Terraform.AdditionalApplyParams}#{OctoterraApply.Terraform.AdditionalApplyParams}#{/if}",
    "Octopus.Action.Package.DownloadOnTentacle": "False",
    "Octopus.Action.RunOnServer": "true",
    "Octopus.Action.AwsAccount.UseInstanceRole": "False",
    "Octopus.Action.Aws.AssumeRole": "False",
    "Octopus.Action.Terraform.TemplateDirectory": "space_creation",
    "Octopus.Action.AzureAccount.Variable": "OctoterraApply.Azure.Account"
  },
  "Category": "Octopus",
  "HistoryUrl": "https://github.com/OctopusDeploy/Library/commits/master/step-templates//opt/buildagent/work/75443764cd38076d/step-templates/octopus-create-octoterra-space-azure.json",
  "Website": "/step-templates/c9c5a6a2-0ce7-4d7a-8eb5-111ac44df24e",
  "Logo": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAC1QTFRFT6Tl////L5Pg8vj9Y67omsvwPJrisdfzfbzs5fL7y+T32Ov5isLucLXqvt31CJPHWwAABMJJREFUeNrs3deW4jAMAFDF3U75/89dlp0ZhiU4blJEjvQ8hYubLJsA00UCBCIQgQhEIAIRiEAEIhCBCEQgAhGIQAQiEIEIhD8kJm+t+QprfdKfB9HbYpx6CWfspj8HMi+gMgHL/AmQA8W3JTKH+ALFvzCeL0RbpyoCPE9IJeNOSQwh5Z3qd6yRGWQ2qi2cZQWxqj1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HF0Vnp88JKienzIXLSEZCZqU7IKr/gQW9yx3pzV7Y9kvWZWTRRIqDmTtRUnU7b2lLcTYmoqHqnmiO1poER0SPkAeZMAZxaJx0Y3TCdAclsIqDz03ALcyxfTCZBsthoGXWmigGyVhWPLFJJfuuKQWycoEFdXbH4dJJoJxNR1eD/kshz6yn48cF8yW8sFoitflB1w6Q8n+/15Za7oA17/pYNmYgP5fmWm8L1NOHPWgK8kuFew1/JXtOA0yJCv7ah7X8ObUuT5kObU30+fDZm8+zqP+HTIpK0xQ796b5Kv2hSIQAQiEIEIRCACEYhABCIQgQhEIAIRiEAEIpBf8UeAAQAEjtYmlDTcCgAAAABJRU5ErkJggg==",
  "$Meta": {
    "Type": "ActionTemplate"
  }
}

History

Page updated on Wednesday, December 20, 2023