Class AwsApiCall
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.integtests.alpha.ApiCallBase
software.amazon.awscdk.integtests.alpha.AwsApiCall
- All Implemented Interfaces:
IApiCall,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
- Direct Known Subclasses:
LambdaInvokeFunction
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-12T17:54:26.403Z")
@Stability(Experimental)
public class AwsApiCall
extends ApiCallBase
(experimental) Construct that creates a custom resource that will perform a query using the AWS SDK.
Example:
Stack stack;
AwsApiCall.Builder.create(stack, "MyAssertion")
.service("SQS")
.api("receiveMessage")
.parameters(Map.of(
"QueueUrl", "url"))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class(experimental) A fluent builder forAwsApiCall.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.integtests.alpha.IApiCall
IApiCall.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAwsApiCall(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedAwsApiCall(software.amazon.jsii.JsiiObjectRef objRef) AwsApiCall(software.constructs.Construct scope, String id, AwsApiCallProps props) -
Method Summary
Modifier and TypeMethodDescriptionassertAtPath(String path, ExpectedResult expected) (experimental) Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.protected CustomResource(experimental) access the AssertionsProvider.(experimental) access the AssertionsProvider for the waiter state machine.void(experimental) access the AssertionsProvider for the waiter state machine.(experimental) Wait for the IApiCall to return the expected response.(experimental) Wait for the IApiCall to return the expected response.Methods inherited from class software.amazon.awscdk.integtests.alpha.ApiCallBase
expect, getAtt, getAttString, getExpectedResult, getFlattenResponse, getOutputPaths, getStateMachineArn, next, setExpectedResult, setFlattenResponse, setOutputPaths, setStateMachineArnMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
AwsApiCall
protected AwsApiCall(software.amazon.jsii.JsiiObjectRef objRef) -
AwsApiCall
protected AwsApiCall(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
AwsApiCall
@Stability(Experimental) public AwsApiCall(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull AwsApiCallProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
assertAtPath
@Stability(Experimental) @NotNull public IApiCall assertAtPath(@NotNull String path, @NotNull ExpectedResult expected) (experimental) Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.Providing a path will filter the output of the initial API call.
For example the SQS.receiveMessage api response would look like:
If you wanted to assert the value of
Bodyyou could do- Specified by:
assertAtPathin interfaceIApiCall- Specified by:
assertAtPathin classApiCallBase- Parameters:
path- This parameter is required.expected- This parameter is required.
-
waitForAssertions
@Stability(Experimental) @NotNull public IApiCall waitForAssertions(@Nullable WaiterStateMachineOptions options) (experimental) Wait for the IApiCall to return the expected response.If no expected response is specified then it will wait for the IApiCall to return a success
- Specified by:
waitForAssertionsin interfaceIApiCall- Specified by:
waitForAssertionsin classApiCallBase- Parameters:
options-
-
waitForAssertions
(experimental) Wait for the IApiCall to return the expected response.If no expected response is specified then it will wait for the IApiCall to return a success
- Specified by:
waitForAssertionsin interfaceIApiCall- Specified by:
waitForAssertionsin classApiCallBase
-
getApiCallResource
- Specified by:
getApiCallResourcein classApiCallBase
-
getProvider
(experimental) access the AssertionsProvider.This can be used to add additional IAM policies the the provider role policy
- Specified by:
getProviderin interfaceIApiCall- Specified by:
getProviderin classApiCallBase
-
getWaiterProvider
(experimental) access the AssertionsProvider for the waiter state machine.This can be used to add additional IAM policies the the provider role policy
Example:
AwsApiCall apiCall; apiCall.waiterProvider.addToRolePolicy(Map.of( "Effect", "Allow", "Action", List.of("s3:GetObject"), "Resource", List.of("*"))); -
setWaiterProvider
(experimental) access the AssertionsProvider for the waiter state machine.This can be used to add additional IAM policies the the provider role policy
Example:
AwsApiCall apiCall; apiCall.waiterProvider.addToRolePolicy(Map.of( "Effect", "Allow", "Action", List.of("s3:GetObject"), "Resource", List.of("*")));
-