Closed miparnisari closed 4 years ago
cfn test
passes in the latest commit.
- .done(this::constructResourceModelFromResponse);
+ .done(awsResponse -> ProgressEvent.<ResourceModel, CallbackContext>builder()
+ .status(OperationStatus.SUCCESS)
+ .resourceModel(Translator.translateFromReadResponse(awsResponse))
+ .build());
- .success();
+ .done(awsResponse -> ProgressEvent.<ResourceModel, CallbackContext>builder()
+ .status(OperationStatus.SUCCESS)
+ .resourceModel(model)
+ .build());
I also noticed & fixed a problem in the Update handler. Theoretically, PutMetricFilter
can throw ResourceNotFoundException. However in practice this doesn't happen. I had to add a call to Read before doing an Update to ensure that the resource actually exists before executing the update.
However, the integration tests are failing. I believe the Create handlers are being called twice for each test. The first call works & creates the resource but the second one fails because the resource already exists. Need to fix this now. Related to https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-cloudwatch/issues/5
Issue #, if available: N/A
Description of changes: I resurrected part of this PR and applied some changes. Used the guided version of the CFN CLI.
cfn test
passescreateOnly
property, you will get aNotUpdatable
error.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.