Skip to content

Unable to fetch iam policy detailes in GetPolicyResult

0

I need to get the policy details through my java code. Currently I am using GetPolicyResult and I am giving my policy ARN GetPolicyRequest request = new GetPolicyRequest().withPolicyArn(my_arn); GetPolicyResult response = iam.getPolicy(request);

I am following below doc for the same https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-iam-policies.html#getting-a-policy

But i am unable to get the policy detailes I am getting "com.amazonaws.services.identitymanagement.model.InvalidInputException - ARN is not valid " i have given the arn of my policy that is mentioned in my policy aws console but still it's saying invalid .

1 Answer
0

Hello,

Unfortunately, I am unable to fully answer this question without additional context. The InvalidInputException error is defined as "The request was rejected because an invalid or out-of-range value was supplied for an input parameter." [1].

I believe you already double checked the ARN format, I also share the format in [2] for your reference.

If this doesn't solve your issue I would recommend you to open a case with AWS Premium Support from the account where the error is occurring, so we can investigate the issue for you. Since this forum is public, it is not recommended to share account specific information.

References: [1] - https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/iam/IamClient.html#getPolicy(software.amazon.awssdk.services.iam.model.GetPolicyRequest)
[2] - https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.