How to find logs when submitting resource type to Cloudformation Registry?
I am developing a https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-private.html for AWS https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html . I have designed my model schema and developed my handler code, https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-walkthrough.html#resource-type-walkthrough-submit it, and even successfully deployed a stack with my very own private resource type. Yay.
What i need to do now is inspect the logging thereof. As I had generated the scaffolding using the cfn init command, i merely added logging entries to the existing logger object.
# Use this logger to forward log messages to CloudWatch Logs. LOG = logging.getLogger(__name__) TYPE_NAME = "Myself::Test::Resourceful"
resource = Resource(TYPE_NAME, ResourceModel)
test_entrypoint = resource.test_entrypoint
callback_context: MutableMapping[str, Any],
) -> ProgressEvent:
model = request.desiredResourceState
progress: ProgressEvent = ProgressEvent(
# TODO: put code here
According to the https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-develop.html#resource-type-develop-log ,
When you register a resource type using cfn submit, CloudFormation creates a CloudWatch log group for the resource type in your account. This enables you to access the logs for your resource to help you diagnose any faults. The log group is named according to the following pattern:
Now, when you initiate stack operations for stacks that contain the resource type, CloudFormation delivers log events emitted by the resource type to this log group.
When submitting my resource type however (and even deploying it), a cannot see any LogGroup created in CloudWatch whatsoever. There is clearly something i am missing here.
Please help me understand how to find the logging for my private Cloudformation registry resource types.
Of course, i will be happy to provide any additional info needed. Thank you!
Thanks to https://stackoverflow.com/a/72530077/20003774 , all i had to do was explicitly set an appropriate logging level.
# Use this logger to forward log messages to CloudWatch Logs.
LOG = logging.getLogger(name)
LOG.setLevel(logging.INFO) # <- this line was missing
When deploying stack, log groups appears. Yay.