You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My resource has a property "SchemaHandlerPackage", which is both a required property and a writeOnlyProperty. I am running contract_create_delete on my resource. The create handler is invoked and returns success after creating the resource. I return all required properties and the primary ID in the resourceModel after creating the resource.
My create handler returns IN_PROGRESS two times because it takes sometime to create the resource. For these two calls, I see the "SchemaHandlerPackage" in the response(because I return it in the intermediate response as well), something like this(in rpdk.log):
I later found out that the writeOnlyProperties are removed before framing the request to the delete handler. By doing this, the writeOnlyProperty, which is also a required property is getting removed, hence the delete handler fails due to a validation error, which results in that contract test failure.
Hi,
My resource has a property "SchemaHandlerPackage", which is both a required property and a writeOnlyProperty. I am running contract_create_delete on my resource. The create handler is invoked and returns success after creating the resource. I return all required properties and the primary ID in the resourceModel after creating the resource.
My create handler returns IN_PROGRESS two times because it takes sometime to create the resource. For these two calls, I see the "SchemaHandlerPackage" in the response(because I return it in the intermediate response as well), something like this(in rpdk.log):
But when the handler returns success, the "SchemaHandlerPackage" is disappeared from the response, even though I set it in the code:
I later found out that the writeOnlyProperties are removed before framing the request to the delete handler. By doing this, the writeOnlyProperty, which is also a required property is getting removed, hence the delete handler fails due to a validation error, which results in that contract test failure.
Solution: Is the "required property validation" necessary for a delete handler? Checking for a Primary Id should be enough for a delete handler as per https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html#resource-type-test-contract-delete Or you can remove a writeOnlyProperty only if it's not a required property.
Thanks,
Uma
The text was updated successfully, but these errors were encountered: