alicloud_cloud_sso_access_configuration_provisioning

更新时间:

Provides a Cloud SSO Access Configuration Provisioning resource.

For information about Cloud SSO Access Configuration Provisioning and how to use it, see What is Access Configuration Provisioning.

-> NOTE: Available since v1.148.0.

Example Usage

Basic Usage


variable "name" {
  default = "tf-example"
}
provider "alicloud" {
  region = "cn-shanghai"
}
data "alicloud_cloud_sso_directories" "default" {}
data "alicloud_resource_manager_resource_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_user" "default" {
  directory_id = local.directory_id
  user_name    = var.name
}

resource "alicloud_cloud_sso_access_configuration" "default" {
  access_configuration_name = var.name
  directory_id              = local.directory_id
}

resource "alicloud_cloud_sso_access_configuration_provisioning" "default" {
  directory_id            = local.directory_id
  access_configuration_id = alicloud_cloud_sso_access_configuration.default.access_configuration_id
  target_type             = "RD-Account"
  target_id               = data.alicloud_resource_manager_resource_directories.default.directories.0.master_account_id
}

Argument Reference

The following arguments are supported:

  • access_configuration_id - (Required, ForceNew) The Access configuration ID.
  • directory_id - (Required, ForceNew) The ID of the Directory.
  • target_id - (Required, ForceNew) The ID of the target to create the resource range.
  • target_type - (Required, ForceNew) The type of the resource range target to be accessed. Valid values: RD-Account.
  • status - (Optional) The status of the resource. Valid values: Provisioned, ReprovisionRequired and DeprovisionFailed.

Attributes Reference

The following attributes are exported:

  • id - The resource ID of Access Assignment. The value formats as <directory_id>:<access_configuration_id>:<target_type>:<target_id>.

Import

Cloud SSO Access Configuration Provisioning can be imported using the id, e.g.

$ terraform import alicloud_cloud_sso_access_assignment.example <directory_id>:<access_configuration_id>:<target_type>:<target_id>