Naftuli Kay
Naftuli Kay

Reputation: 91820

Create Deployment Permission for API Gateway

I have automation around an API Gateway deployment:

aws apigateway create-deployment ...

I am attempting to wrap my features in continuous deployment and I cannot seem to understand the IAM permissions which seem to deviate from all other IAM permissions across other services:

(Cloudonaut Documentation; "Control Access for Managing an API")

Permissions only seem to cover stages:

How do I grant the ability to create a deployment for a given stage? apigateway:PUT? apigateway:POST?

Upvotes: 2

Views: 1660

Answers (2)

netliner
netliner

Reputation: 159

Try this:

{ "Action": "apigateway:POST", "Resource": "arn:aws:apigateway:*::/restapis/*/stages/${stage_name}", "Effect": "Allow", "Sid": "VisualEditor" }

Upvotes: 2

Naftuli Kay
Naftuli Kay

Reputation: 91820

By testing, I have elucidated the policy required:

{
    "Action": "apigateway:POST",
    "Resource": "arn:aws:apigateway:us-east-1::/restapis/${rest_api_id}/deployments",
    "Effect": "Allow",
    "Sid": "AllowApiGatewayDeployments"
}

It may not be possible to limit the deployment to a given stage, but I don't know because I haven't tested this.

Upvotes: 2

Related Questions