Skip to content

Commit 7ad4fde

Browse files
authored
feat(cam): [125902956] add AuxiliaryDomain (#3472)
* add AuxiliaryDomain * add AuxiliaryDomain
1 parent 7978281 commit 7ad4fde

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

.changelog/3472.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_cam_user_saml_config: add `auxiliary_domain`
3+
```

tencentcloud/services/cam/resource_tc_cam_user_saml_config.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ func ResourceTencentCloudCamUserSamlConfig() *schema.Resource {
4242
},
4343
},
4444

45+
"auxiliary_domain": {
46+
Optional: true,
47+
Computed: true,
48+
Type: schema.TypeString,
49+
Description: "auxiliary domain, like: `xxx.com`.",
50+
},
51+
4552
"status": {
4653
Computed: true,
4754
Type: schema.TypeInt,
@@ -51,7 +58,7 @@ func ResourceTencentCloudCamUserSamlConfig() *schema.Resource {
5158
"metadata_document_file": {
5259
Type: schema.TypeString,
5360
Optional: true,
54-
Description: "The path used to save the samlMetadat file.",
61+
Description: "The path used to save the saml Metadata file.",
5562
},
5663
},
5764
}
@@ -80,6 +87,10 @@ func resourceTencentCloudCamUserSamlConfigCreate(d *schema.ResourceData, meta in
8087
request.SAMLMetadataDocument = helper.String(tccommon.StringToBase64(saml))
8188
}
8289

90+
if v, ok := d.GetOk("auxiliary_domain"); ok {
91+
request.AuxiliaryDomain = helper.String(v.(string))
92+
}
93+
8394
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
8495
result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseCamClient().CreateUserSAMLConfig(request)
8596
if e != nil {
@@ -128,6 +139,10 @@ func resourceTencentCloudCamUserSamlConfigRead(d *schema.ResourceData, meta inte
128139
_ = d.Set("saml_metadata_document", metadata)
129140
}
130141

142+
if userSamlConfig.AuxiliaryDomain != nil {
143+
_ = d.Set("auxiliary_domain", userSamlConfig.AuxiliaryDomain)
144+
}
145+
131146
if userSamlConfig.Status != nil {
132147
_ = d.Set("status", userSamlConfig.Status)
133148
}
@@ -166,6 +181,12 @@ func resourceTencentCloudCamUserSamlConfigUpdate(d *schema.ResourceData, meta in
166181
}
167182
}
168183

184+
if d.HasChange("auxiliary_domain") {
185+
if v, ok := d.GetOk("auxiliary_domain"); ok {
186+
request.AuxiliaryDomain = helper.String(v.(string))
187+
}
188+
}
189+
169190
service := CamService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()}
170191
samlConfig, describeErr := service.DescribeCamUserSamlConfigById(ctx)
171192
if describeErr != nil {

tencentcloud/services/cam/resource_tc_cam_user_saml_config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ resource "tencentcloud_cam_user_saml_config" "example" {
99
saml_metadata_document = <<-EOT
1010
<?xml version="1.0" encoding="utf-8"?></EntityDescriptor>
1111
EOT
12+
auxiliary_domain = "xxx.com"
1213
}
1314
```
1415

website/docs/r/cam_user_saml_config.html.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ resource "tencentcloud_cam_user_saml_config" "example" {
2020
saml_metadata_document = <<-EOT
2121
<?xml version="1.0" encoding="utf-8"?></EntityDescriptor>
2222
EOT
23+
auxiliary_domain = "xxx.com"
2324
}
2425
```
2526

@@ -36,7 +37,8 @@ resource "tencentcloud_cam_user_saml_config" "example" {
3637
The following arguments are supported:
3738

3839
* `saml_metadata_document` - (Required, String) SAML metadata document, xml format, support string content or file path.
39-
* `metadata_document_file` - (Optional, String) The path used to save the samlMetadat file.
40+
* `auxiliary_domain` - (Optional, String) auxiliary domain, like: `xxx.com`.
41+
* `metadata_document_file` - (Optional, String) The path used to save the saml Metadata file.
4042

4143
## Attributes Reference
4244

0 commit comments

Comments
 (0)