Custom IAM policy with custom IAM Actions

0

I want to create a Custom I AM policy with custom IAM Actions.

something like below: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "myCustomService:MyCustomAction", "myCustomService1:MyCustomAction1", ], "Resource": "*" } ] }

I need this to control clients/ users/ clientApplication access to my application running in EKS cluster.

thanks in advance.

1 回答
0

i have added the following example please modify accordingly

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "eks:DescribeCluster",
                "eks:ListFargateProfiles",
                "eks:ListUpdates",
                "eks:UpdateClusterVersion"
            ],
            "Resource": "arn:aws:eks:us-west-2:123456789012:cluster/my-cluster",
            "Condition": {
                "StringEquals": {
                    "aws:userid": [
                        "user1",
                        "user2"
                    ],
                    "sourceArn": [
                        "arn:aws:execute-api:us-west-2:123456789012:abcdefghij/*/GET/resource1",
                        "arn:aws:execute-api:us-west-2:123456789012:abcdefghij/*/GET/resource2"
                    ]
                }
            }
        },
        {
            "Effect": "Allow",
            "Action": [
                "ecr:BatchGetImage",
                "ecr:DescribeRepositories",
                "ecr:ListImages",
                "ecr:ListTagsForResource",
                "ecr:PutImage"
            ],
            "Resource": "arn:aws:ecr:us-west-2:123456789012:repository/my-repo",
            "Condition": {
                "StringEquals": {
                    "aws:userid": [
                        "user1",
                        "user2"
                    ],
                    "sourceArn": [
                        "arn:aws:execute-api:us-west-2:123456789012:abcdefghij/*/POST/resource3",
                        "arn:aws:execute-api:us-west-2:123456789012:abcdefghij/*/POST/resource4"
                    ]
                }
            }
        }
    ]
}

profile picture
专家
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则