Hi !
We have a problem to enable API-Gateway logging in our cdk cloudformation template and providing it with role, that allows writing to cloudwatch.
We use chalice framework for building our lambda functions and because of it, we don't have direct access to API-Gateway configuration.
We added below code to cdk_chalice lib def _update_sam_template(self) :
functions = filter(
lambda resource: resource['Type'] == 'AWS::Serverless::Api',
sam_template['Resources'].values()
)
for function in functions:
function['Properties']['MethodSettings'] = [{
"DataTraceEnabled": True,
"HttpMethod": "*",
"LoggingLevel": "INFO",
"ResourcePath": "/* "
}
]
and it seemed to work.
Alex, as we agreed, I'm opening the issue, because you wanted to : "tackle it and see whether customizing resources generated by Chalice (and cdk-chalice respectively) can be made easier."
Thank you !
Natasha.
Hi !
We have a problem to enable API-Gateway logging in our cdk cloudformation template and providing it with role, that allows writing to cloudwatch.
We use chalice framework for building our lambda functions and because of it, we don't have direct access to API-Gateway configuration.
We added below code to cdk_chalice lib
def _update_sam_template(self):and it seemed to work.
Alex, as we agreed, I'm opening the issue, because you wanted to : "tackle it and see whether customizing resources generated by Chalice (and cdk-chalice respectively) can be made easier."
Thank you !
Natasha.