With respect to an Amazon Resource Name (ARN) the AWS documentation states that:
Amazon Resource Names (ARNs) uniquely identify AWS resources. We require an ARN when you need to specify a resource unambiguously across all of AWS, such as in IAM policies, Amazon Relational Database Service (Amazon RDS) tags, and API calls.
http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
Question
Is it possible to look up a specific AWS resource using the ARN as an identifier?
For example if I was to use the SDK would it be possible to do something along the lines of:
Instance instance = AmazonResourceName.find(arnId); // look up via ARN?
If this is not possible, then the question becomes:
*What is the recommended approach for finding an AWS resources using the API? and What are the identifiers available for look up? *
Thanks
Amazon Resource Names (ARNs) uniquely identify AWS resources. We require an ARN when you need to specify a resource unambiguously across all of AWS, such as in IAM policies, Amazon Relational Database Service (Amazon RDS) tags, and API calls.
Getting AWS Role arn You can get the arn of the IAM role from the cli as explained in the above section. If you go to IAM –> Role –> Your role from the web console, you can view the arn as shown below. Note: If you are working with an ec2 instance, you might need the instance profile arn with the IAM policies.
You can get the ARN of an RDS resource using the AWS management console, RDS API, or AWS command-line interface. If you are using the AWS management console, you have to navigate to the resource you need the ARN for and click on the details of that resource.
Have you looked at the AmazonEc2Client docs?
It has a describeInstances(DescribeInstancesRequest describeInstancesRequest)
method that I think might suit your needs because the DescribeInstancesRequest
can be set with ids as shown in the docs. This is untested but might be a good place to start.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With