Skip to content

Conversation

@lyu571
Copy link
Contributor

@lyu571 lyu571 commented Oct 11, 2022

No description provided.

@lyu571 lyu571 requested a review from hellertang October 11, 2022 10:48
@lyu571 lyu571 added the run check run check label Oct 11, 2022
```

The `assume_role_arn`, `assume_role_session_name`, `assume_role_session_duration` can also provided via `TENCENTCLOUD_ASSUME_ROLE_ARN`, `TENCENTCLOUD_ASSUME_ROLE_SESSION_NAME` and `TENCENTCLOUD_ASSUME_ROLE_SESSION_DURATION` environment variables.
The `assume_role_arn`, `assume_role_session_name`, `assume_role_session_duration` can also provided via `TENCENTCLOUD_ASSUME_ROLE_ARN`, `TENCENTCLOUD_ASSUME_ROLE_SESSION_NAME` and `TENCENTCLOUD_ASSUME_ROLE_SESSION_DURATION` environment variables with a empty `assume_role` block.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里没有看懂,为啥要有个空的block?

Copy link
Contributor Author

@lyu571 lyu571 Oct 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

按目前providerConfigure逻辑,如果不加这个空block,即便配置了环境变量,压根儿就不会取assume_role_arn, assume_role_session_name, assume_role_session_duration这几个字段。

providerConfigure逻辑如下:
tencentcloud/provider.go:1282:
assumeRoleList := d.Get("assume_role").(*schema.Set).List() if len(assumeRoleList) == 1 {

Copy link
Contributor Author

@lyu571 lyu571 Oct 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当然还有一个实现就是修改providerConfigure逻辑。
if len(assumeRoleList) == 0时,尝试取环境变量。
就不需要放这个空block。

@lyu571 lyu571 added run check run check and removed run check run check labels Oct 17, 2022
@hellertang hellertang merged commit 3d6facc into master Oct 17, 2022
@hellertang hellertang deleted the feat/add-env-4-session-duration branch October 17, 2022 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run check run check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants