attach-policy returning Policy not found error #7005
-
Hello, I'm trying to attach a policy to a cognito Identity Id using the command aws iot attach-policy. I have verified that the policy I'm trying to attach is correctly created, I can see this:
But when I try to attach it I get the following error:
Any idea why this is happening? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @jimenaCabrejas thanks for reaching out. Here is the When using the |
Beta Was this translation helpful? Give feedback.
-
@jimenaCabrejas What full ARN for the Cognito Idenitity Id did you use ? I am facing the same issue of Policy Not Found using the code. But when I use the CLI command the policy gets attached successfully the Cognito Identity ID ( without full ARN ). |
Beta Was this translation helpful? Give feedback.
Hi @jimenaCabrejas thanks for reaching out. Here is the
aws iot attach-policy
documentation for reference: https://docs.aws.amazon.com/cli/latest/reference/iot/attach-policy.htmlWhen using the
--target
parameter it looks like you need the full ARN. For example:--target "arn:aws:iot:us-west-2:123456789012:thinggroup/LightBulbs