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
// if target API does not support 'ResourceAlreadyExistsException' then following check is required
40
-
// for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html#resource-type-test-contract-communication
40
+
// for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html
// STEP 2.3 [TODO: stabilize step is not necessarily required but typically involves describing the resource until it is in a certain status, though it can take many forms]
56
-
// for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html#resource-type-test-contract-communication
56
+
// for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html
// e.g. https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs/commit/ffb15c1a2ca6eb19c051d19d79c0f022719b1493#diff-cbc963180c54a3bf4965fff3f499f365R37-R43
106
106
107
+
} catch (finalAwsServiceExceptione) {
107
108
/*
108
109
* While the handler contract states that the handler must always return a progress event,
109
-
* you may throw any instance of BaseHandlerException (https://code.amazon.com/packages/AWSCloudFormationRPDKJavaPlugin/blobs/mainline/--/src/main/java/software/amazon/cloudformation/exceptions/BaseHandlerException.java),
110
-
* as the wrapper map it to a progress event. Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
111
-
* to more specific error codes (https://code.amazon.com/packages/AWSCloudFormationRPDKJavaPlugin/blobs/mainline/--/src/main/java/software/amazon/cloudformation/proxy/HandlerErrorCode.java)
110
+
* you may throw any instance of BaseHandlerException, as the wrapper map it to a progress event.
111
+
* Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
* If your resource requires some form of stabilization (e.g. service does not provide strong consistency), you will need to ensure that your code
123
123
* accounts for any potential issues, so that a subsequent read/update requests will not cause any conflicts (e.g. NotFoundException/InvalidRequestException)
124
-
* for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html#resource-type-test-contract-communication
124
+
* for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html
125
125
* @param awsRequest the aws service request to create a resource
126
126
* @param awsResponse the aws service response to create a resource
127
127
* @param proxyClient the aws service client to make the call
// TODO: put your post creation resource update code here
161
-
// e.g. https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs/commit/2077c92299aeb9a68ae8f4418b5e932b12a8b186#diff-c959c290785791b96fa4442573750fcdR69-R74
162
161
162
+
} catch (finalAwsServiceExceptione) {
163
163
/*
164
164
* While the handler contract states that the handler must always return a progress event,
165
-
* you may throw any instance of BaseHandlerException (https://code.amazon.com/packages/AWSCloudFormationRPDKJavaPlugin/blobs/mainline/--/src/main/java/software/amazon/cloudformation/exceptions/BaseHandlerException.java),
166
-
* as the wrapper map it to a progress event. Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
167
-
* to more specific error codes (https://code.amazon.com/packages/AWSCloudFormationRPDKJavaPlugin/blobs/mainline/--/src/main/java/software/amazon/cloudformation/proxy/HandlerErrorCode.java)
165
+
* you may throw any instance of BaseHandlerException, as the wrapper map it to a progress event.
166
+
* Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
// for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html#resource-type-test-contract-communication
37
+
// for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html
38
38
// if target API does not support 'ResourceNotFoundException' then following check is required
// STEP 2.3 [TODO: stabilize step is not necessarily required but typically involves describing the resource until it is in a certain status, though it can take many forms]
54
-
// for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html#resource-type-test-contract-communication
54
+
// for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html
// e.g. https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs/commit/2077c92299aeb9a68ae8f4418b5e932b12a8b186#diff-82aedf3b1de1e4a4948229fa3cac03f0R21-R30
97
100
101
+
} catch (finalAwsServiceExceptione) {
98
102
/*
99
103
* While the handler contract states that the handler must always return a progress event,
100
-
* you may throw any instance of BaseHandlerException (https://code.amazon.com/packages/AWSCloudFormationRPDKJavaPlugin/blobs/mainline/--/src/main/java/software/amazon/cloudformation/exceptions/BaseHandlerException.java),
101
-
* as the wrapper map it to a progress event. Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
102
-
* to more specific error codes (https://code.amazon.com/packages/AWSCloudFormationRPDKJavaPlugin/blobs/mainline/--/src/main/java/software/amazon/cloudformation/proxy/HandlerErrorCode.java)
104
+
* you may throw any instance of BaseHandlerException, as the wrapper map it to a progress event.
105
+
* Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
* If deletion of your resource requires some form of stabilization (e.g. propagation delay)
114
-
* for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html#resource-type-test-contract-communication
117
+
* for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html
115
118
* @param awsRequest the aws service request to delete a resource
116
119
* @param awsResponse the aws service response to delete a resource
117
120
* @param proxyClient the aws service client to make the call
// e.g. https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs/commit/2077c92299aeb9a68ae8f4418b5e932b12a8b186#diff-5761e3a9f732dc1ef84103dc4bc93399R41-R46
* While the handler contract states that the handler must always return a progress event,
66
+
* you may throw any instance of BaseHandlerException, as the wrapper map it to a progress event.
67
+
* Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
68
+
* to more specific error codes
69
+
*/
64
70
thrownewCfnGeneralServiceException(ResourceModel.TYPE_NAME, e); // e.g. https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs/commit/2077c92299aeb9a68ae8f4418b5e932b12a8b186#diff-5761e3a9f732dc1ef84103dc4bc93399R56-R63
// STEP 4 [TODO: stabilize step is not necessarily required but typically involves describing the resource until it is in a certain status, though it can take many forms]
43
43
// stabilization step may or may not be needed after each API call
44
-
// for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html#resource-type-test-contract-communication
44
+
// for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html
// e.g. https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs/commit/2077c92299aeb9a68ae8f4418b5e932b12a8b186#diff-c959c290785791b96fa4442573750fcdR69-R74
70
70
71
+
} catch (finalAwsServiceExceptione) {
71
72
/*
72
73
* While the handler contract states that the handler must always return a progress event,
73
-
* you may throw any instance of BaseHandlerException (https://code.amazon.com/packages/AWSCloudFormationRPDKJavaPlugin/blobs/mainline/--/src/main/java/software/amazon/cloudformation/exceptions/BaseHandlerException.java),
74
-
* as the wrapper map it to a progress event. Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
75
-
* to more specific error codes (https://code.amazon.com/packages/AWSCloudFormationRPDKJavaPlugin/blobs/mainline/--/src/main/java/software/amazon/cloudformation/proxy/HandlerErrorCode.java)
74
+
* you may throw any instance of BaseHandlerException, as the wrapper map it to a progress event.
75
+
* Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
* If your resource requires some form of stabilization (e.g. service does not provide strong consistency), you will need to ensure that your code
87
87
* accounts for any potential issues, so that a subsequent read/update requests will not cause any conflicts (e.g. NotFoundException/InvalidRequestException)
88
-
* for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html#resource-type-test-contract-communication
88
+
* for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html
89
89
* @param awsResponse the aws service update resource response
90
90
* @param proxyClient the aws service client to make the call
* While the handler contract states that the handler must always return a progress event,
128
-
* you may throw any instance of BaseHandlerException (https://code.amazon.com/packages/AWSCloudFormationRPDKJavaPlugin/blobs/mainline/--/src/main/java/software/amazon/cloudformation/exceptions/BaseHandlerException.java),
129
-
* as the wrapper map it to a progress event. Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
130
-
* to more specific error codes (https://code.amazon.com/packages/AWSCloudFormationRPDKJavaPlugin/blobs/mainline/--/src/main/java/software/amazon/cloudformation/proxy/HandlerErrorCode.java)
129
+
* you may throw any instance of BaseHandlerException, as the wrapper map it to a progress event.
130
+
* Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
0 commit comments