Logging

class aws_cdk.custom_resources.Logging(*, log_api_response_data=None)

Bases: object

A class used to configure Logging during AwsCustomResource SDK calls.

ExampleMetadata:

infused

Example:

get_parameter = cr.AwsCustomResource(self, "GetParameter",
    on_update=cr.AwsSdkCall(
        service="SSM",
        action="GetParameter",
        parameters={
            "Name": "my-parameter",
            "WithDecryption": True
        },
        physical_resource_id=cr.PhysicalResourceId.of(Date.now().to_string()),
        logging=cr.Logging.with_data_hidden()
    ),
    policy=cr.AwsCustomResourcePolicy.from_sdk_calls(
        resources=cr.AwsCustomResourcePolicy.ANY_RESOURCE
    )
)
Parameters:

log_api_response_data (Optional[bool]) – Whether or not to log data associated with the API call response. Default: true

Static Methods

classmethod all()

Enables logging of all logged data in the lambda handler.

This includes the event object, the API call response, all fields in the response object returned by the lambda, and any errors encountered.

Return type:

Logging

classmethod with_data_hidden()

Hides logging of data associated with the API call response.

This includes hiding the raw API call response and the Data field associated with the lambda handler response.

Return type:

Logging