Role Data
- Print
- PDF
Role Data
- Print
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
Can be used in a VPC environment.
Summary
Search information regarding the role assigned to the server instance.
A role must be assigned to the server instance to use the corresponding feature.
Please see Sub Account User Guide > Manage roles page for related details.
Role ID search and temporary access key issuing feature can be used internally in ncloud-sdk and Object Storage CLI.
If both the environment variable and the configure file don't have an access key set, a temporary access key will be used internally using the corresponding feature.
ncloud-sdk
Ncloud CLI
Object Storage CLI
Request
Call path | Description |
---|---|
/{version}/meta-data/iam/ | Search list of the role-related data provided in the corresponding version. |
/{version}/meta-data/iam/info | Search details of the role assigned to the server instance. |
/{version}/meta-data/iam/security-credentials | Search ID of the role assigned to the server instance. The line feed character (\n) does not exist at the end of the output result. It can be used for obtaining the role ID internally in ncloud-sdk and Object Storage CLI. |
/{version}/meta-data/iam/security-credentials/{roleId} | You can get a temporarily issued access key (STS) assigned to the server instance. The temporary access key will get permissions under the policy set in the role. Just like sub account's access key, it can also be used in API, CLI, and SDK. The line feed character (\n) does not exist at the end of the output result. It can be used for obtaining the temporary access key internally in ncloud-sdk and Object Storage CLI. |
Example
[root@test-server ~]# curl http://169.254.169.254/latest/meta-data/iam/
info
security-credentials
[root@test-server ~]# curl http://169.254.169.254/latest/meta-data/iam/info
{
"roleId" : "***-***-***-***-***ec4",
"roleName" : "test-role",
"roleType" : "Server",
"createTime" : "2020-12-04T08:24:35Z"
}
[root@test-server ~]# curl http://169.254.169.254/latest/meta-data/iam/security-credentials
***-***-***-***-***ec4[root@test-server ~]#
[root@test-server ~]# curl http://169.254.169.254/latest/meta-data/iam/security-credentials/***-***-***-***-***ec4
{
"Type" : "NCP-HMAC",
"AccessKeyId" : "s_***976",
"SecretAccessKey" : "***6ab",
"Expiration" : "2020-12-22T11:50:45Z",
"Token" : "",
"LastUpdated" : "2020-12-21T23:50:45Z",
"Code" : "Success"
}[root@test-server ~]#
Was this article helpful?