Skip to content

Commit

Permalink
fix(tco): [121024358] support credential_secret (#2994)
Browse files Browse the repository at this point in the history
* support credential_secret

* add changelog

---------

Co-authored-by: mikatong <[email protected]>
  • Loading branch information
tongyiming and mikatong authored Dec 3, 2024
1 parent f4d1357 commit e6bb2d5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/2994.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_identity_center_scim_credential: support param `credential_secret`
```
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ func ResourceTencentCloudIdentityCenterScimCredential() *schema.Resource {
Description: "SCIM key ID. scimcred-prefix and followed by 12 random digits/lowercase letters.",
},

"credential_secret": {
Type: schema.TypeString,
Computed: true,
Sensitive: true,
Description: "SCIM key.",
},

"credential_type": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -104,6 +111,9 @@ func resourceTencentCloudIdentityCenterScimCredentialCreate(d *schema.ResourceDa
credentialId = *response.Response.CredentialId

d.SetId(strings.Join([]string{zoneId, credentialId}, tccommon.FILED_SP))
if response.Response != nil && response.Response.CredentialSecret != nil {
_ = d.Set("credential_secret", *response.Response.CredentialSecret)
}

return resourceTencentCloudIdentityCenterScimCredentialRead(d, meta)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ func TestAccTencentCloudIdentityCenterScimCredentialResource_basic(t *testing.T)
resource.TestCheckResourceAttrSet("tencentcloud_identity_center_scim_credential.identity_center_scim_credential", "credential_type"),
resource.TestCheckResourceAttrSet("tencentcloud_identity_center_scim_credential.identity_center_scim_credential", "create_time"),
resource.TestCheckResourceAttrSet("tencentcloud_identity_center_scim_credential.identity_center_scim_credential", "expire_time"),
resource.TestCheckResourceAttrSet("tencentcloud_identity_center_scim_credential.identity_center_scim_credential", "credential_secret"),
),
},
{
ResourceName: "tencentcloud_identity_center_scim_credential.identity_center_scim_credential",
ImportState: true,
ImportStateVerify: true,
ResourceName: "tencentcloud_identity_center_scim_credential.identity_center_scim_credential",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"credential_secret"},
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ In addition to all arguments above, the following attributes are exported:
* `id` - ID of the resource.
* `create_time` - SCIM create time.
* `credential_id` - SCIM key ID. scimcred-prefix and followed by 12 random digits/lowercase letters.
* `credential_secret` - SCIM key.
* `credential_type` - SCIM credential type.
* `expire_time` - SCIM expire time.
* `status` - SCIM key status, Enabled-On, Disabled-Closed.
Expand Down

0 comments on commit e6bb2d5

Please sign in to comment.