amazon-web-servicesamazon-iamaws-cliaws-service-catalog

add role/user to AWS service catalog portfolio


I am looking forward to add a role to AWS service catalog portfolio. I am able to add it through console but I want to do it from AWS CLI.

I am not able to find any option in AWS, can someone please help if i can add role to portfolio from CLI


Solution

  • i think you are looking for AssociatePrincipalWithPortfolio.

    this option allows to add role to your portfolio

    --principal-arn (string)
    
    The ARN of the principal (IAM user, role, or group).
    

    example command

    aws servicecatalog associate-principal-with-portfolio \
        --portfolio-id port-2s6abcdefwdh4 \
        --principal-arn arn:aws:iam::123456789012:user/usertest \
        --principal-type IAM