[{"data":1,"prerenderedAt":32},["ShallowReactive",2],{"snippet-restrict-deployment-to-apigw-stage":3},{"id":4,"title":5,"contributors":6,"description":8,"extension":9,"gitHub":10,"introBox":13,"languages":17,"meta":19,"resources":20,"services":21,"snippets":24,"stem":28,"tags":29,"type":30,"__hash__":31},"snippets\u002Fsnippets\u002Frestrict-deployment-to-apigw-stage.json","IAM Policy to restrict deployment to particular API stage",[7],"content\u002Fcontributors\u002Fabhishek-agawane.json","Using this policy a user access can be restricted to deploy API only to particular stage(s)","json",{"template":11},{"repoURL":12},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-snippets\u002Ftree\u002Fmain\u002Frestrict-deployment-to-apigw-stage",{"headline":14,"text":15},"How it works",[16],"The IAM policy allows deployment action only on the dev stage and not on other stages like prod.",[18],"JSON",{},null,[22,23],"apigw","iam",[25],{"title":26,"language":18,"code":27},"Limit stage deployment to authorized user","{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"VisualEditor0\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"apigateway:POST\",\n            \"Resource\": [\n                \"arn:aws:apigateway:us-east-1::\u002Frestapis\u002F&#60;api-id&#62;\u002Fdeployments\"\n            ],\n            \"Condition\": {\n                \"ForAnyValue:StringEquals\": {\n                    \"apigateway:Request\u002FStageName\": \"dev\"\n                }\n            }\n        }\n    ]\n}\n","snippets\u002Frestrict-deployment-to-apigw-stage",[],"Integration","n_UUaW8-SXpVqcOynxmVwTG6a9QPCkw7mcvBVQ9tQV8",1790678110184]