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
// 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]
57
101
// for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html
58
-
.stabilize(this::stabilizedOnCreate)
59
-
.progress())
60
-
61
-
// STEP 3 [TODO: post create/stabilize update]
62
-
.then(progress ->
63
-
// If your resource is provisioned through multiple API calls, you will need to apply each subsequent update
// If your resource requires some form of stabilization (e.g. service does not provide strong consistency), you will need to ensure that your code
103
+
// accounts for any potential issues, so that a subsequent read/update requests will not cause any conflicts (e.g. NotFoundException/InvalidRequestException)
* If your resource requires some form of stabilization (e.g. service does not provide strong consistency), you will need to ensure that your code
134
-
* accounts for any potential issues, so that a subsequent read/update requests will not cause any conflicts (e.g. NotFoundException/InvalidRequestException)
135
-
* for more information -> https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html
136
-
* @param awsRequest the aws service request to create a resource
137
-
* @param awsResponse the aws service response to create a resource
138
-
* @param proxyClient the aws service client to make the call
139
-
* @param model resource model
140
-
* @param callbackContext callback context
141
-
* @return boolean state of stabilized or not
142
-
*/
143
-
privatebooleanstabilizedOnCreate(
144
-
finalAwsRequestawsRequest,
145
-
finalAwsResponseawsResponse,
146
-
finalProxyClient<SdkClient> proxyClient,
147
-
finalResourceModelmodel,
148
-
finalCallbackContextcallbackContext) {
149
-
150
-
// TODO: put your stabilization code here
151
-
152
-
finalbooleanstabilized = true;
153
-
logger.log(String.format("%s [%s] creation has stabilized: %s", ResourceModel.TYPE_NAME, model.getPrimaryIdentifier(), stabilized));
154
-
returnstabilized;
155
-
}
156
-
157
-
/**
158
-
* If your resource is provisioned through multiple API calls, you will need to apply each subsequent update
159
-
* step in a discrete call/stabilize chain to ensure the entire resource is provisioned as intended.
160
-
* @param awsRequest the aws service request to create a resource
161
-
* @param proxyClient the aws service client to make the call
162
-
* @return awsResponse create resource response
163
-
*/
164
-
privateAwsResponsepostCreate(
165
-
finalAwsRequestawsRequest,
166
-
finalProxyClient<SdkClient> proxyClient) {
167
-
AwsResponseawsResponse = null;
168
-
try {
169
-
170
-
// TODO: put your post creation resource update code here
171
-
172
-
} catch (finalAwsServiceExceptione) {
173
-
/*
174
-
* While the handler contract states that the handler must always return a progress event,
175
-
* you may throw any instance of BaseHandlerException, as the wrapper map it to a progress event.
176
-
* Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
0 commit comments