Skip to content

Commit

Permalink
docs: update IMDSv2 doc for ecs ram role
Browse files Browse the repository at this point in the history
  • Loading branch information
yndu13 authored and peze committed May 24, 2024
1 parent 4613843 commit 5f72177
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ func main(){
// Which type of credential you want
SetType("ecs_ram_role").
// `roleName` is optional. It will be retrieved automatically if not set. It is highly recommended to set it up to reduce requests
SetRoleName("RoleName")
SetRoleName("RoleName").
// `EnableIMDSv2` is optional and is recommended to be turned on. It can be replaced by setting environment variable: ALIBABA_CLOUD_ECS_IMDSV2_ENABLE
SetEnableIMDSv2(true)

ecsCredential, err := credentials.NewCredential(config)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ func main(){
// Which type of credential you want
SetType("ecs_ram_role").
// `roleName` is optional. It will be retrieved automatically if not set. It is highly recommended to set it up to reduce requests
SetRoleName("RoleName")
SetRoleName("RoleName").
// `EnableIMDSv2` is optional and is recommended to be turned on. It can be replaced by setting environment variable: ALIBABA_CLOUD_ECS_IMDSV2_ENABLE
SetEnableIMDSv2(true)

ecsCredential, err := credentials.NewCredential(config)
if err != nil {
Expand Down

0 comments on commit 5f72177

Please sign in to comment.