Class CfnApiDestination

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:36.935Z") @Stability(Stable) public class CfnApiDestination extends CfnResource implements IInspectable
A CloudFormation AWS::Events::ApiDestination.

Creates an API destination, which is an HTTP invocation endpoint configured as a target for events.

When using ApiDesinations with OAuth authentication we recommend these best practices:

  • Create a secret in Secrets Manager with your OAuth credentials.
  • Reference that secret in your CloudFormation template for AWS::Events::Connection using CloudFormation dynamic reference syntax. For more information, see Secrets Manager secrets .

When the Connection resource is created the secret will be passed to EventBridge and stored in the customer account using “Service Linked Secrets,” effectively creating two secrets. This will minimize the cost because the original secret is only accessed when a CloudFormation template is created or updated, not every time an event is sent to the ApiDestination. The secret stored in the customer account by EventBridge is the one used for each event sent to the ApiDestination and AWS is responsible for the fees.

The secret stored in the customer account by EventBridge can’t be updated directly, only when a CloudFormation template is updated.

For examples of CloudFormation templates that use secrets, see Examples .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.events.*;
 CfnApiDestination cfnApiDestination = CfnApiDestination.Builder.create(this, "MyCfnApiDestination")
         .connectionArn("connectionArn")
         .httpMethod("httpMethod")
         .invocationEndpoint("invocationEndpoint")
         // the properties below are optional
         .description("description")
         .invocationRateLimitPerSecond(123)
         .name("name")
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnApiDestination

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

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

      @Stability(Stable) public CfnApiDestination(@NotNull Construct scope, @NotNull String id, @NotNull CfnApiDestinationProps props)
      Create a new AWS::Events::ApiDestination.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The ARN of the API destination that was created by the request.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getConnectionArn

      @Stability(Stable) @NotNull public String getConnectionArn()
      The ARN of the connection to use for the API destination.

      The destination endpoint must support the authorization type specified for the connection.

    • setConnectionArn

      @Stability(Stable) public void setConnectionArn(@NotNull String value)
      The ARN of the connection to use for the API destination.

      The destination endpoint must support the authorization type specified for the connection.

    • getHttpMethod

      @Stability(Stable) @NotNull public String getHttpMethod()
      The method to use for the request to the HTTP invocation endpoint.
    • setHttpMethod

      @Stability(Stable) public void setHttpMethod(@NotNull String value)
      The method to use for the request to the HTTP invocation endpoint.
    • getInvocationEndpoint

      @Stability(Stable) @NotNull public String getInvocationEndpoint()
      The URL to the HTTP invocation endpoint for the API destination.
    • setInvocationEndpoint

      @Stability(Stable) public void setInvocationEndpoint(@NotNull String value)
      The URL to the HTTP invocation endpoint for the API destination.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      A description for the API destination to create.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      A description for the API destination to create.
    • getInvocationRateLimitPerSecond

      @Stability(Stable) @Nullable public Number getInvocationRateLimitPerSecond()
      The maximum number of requests per second to send to the HTTP invocation endpoint.
    • setInvocationRateLimitPerSecond

      @Stability(Stable) public void setInvocationRateLimitPerSecond(@Nullable Number value)
      The maximum number of requests per second to send to the HTTP invocation endpoint.
    • getName

      @Stability(Stable) @Nullable public String getName()
      The name for the API destination to create.
    • setName

      @Stability(Stable) public void setName(@Nullable String value)
      The name for the API destination to create.