[{"data":1,"prerenderedAt":60},["ShallowReactive",2],{"pattern-apigw-execution-access-logs":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":15,"extension":16,"framework":17,"gitHub":18,"highlight":6,"introBox":24,"language":30,"level":31,"meta":32,"patternArch":33,"resources":47,"s3URL":6,"services":6,"stem":55,"testing":56,"videoId":6,"__hash__":59},"patterns\u002Fpatterns\u002Fapigw-execution-access-logs.json","Amazon API Gateway REST API to Amazon CloudWatch",null,{"text":8},[9],"Delete the stack: \u003Ccode>sam delete\u003C\u002Fcode>.",[11],"content\u002Fcontributors\u002Fnoor-bari.json",{"text":13},[14],"sam deploy","Create a REST API that has CloudWatch execution and access logs enabled.","json","AWS SAM",{"template":19},{"repoURL":20,"templateURL":21,"projectFolder":22,"templateFile":23},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fapigw-execution-access-logs","serverless-patterns\u002Fapigw-execution-access-logs","apigw-execution-access-logs","template.yaml",{"headline":25,"text":26},"How it works",[27,28,29],"A REST API is created that has an IAM role with managed policy 'AmazonAPIGatewayPushToCloudWatchLogs' which allows API Gateway to write CloudWatch logs to your account.","In the API stage, CloudWatch execution logs are enabled with INFO Log level selected as well as custom access logging to generate execution and access logs for all requests.","The API has a AWS Lambda function integration which returns 'Hello from Lambda' in response.","Python","200",{},{"icon1":34,"icon2":39,"line1":43},{"x":35,"y":36,"service":37,"label":38},20,50,"apigw","Amazon API Gateway",{"x":40,"y":36,"service":41,"label":42},80,"cloudwatch","Amazon CloudWatch",{"from":44,"to":45,"label":46},"icon1","icon2","",{"bullets":48},[49,52],{"text":50,"link":51},"Setting up CloudWatch logging for a REST API in API Gateway","https:\u002F\u002Fdocs.aws.amazon.com\u002Fapigateway\u002Flatest\u002Fdeveloperguide\u002Fset-up-logging.html",{"text":53,"link":54},"AmazonAPIGatewayPushToCloudWatchLogs","https:\u002F\u002Fdocs.aws.amazon.com\u002Faws-managed-policy\u002Flatest\u002Freference\u002FAmazonAPIGatewayPushToCloudWatchLogs.html","patterns\u002Fapigw-execution-access-logs",{"text":57},[58],"See the GitHub repo for detailed testing instructions.","QK4igriwWnL-SEagqXLIJ3S_fT6L9rpQXn4OG0EiUK4",1778846881846]