文档

alicloud_cloud_sso_group

更新时间:
一键部署

Provides a Cloud SSO Group resource.

For information about Cloud SSO Group and how to use it, see What is Group.

-> NOTE: Available since v1.138.0.

Example Usage

Basic Usage

variable "name" {
  default = "tf-example"
}
provider "alicloud" {
  region = "cn-shanghai"
}
data "alicloud_cloud_sso_directories" "default" {}

resource "alicloud_cloud_sso_directory" "default" {
  count          = length(data.alicloud_cloud_sso_directories.default.ids) > 0 ? 0 : 1
  directory_name = var.name
}

locals {
  directory_id = length(data.alicloud_cloud_sso_directories.default.ids) > 0 ? data.alicloud_cloud_sso_directories.default.ids[0] : concat(alicloud_cloud_sso_directory.default.*.id, [""])[0]
}

resource "alicloud_cloud_sso_group" "default" {
  directory_id = local.directory_id
  group_name   = var.name
  description  = var.name
}

Argument Reference

The following arguments are supported:

  • description - (Optional) The Description of the group. The description can be up to 1024 characters long.
  • directory_id - (Required, ForceNew) The ID of the Directory.
  • group_name - (Required) The Name of the group. The name must be 1 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-).

Attributes Reference

The following attributes are exported:

  • id - The resource ID of Group. The value formats as <directory_id>:<group_id>.
  • group_id - The GroupId of the group.

Import

Cloud SSO Group can be imported using the id, e.g.

$ terraform import alicloud_cloud_sso_group.example <directory_id>:<group_id>

  • 本页导读 (0)
文档反馈