Skip to content

Commit 1459cc2

Browse files
committed
add
1 parent 962c02c commit 1459cc2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tencentcloud/provider.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,7 +2270,6 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
22702270

22712271
if assumeRoleArn != "" && assumeRoleSessionName != "" {
22722272
assumeRoleSessionDuration = 7200
2273-
assumeRolePolicy = ""
22742273
_ = genClientWithSTS(&tcClient, assumeRoleArn, assumeRoleSessionName, assumeRoleSessionDuration, assumeRolePolicy, assumeRoleExternalId)
22752274
}
22762275

@@ -2328,7 +2327,11 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
23282327
assumeRoleExternalId = assumeRole["external_id"].(string)
23292328

23302329
_ = genClientWithSTS(&tcClient, assumeRoleArn, assumeRoleSessionName, assumeRoleSessionDuration, assumeRolePolicy, assumeRoleExternalId)
2331-
needSecret = true
2330+
if camRoleName != "" {
2331+
needSecret = false
2332+
} else {
2333+
needSecret = true
2334+
}
23322335
}
23332336
}
23342337

@@ -2381,10 +2384,6 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
23812384
}
23822385
}
23832386

2384-
if camRoleName != "" && assumeRoleExternalId != "" {
2385-
needSecret = false
2386-
}
2387-
23882387
if needSecret && (secretId == "" || secretKey == "") {
23892388
return nil, fmt.Errorf("Please set your `secret_id` and `secret_key`.\n")
23902389
}

0 commit comments

Comments
 (0)