Class ApiDestination

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.events.targets.ApiDestination
All Implemented Interfaces:
IRuleTarget, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:07.470Z") @Stability(Stable) public class ApiDestination extends software.amazon.jsii.JsiiObject implements IRuleTarget
Use an API Destination rule target.

Example:

 Connection connection = Connection.Builder.create(this, "Connection")
         .authorization(Authorization.apiKey("x-api-key", SecretValue.secretsManager("ApiSecretName")))
         .description("Connection with API Key x-api-key")
         .build();
 ApiDestination destination = ApiDestination.Builder.create(this, "Destination")
         .connection(connection)
         .endpoint("https://example.com")
         .description("Calling example.com with API key x-api-key")
         .build();
 Rule rule = Rule.Builder.create(this, "Rule")
         .schedule(Schedule.rate(Duration.minutes(1)))
         .targets(List.of(new ApiDestination(destination)))
         .build();
 
  • Constructor Details

    • ApiDestination

      protected ApiDestination(software.amazon.jsii.JsiiObjectRef objRef)
    • ApiDestination

      protected ApiDestination(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • ApiDestination

      @Stability(Stable) public ApiDestination(@NotNull IApiDestination apiDestination, @Nullable ApiDestinationProps props)
      Parameters:
      apiDestination - This parameter is required.
      props -
    • ApiDestination

      @Stability(Stable) public ApiDestination(@NotNull IApiDestination apiDestination)
      Parameters:
      apiDestination - This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule _rule, @Nullable String _id)
      Returns a RuleTarget that can be used to trigger API destinations from an EventBridge event.

      Specified by:
      bind in interface IRuleTarget
      Parameters:
      _rule - This parameter is required.
      _id -
    • bind

      @Stability(Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule _rule)
      Returns a RuleTarget that can be used to trigger API destinations from an EventBridge event.

      Specified by:
      bind in interface IRuleTarget
      Parameters:
      _rule - This parameter is required.