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.97.0 (build 729de35)", date="2024-04-18T17:54:26.411Z") @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 myAppStack;
 AwsApiCall.Builder.create(myAppStack, "GetObject")
         .service("S3")
         .api("getObject")
         .build();
 
  • 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 Body you could do

      Specified by:
      assertAtPath in interface IApiCall
      Specified by:
      assertAtPath in class ApiCallBase
      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:
      waitForAssertions in interface IApiCall
      Specified by:
      waitForAssertions in class ApiCallBase
      Parameters:
      options -
    • waitForAssertions

      @Stability(Experimental) @NotNull public IApiCall 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:
      waitForAssertions in interface IApiCall
      Specified by:
      waitForAssertions in class ApiCallBase
    • getApiCallResource

      @Stability(Experimental) @NotNull protected CustomResource getApiCallResource()
      Specified by:
      getApiCallResource in class ApiCallBase
    • getProvider

      @Stability(Experimental) @NotNull public AssertionsProvider getProvider()
      (experimental) access the AssertionsProvider.

      This can be used to add additional IAM policies the the provider role policy

      Specified by:
      getProvider in interface IApiCall
      Specified by:
      getProvider in class ApiCallBase
    • getWaiterProvider

      @Stability(Experimental) @Nullable public AssertionsProvider 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

      @Stability(Experimental) public void setWaiterProvider(@Nullable AssertionsProvider value)
      (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("*")));