Skip to content

Latest commit

 

History

History
121 lines (98 loc) · 4.33 KB

cluster_resource_name_policy.md

File metadata and controls

121 lines (98 loc) · 4.33 KB
page_title subcategory description
morpheus_cluster_resource_name_policy Resource - terraform-provider-morpheus
Provides a Morpheus cluster resource name policy resource

morpheus_cluster_resource_name_policy

Provides a Morpheus cluster resource name policy resource

Example Usage

Creating the policy with a global scope:

resource "morpheus_cluster_resource_name_policy" "tf_example_cluster_resource_name_policy_global" {
  name                   = "tf_example_cluster_resource_name_policy_global"
  description            = "terraform example global cluster resource name policy"
  enabled                = true
  enforcement_type       = "fixed"
  naming_pattern         = "$${userInitials.toUpperCase()}DMCLSTR$${sequence+1000}"
  auto_resolve_conflicts = true
  scope                  = "global"
}

Creating the policy with a cloud scope:

resource "morpheus_cluster_resource_name_policy" "tf_example_cluster_resource_name_policy_cloud" {
  name                   = "tf_example_cluster_resource_name_policy_cloud"
  description            = "tfvsphere"
  enabled                = true
  enforcement_type       = "fixed"
  naming_pattern         = "$${userInitials.toUpperCase()}DMCLSTR$${sequence+1000}"
  auto_resolve_conflicts = true
  scope                  = "cloud"
  cloud_id               = 1
}

Creating the policy with a group scope:

resource "morpheus_cluster_resource_name_policy" "tf_example_cluster_resource_name_policy_group" {
  name                   = "tf_example_cluster_resource_name_policy_group"
  description            = "terraform example group cluster resource name policy"
  enabled                = true
  enforcement_type       = "fixed"
  naming_pattern         = "$${userInitials.toUpperCase()}DMCLSTR$${sequence+1000}"
  auto_resolve_conflicts = true
  scope                  = "group"
  group_id               = 1
}

Creating the policy with a role scope:

resource "morpheus_cluster_resource_name_policy" "tf_example_cluster_resource_name_policy_role" {
  name                   = "tf_example_cluster_resource_name_policy_role"
  description            = "terraform example role cluster resource name policy"
  enabled                = true
  enforcement_type       = "fixed"
  naming_pattern         = "$${userInitials.toUpperCase()}DMCLSTR$${sequence+1000}"
  auto_resolve_conflicts = true
  scope                  = "role"
  role_id                = 1
  apply_each_user        = true
}

Creating the policy with a user scope:

resource "morpheus_cluster_resource_name_policy" "tf_example_cluster_resource_name_policy_user" {
  name                   = "tf_example_cluster_resource_name_policy_user"
  description            = "terraform example user cluster resource name policy"
  enabled                = true
  enforcement_type       = "fixed"
  naming_pattern         = "$${userInitials.toUpperCase()}DMCLSTR$${sequence+1000}"
  auto_resolve_conflicts = true
  scope                  = "user"
  user_id                = 1
}

Schema

Required

  • auto_resolve_conflicts (Boolean) Whether to create a backup
  • enforcement_type (String) The policy enforcement type (fixed or user)
  • name (String) The name of the backup creation policy
  • naming_pattern (String) The policy enforcement type (fixed or user)
  • scope (String) The filter or scope that the policy is applied to (global, group, cloud, user, role)

Optional

  • apply_to_each_user (Boolean) Whether to assign the policy at the individual user level to all users assigned the associated role
  • cloud_id (Number) The id of the cloud associated with the cloud scoped filter
  • description (String) The description of the backup creation policy
  • enabled (Boolean) Whether the policy is enabled
  • group_id (Number) The id of the group associated with the group scoped filter
  • role_id (Number) The id of the role associated with the role scoped filter
  • tenant_ids (List of Number) A list of tenant IDs to assign the policy to
  • user_id (Number) The id of the user associated with the user scoped filter

Read-Only

  • id (String) The ID of the backup creation policy

Import

Import is supported using the following syntax:

terraform import morpheus_cluster_resource_name_policy.tf_example_cluster_resource_name_policy 1