Class Connection

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.events.Connection
All Implemented Interfaces:
IResource, IConnection, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-22T22:42:51.990Z") @Stability(Stable) public class Connection extends Resource implements IConnection
Define an EventBridge Connection.

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

    • Connection

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

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

      @Stability(Stable) public Connection(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ConnectionProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromConnectionAttributes

      @Stability(Stable) @NotNull public static IConnection fromConnectionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ConnectionAttributes attrs)
      Import an existing connection resource.

      Parameters:
      scope - Parent construct. This parameter is required.
      id - Construct ID. This parameter is required.
      attrs - Imported connection properties. This parameter is required.
    • fromEventBusArn

      @Stability(Stable) @NotNull public static IConnection fromEventBusArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String connectionArn, @NotNull String connectionSecretArn)
      Import an existing connection resource.

      Parameters:
      scope - Parent construct. This parameter is required.
      id - Construct ID. This parameter is required.
      connectionArn - ARN of imported connection. This parameter is required.
      connectionSecretArn - This parameter is required.
    • getConnectionArn

      @Stability(Stable) @NotNull public String getConnectionArn()
      The ARN of the connection created.
      Specified by:
      getConnectionArn in interface IConnection
    • getConnectionName

      @Stability(Stable) @NotNull public String getConnectionName()
      The Name for the connection.
      Specified by:
      getConnectionName in interface IConnection
    • getConnectionSecretArn

      @Stability(Stable) @NotNull public String getConnectionSecretArn()
      The ARN for the secret created for the connection.
      Specified by:
      getConnectionSecretArn in interface IConnection