scalr_module

Resource: scalr_module

Manages the state of a module in the Private Modules Registry. Create and destroy operations are available only.

Example Usage

resource "scalr_module" "example" {
  account_id      = "acc-xxxxxxxxxx"
  environment_id  = "env-xxxxxxxxxx"
  vcs_provider_id = "vcs-xxxxxxxxxx"
  vcs_repo {
    identifier = "org/repo"
    path       = "example/terraform-<provider>-<name>"
    tag_prefix = "aws/"
  }
}

Schema

Required

  • vcs_provider_id (String) The identifier of a VCS provider in the format vcs-<RANDOM STRING>.
  • vcs_repo (Block List, Min: 1, Max: 1) Source configuration of a VCS repository. (see below for nested schema)

Optional

  • account_id (String) The identifier of the account in the format acc-<RANDOM STRING>. If it is not specified the module will be registered globally and available across the whole installation.
  • environment_id (String) The identifier of an environment in the format env-<RANDOM STRING>. If it is not specified the module will be registered at the account level and available across all environments within the account specified in account_id attribute.

Read-Only

  • id (String) The ID of this resource.
  • module_provider (String) Module provider name, e.g aws, azurerm, google, etc.
  • name (String) Name of the module, e.g. rds, compute, kubernetes-engine.
  • source (String) The source of a remote module in the private registry, e.g env-xxxx/aws/vpc.
  • status (String) A system status of the Module.

Nested Schema for vcs_repo

Required:

  • identifier (String) The identifier of a VCS repository in the format :org/:repo (:org/:project/:name is used for Azure DevOps). It refers to an organization and a repository name in a VCS provider.

Optional:

  • path (String) The path to the root module folder. It is expected to have the format <path>/terraform-<provider_name>-<module_name>, where <path> stands for any folder within the repository inclusively a repository root.
  • tag_prefix (String) Registry ignores tags which do not match specified prefix, e.g. aws/.

Import

Import is supported using the following syntax:

terraform import scalr_module.example mod-xxxxxxxxxx