aws-cliibm-cloud-infrastructureobject-storageibm-cloud-storage

How to get user information using awscli for Softlayer?


$aws configure set region=CrossRegion-US

$ aws iam get-user. 

Could not connect to the endpoint URL: https://iam.CrossRegion-US.amazonaws.com/

Is this happening because I have set an incorrect region or is Softlayer in progress of improving the API support?

I have also used the region from authentication endpoints. Still, I get the same error.


Solution

  • Setting custom endpoints is not possible within the ~/.aws/config or ~/.aws/credentials files, instead it must be passed as an argument to each command. In your example above, you were trying to connect to AWS because a custom endpoint was not provided to let the CLI know where to connect.

    For example, to list the contents of bucket-1:

    aws --endpoint-url=https://{endpoint} s3 ls s3://bucket-1/
    

    In the case of IBM Cross-Region object storage, the default endpoint would be s3-api.us-geo.objectstorage.softlayer.net. (In this case, the region would be us-standard, although this is not necessary to explicitly declare as it is the only region currently offered.)

    For more information, the documentation has information on both using the AWS CLI and connecting to endpoints.

    All that said, user information is not accessible using the implementation of the S3 API. Some user information can be accessed using the SoftLayer API, but generally speaking user information isn't directly used by the object storage system in this release, as permissions are issued at the storage account level.