Skip to content

Сustomizing resources generated by Chalice (and cdk-chalice respectively) #15

Description

@natCyberark

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions