Skip to content

Latest commit

 

History

History
121 lines (98 loc) · 4.13 KB

power_schedule_policy.md

File metadata and controls

121 lines (98 loc) · 4.13 KB
page_title subcategory description
morpheus_power_schedule_policy Resource - terraform-provider-morpheus
Provides a Morpheus power schedule policy resource

morpheus_power_schedule_policy

Provides a Morpheus power schedule policy resource

Example Usage

Creating the policy with a global scope:

resource "morpheus_power_schedule_policy" "tf_example_power_schedule_policy_global" {
  name                         = "tf_example_power_schedule_policy_global"
  description                  = "terraform example global power schedule policy"
  enabled                      = true
  enforcement_type             = "fixed"
  power_schedule_id            = 2
  hide_power_schedule_if_fixed = true
  scope                        = "global"
}

Creating the policy with a cloud scope:

resource "morpheus_power_schedule_policy" "tf_example_power_schedule_policy_cloud" {
  name                         = "tf_example_power_schedule_policy_cloud"
  description                  = "terraform example cloud power schedule policy"
  enabled                      = true
  enforcement_type             = "fixed"
  power_schedule_id            = 2
  hide_power_schedule_if_fixed = true
  scope                        = "cloud"
  cloud_id                     = 1
}

Creating the policy with a group scope:

resource "morpheus_power_schedule_policy" "tf_example_power_schedule_policy_group" {
  name                         = "tf_example_power_schedule_policy_group"
  description                  = "terraform example group power schedule policy"
  enabled                      = true
  enforcement_type             = "fixed"
  power_schedule_id            = 2
  hide_power_schedule_if_fixed = true
  scope                        = "group"
  group_id                     = 1
}

Creating the policy with a role scope:

resource "morpheus_power_schedule_policy" "tf_example_power_schedule_policy_role" {
  name                         = "tf_example_power_schedule_policy_role"
  description                  = "terraform example role power schedule policy"
  enabled                      = true
  enforcement_type             = "fixed"
  power_schedule_id            = 2
  hide_power_schedule_if_fixed = true
  scope                        = "role"
  role_id                      = 1
  apply_to_each_user           = true
}

Creating the policy with a user scope:

resource "morpheus_power_schedule_policy" "tf_example_power_schedule_policy_user" {
  name                         = "tf_example_power_schedule_policy_user"
  description                  = "terraform example user power schedule policy"
  enabled                      = true
  enforcement_type             = "fixed"
  power_schedule_id            = 2
  hide_power_schedule_if_fixed = true
  scope                        = "user"
  user_id                      = 1
}

Schema

Required

  • enforcement_type (String) The ID of the user group
  • name (String) The name of the power schedule policy
  • power_schedule_id (String) The ID of the user group
  • 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 power schedule policy
  • enabled (Boolean) Whether the policy is enabled
  • group_id (Number) The id of the group associated with the group scoped filter
  • hide_power_schedule_if_fixed (Boolean) The ID of the user group
  • 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 power schedule policy

Import

Import is supported using the following syntax:

terraform import morpheus_power_schedule_policy.tf_example_power_schedule_policy 1