TECHIES WORLD

For Techs.... Techniques.... Technologies....

AWSLinux

How to configure IAM policy for giving the read and write access without delete permission to specific API Gateway

We can give or restrict different permissions over API Gateway using default IAM policies. But this is applicable for the whole list of API Gateways in the AWS account.

There are certain cases where we need to give the read and write access without delete permission to specific API Gateway.

In such a situation we can create a new IAM policy as follows.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "apigateway:GET"
            ],
            "Resource": [
                "arn:aws:apigateway:*::/clientcertificates",
                "arn:aws:apigateway:*::/restapis",
                "arn:aws:apigateway:*::/restapis/*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                    "apigateway:GET",
                    "apigateway:POST",
                    "apigateway:PUT"
            ],
            "Resource": [
                "arn:aws:apigateway:us-east-1::/restapis/API-ID",
                "arn:aws:apigateway:us-east-1::/restapis/API-ID/*"
            ]
        }
    ]
}

Here we need to replace API-ID with the corresponding value.

In this case the user have read and write access but not the delete permission to this particular API only and rest all API'S are restricted as read only.

That's all…