Closed davidcsi closed 3 years ago
Funny this, if i use the document to create the policy in AWS CONSOLE, it works fine.
@davidcsi if you are still facing issue - this should work
aws iam create-policy --policy-name ALBIngressControllerIAMPolicy --policy-document file://"
Thanks, I will try that. Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Mon, Oct 12, 2020 at 6:53 PM smuramshetty notifications@github.com wrote:
@davidcsi https://github.com/davidcsi if you are still facing issue - this should work
aws iam create-policy --policy-name ALBIngressControllerIAMPolicy --policy-document file://"\iam-policy.json"
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kubernetes-sigs/aws-alb-ingress-controller/issues/1415#issuecomment-707263127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG4L4DY6AVQ3C5ZERBEJFDSKM7C7ANCNFSM4RK36LZQ .
@davidcsi Seems the AWSSDK behavior changed, you need to first download the policy as file, and use "file://` to create it.
curl -o iam_policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/main/docs/install/iam_policy.json
aws iam create-policy --policy-name ALBIngressControllerIAMPolicy --policy-document file://iam_policy.json
closing this, feel free to reopen if we have any other issues
@davidcsi if you are still facing issue - this should work
aws iam create-policy --policy-name ALBIngressControllerIAMPolicy --policy-document file://"\iam-policy.json"
This solution works for me. Thank you so much!
Also, to avoid persisting the iam-policy.json file, you can use Bash process substitution like the following shell session illustrates.
$ aws iam create-policy \
--policy-name ALBIngressControllerIAMPolicy \
--policy-document https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/v1.1.4/docs/examples/iam-policy.json
An error occurred (MalformedPolicyDocument) when calling the CreatePolicy operation: Syntax errors in policy.
$ aws iam create-policy \
--policy-name ALBIngressControllerIAMPolicy \
--policy-document file://<(curl -sS https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/v1.1.4/docs/examples/iam-policy.json)
{
"Policy": {
"PolicyName": "ALBIngressControllerIAMPolicy",
# ...
I just tried using
https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/master/docs/examples/iam-policy.json
like:
$ aws iam create-policy --policy-name ALBIngressControllerIAMPolicy --policy-document https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/master/docs/examples/iam-policy.json
and got:
An error occurred (MalformedPolicyDocument) when calling the CreatePolicy operation: Syntax errors in policy.
Thanks