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 Antwort
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
EXPERTE
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen