Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with aws command #62

Open
juantarrel opened this issue Apr 1, 2020 · 1 comment
Open

Problem with aws command #62

juantarrel opened this issue Apr 1, 2020 · 1 comment

Comments

@juantarrel
Copy link

I just trying to execute something like this, but is not working
aws iot attach-principal-policy --policy-name 'G4APPTV' --principal 'us-west-2:03ee51b1-1ffe-456c-ae6b-0a2c9d610f70'

the role of the lambda has admin credentials, i dont sure what's going on

this is all the code

#!/bin/bash

handler () {
    set -e
    EVENT_DATA=$1
    identityId=`echo "$EVENT_DATA" | jq -r ".request.userAttributes" | sed -e "s/custom:identityId/identityId/g" | jq -r '.identityId'` 
    aws iot attach-principal-policy --policy-name 'G4APPTV' --principal 'us-west-2:03ee51b1-1ffe-456c-ae6b-0a2c9d610f70'
    echo "{\"success\": true}" >&2
}

Can you help with that?

ty

@gkrizek
Copy link
Owner

gkrizek commented Jun 5, 2020

You could check to make sure it's using the role correctly by running this in your function:

aws sts get-caller-identity

I would start there and make sure it's using the right role

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants