alicloud_cloud_sso_user
更新时间:
Provides a Cloud SSO User resource.
For information about Cloud SSO User and how to use it, see What is User.
-> NOTE: Available since v1.140.0.
-> NOTE: Cloud SSO Only Support cn-shanghai
And us-west-1
Region
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_user" "default" {
directory_id = local.directory_id
user_name = var.name
}
Argument Reference
The following arguments are supported:
description
- (Optional) The description of user. The description can be up to1024
characters long.directory_id
- (Required, ForceNew) The ID of the Directory.display_name
- (Optional) The display name of user. The display name can be up to256
characters long.email
- (Optional) The User's Contact Email Address. The email can be up to128
characters long.first_name
- (Optional) The first name of user. The first_name can be up to64
characters long.last_name
- (Optional) The last name of user. The last_name can be up to64
characters long.status
- (Optional) The status of user. Valid values:Disabled
,Enabled
.user_name
- (Required, ForceNew) The name of user. The name must be1
to64
characters in length and can contain letters, digits, at signs (@), periods (.), underscores (_), and hyphens (-).
Attributes Reference
The following attributes are exported:
id
- The resource ID of User. The value formats as<directory_id>:<user_id>
.user_id
- The User ID of the group.
Import
Cloud SSO User can be imported using the id, e.g.
$ terraform import alicloud_cloud_sso_user.example <directory_id>:<user_id>
文档内容是否对您有帮助?