Amazon EventBridge

2022/04/07 - Amazon EventBridge - 5 new 1 updated api methods

Changes  Adds new EventBridge Endpoint resources for disaster recovery, multi-region failover, and cross-region replication capabilities to help you build resilient event-driven applications.

UpdateEndpoint (new) Link ¶

Update an existing endpoint. For more information about global endpoints, see Making applications Regional-fault tolerant with global endpoints and event replication in the Amazon EventBridge User Guide..

See also: AWS API Documentation

Request Syntax

client.update_endpoint(
    Name='string',
    Description='string',
    RoutingConfig={
        'FailoverConfig': {
            'Primary': {
                'HealthCheck': 'string'
            },
            'Secondary': {
                'Route': 'string'
            }
        }
    },
    ReplicationConfig={
        'State': 'ENABLED'|'DISABLED'
    },
    EventBuses=[
        {
            'EventBusArn': 'string'
        },
    ],
    RoleArn='string'
)
type Name

string

param Name

[REQUIRED]

The name of the endpoint you want to update.

type Description

string

param Description

A description for the endpoint.

type RoutingConfig

dict

param RoutingConfig

Configure the routing policy, including the health check and secondary Region..

  • FailoverConfig (dict) -- [REQUIRED]

    The failover configuration for an endpoint. This includes what triggers failover and what happens when it's triggered.

    • Primary (dict) -- [REQUIRED]

      The main Region of the endpoint.

      • HealthCheck (string) -- [REQUIRED]

        The ARN of the health check used by the endpoint to determine whether failover is triggered.

    • Secondary (dict) -- [REQUIRED]

      The Region that events are routed to when failover is triggered or event replication is enabled.

      • Route (string) -- [REQUIRED]

        Defines the secondary Region.

type ReplicationConfig

dict

param ReplicationConfig

Whether event replication was enabled or disabled by this request.

  • State (string) --

    The state of event replication.

type EventBuses

list

param EventBuses

Define event buses used for replication.

  • (dict) --

    The event buses the endpoint is associated with.

    • EventBusArn (string) -- [REQUIRED]

      The ARN of the event bus the endpoint is associated with.

type RoleArn

string

param RoleArn

The ARN of the role used by event replication for this request.

rtype

dict

returns

Response Syntax

{
    'Name': 'string',
    'Arn': 'string',
    'RoutingConfig': {
        'FailoverConfig': {
            'Primary': {
                'HealthCheck': 'string'
            },
            'Secondary': {
                'Route': 'string'
            }
        }
    },
    'ReplicationConfig': {
        'State': 'ENABLED'|'DISABLED'
    },
    'EventBuses': [
        {
            'EventBusArn': 'string'
        },
    ],
    'RoleArn': 'string',
    'EndpointId': 'string',
    'EndpointUrl': 'string',
    'State': 'ACTIVE'|'CREATING'|'UPDATING'|'DELETING'|'CREATE_FAILED'|'UPDATE_FAILED'|'DELETE_FAILED'
}

Response Structure

  • (dict) --

    • Name (string) --

      The name of the endpoint you updated in this request.

    • Arn (string) --

      The ARN of the endpoint you updated in this request.

    • RoutingConfig (dict) --

      The routing configuration you updated in this request.

      • FailoverConfig (dict) --

        The failover configuration for an endpoint. This includes what triggers failover and what happens when it's triggered.

        • Primary (dict) --

          The main Region of the endpoint.

          • HealthCheck (string) --

            The ARN of the health check used by the endpoint to determine whether failover is triggered.

        • Secondary (dict) --

          The Region that events are routed to when failover is triggered or event replication is enabled.

          • Route (string) --

            Defines the secondary Region.

    • ReplicationConfig (dict) --

      Whether event replication was enabled or disabled for the endpoint you updated in this request.

      • State (string) --

        The state of event replication.

    • EventBuses (list) --

      The event buses used for replication for the endpoint you updated in this request.

      • (dict) --

        The event buses the endpoint is associated with.

        • EventBusArn (string) --

          The ARN of the event bus the endpoint is associated with.

    • RoleArn (string) --

      The ARN of the role used by event replication for the endpoint you updated in this request.

    • EndpointId (string) --

      The ID of the endpoint you updated in this request.

    • EndpointUrl (string) --

      The URL of the endpoint you updated in this request.

    • State (string) --

      The state of the endpoint you updated in this request.

CreateEndpoint (new) Link ¶

Creates a global endpoint. Global endpoints improve your application's availability by making it regional-fault tolerant. To do this, you define a primary and secondary Region with event buses in each Region. You also create a Amazon Route 53 health check that will tell EventBridge to route events to the secondary Region when an "unhealthy" state is encountered and events will be routed back to the primary Region when the health check reports a "healthy" state.

See also: AWS API Documentation

Request Syntax

client.create_endpoint(
    Name='string',
    Description='string',
    RoutingConfig={
        'FailoverConfig': {
            'Primary': {
                'HealthCheck': 'string'
            },
            'Secondary': {
                'Route': 'string'
            }
        }
    },
    ReplicationConfig={
        'State': 'ENABLED'|'DISABLED'
    },
    EventBuses=[
        {
            'EventBusArn': 'string'
        },
    ],
    RoleArn='string'
)
type Name

string

param Name

[REQUIRED]

The name of the global endpoint. For example, "Name":"us-east-2-custom_bus_A-endpoint" .

type Description

string

param Description

A description of the global endpoint.

type RoutingConfig

dict

param RoutingConfig

[REQUIRED]

Configure the routing policy, including the health check and secondary Region..

  • FailoverConfig (dict) -- [REQUIRED]

    The failover configuration for an endpoint. This includes what triggers failover and what happens when it's triggered.

    • Primary (dict) -- [REQUIRED]

      The main Region of the endpoint.

      • HealthCheck (string) -- [REQUIRED]

        The ARN of the health check used by the endpoint to determine whether failover is triggered.

    • Secondary (dict) -- [REQUIRED]

      The Region that events are routed to when failover is triggered or event replication is enabled.

      • Route (string) -- [REQUIRED]

        Defines the secondary Region.

type ReplicationConfig

dict

param ReplicationConfig

Enable or disable event replication.

  • State (string) --

    The state of event replication.

type EventBuses

list

param EventBuses

[REQUIRED]

Define the event buses used.

Warning

The names of the event buses must be identical in each Region.

  • (dict) --

    The event buses the endpoint is associated with.

    • EventBusArn (string) -- [REQUIRED]

      The ARN of the event bus the endpoint is associated with.

type RoleArn

string

param RoleArn

The ARN of the role used for replication.

rtype

dict

returns

Response Syntax

{
    'Name': 'string',
    'Arn': 'string',
    'RoutingConfig': {
        'FailoverConfig': {
            'Primary': {
                'HealthCheck': 'string'
            },
            'Secondary': {
                'Route': 'string'
            }
        }
    },
    'ReplicationConfig': {
        'State': 'ENABLED'|'DISABLED'
    },
    'EventBuses': [
        {
            'EventBusArn': 'string'
        },
    ],
    'RoleArn': 'string',
    'State': 'ACTIVE'|'CREATING'|'UPDATING'|'DELETING'|'CREATE_FAILED'|'UPDATE_FAILED'|'DELETE_FAILED'
}

Response Structure

  • (dict) --

    • Name (string) --

      The name of the endpoint that was created by this request.

    • Arn (string) --

      The ARN of the endpoint that was created by this request.

    • RoutingConfig (dict) --

      The routing configuration defined by this request.

      • FailoverConfig (dict) --

        The failover configuration for an endpoint. This includes what triggers failover and what happens when it's triggered.

        • Primary (dict) --

          The main Region of the endpoint.

          • HealthCheck (string) --

            The ARN of the health check used by the endpoint to determine whether failover is triggered.

        • Secondary (dict) --

          The Region that events are routed to when failover is triggered or event replication is enabled.

          • Route (string) --

            Defines the secondary Region.

    • ReplicationConfig (dict) --

      Whether event replication was enabled or disabled by this request.

      • State (string) --

        The state of event replication.

    • EventBuses (list) --

      The event buses used by this request.

      • (dict) --

        The event buses the endpoint is associated with.

        • EventBusArn (string) --

          The ARN of the event bus the endpoint is associated with.

    • RoleArn (string) --

      The ARN of the role used by event replication for this request.

    • State (string) --

      The state of the endpoint that was created by this request.

DeleteEndpoint (new) Link ¶

Delete an existing global endpoint. For more information about global endpoints, see Making applications Regional-fault tolerant with global endpoints and event replication in the Amazon EventBridge User Guide.

See also: AWS API Documentation

Request Syntax

client.delete_endpoint(
    Name='string'
)
type Name

string

param Name

[REQUIRED]

The name of the endpoint you want to delete. For example, "Name":"us-east-2-custom_bus_A-endpoint" ..

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

DescribeEndpoint (new) Link ¶

Get the information about an existing global endpoint. For more information about global endpoints, see Making applications Regional-fault tolerant with global endpoints and event replication in the Amazon EventBridge User Guide..

See also: AWS API Documentation

Request Syntax

client.describe_endpoint(
    Name='string',
    HomeRegion='string'
)
type Name

string

param Name

[REQUIRED]

The name of the endpoint you want to get information about. For example, "Name":"us-east-2-custom_bus_A-endpoint" .

type HomeRegion

string

param HomeRegion

The primary Region of the endpoint you want to get information about. For example "HomeRegion": "us-east-1" .

rtype

dict

returns

Response Syntax

{
    'Name': 'string',
    'Description': 'string',
    'Arn': 'string',
    'RoutingConfig': {
        'FailoverConfig': {
            'Primary': {
                'HealthCheck': 'string'
            },
            'Secondary': {
                'Route': 'string'
            }
        }
    },
    'ReplicationConfig': {
        'State': 'ENABLED'|'DISABLED'
    },
    'EventBuses': [
        {
            'EventBusArn': 'string'
        },
    ],
    'RoleArn': 'string',
    'EndpointId': 'string',
    'EndpointUrl': 'string',
    'State': 'ACTIVE'|'CREATING'|'UPDATING'|'DELETING'|'CREATE_FAILED'|'UPDATE_FAILED'|'DELETE_FAILED',
    'StateReason': 'string',
    'CreationTime': datetime(2015, 1, 1),
    'LastModifiedTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • Name (string) --

      The name of the endpoint you asked for information about.

    • Description (string) --

      The description of the endpoint you asked for information about.

    • Arn (string) --

      The ARN of the endpoint you asked for information about.

    • RoutingConfig (dict) --

      The routing configuration of the endpoint you asked for information about.

      • FailoverConfig (dict) --

        The failover configuration for an endpoint. This includes what triggers failover and what happens when it's triggered.

        • Primary (dict) --

          The main Region of the endpoint.

          • HealthCheck (string) --

            The ARN of the health check used by the endpoint to determine whether failover is triggered.

        • Secondary (dict) --

          The Region that events are routed to when failover is triggered or event replication is enabled.

          • Route (string) --

            Defines the secondary Region.

    • ReplicationConfig (dict) --

      Whether replication is enabled or disabled for the endpoint you asked for information about.

      • State (string) --

        The state of event replication.

    • EventBuses (list) --

      The event buses being used by the endpoint you asked for information about.

      • (dict) --

        The event buses the endpoint is associated with.

        • EventBusArn (string) --

          The ARN of the event bus the endpoint is associated with.

    • RoleArn (string) --

      The ARN of the role used by the endpoint you asked for information about.

    • EndpointId (string) --

      The ID of the endpoint you asked for information about.

    • EndpointUrl (string) --

      The URL of the endpoint you asked for information about.

    • State (string) --

      The current state of the endpoint you asked for information about.

    • StateReason (string) --

      The reason the endpoint you asked for information about is in its current state.

    • CreationTime (datetime) --

      The time the endpoint you asked for information about was created.

    • LastModifiedTime (datetime) --

      The last time the endpoint you asked for information about was modified.

ListEndpoints (new) Link ¶

List the global endpoints associated with this account. For more information about global endpoints, see Making applications Regional-fault tolerant with global endpoints and event replication in the Amazon EventBridge User Guide..

See also: AWS API Documentation

Request Syntax

client.list_endpoints(
    NamePrefix='string',
    HomeRegion='string',
    NextToken='string',
    MaxResults=123
)
type NamePrefix

string

param NamePrefix

A value that will return a subset of the endpoints associated with this account. For example, "NamePrefix": "ABC" will return all endpoints with "ABC" in the name.

type HomeRegion

string

param HomeRegion

The primary Region of the endpoints associated with this account. For example "HomeRegion": "us-east-1" .

type NextToken

string

param NextToken

If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

type MaxResults

integer

param MaxResults

The maximum number of results returned by the call.

rtype

dict

returns

Response Syntax

{
    'Endpoints': [
        {
            'Name': 'string',
            'Description': 'string',
            'Arn': 'string',
            'RoutingConfig': {
                'FailoverConfig': {
                    'Primary': {
                        'HealthCheck': 'string'
                    },
                    'Secondary': {
                        'Route': 'string'
                    }
                }
            },
            'ReplicationConfig': {
                'State': 'ENABLED'|'DISABLED'
            },
            'EventBuses': [
                {
                    'EventBusArn': 'string'
                },
            ],
            'RoleArn': 'string',
            'EndpointId': 'string',
            'EndpointUrl': 'string',
            'State': 'ACTIVE'|'CREATING'|'UPDATING'|'DELETING'|'CREATE_FAILED'|'UPDATE_FAILED'|'DELETE_FAILED',
            'StateReason': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'LastModifiedTime': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Endpoints (list) --

      The endpoints returned by the call.

      • (dict) --

        An global endpoint used to improve your application's availability by making it regional-fault tolerant. For more information about global endpoints, see Making applications Regional-fault tolerant with global endpoints and event replication in the Amazon EventBridge User Guide..

        • Name (string) --

          The name of the endpoint.

        • Description (string) --

          A description for the endpoint.

        • Arn (string) --

          The ARN of the endpoint.

        • RoutingConfig (dict) --

          The routing configuration of the endpoint.

          • FailoverConfig (dict) --

            The failover configuration for an endpoint. This includes what triggers failover and what happens when it's triggered.

            • Primary (dict) --

              The main Region of the endpoint.

              • HealthCheck (string) --

                The ARN of the health check used by the endpoint to determine whether failover is triggered.

            • Secondary (dict) --

              The Region that events are routed to when failover is triggered or event replication is enabled.

              • Route (string) --

                Defines the secondary Region.

        • ReplicationConfig (dict) --

          Whether event replication was enabled or disabled for this endpoint.

          • State (string) --

            The state of event replication.

        • EventBuses (list) --

          The event buses being used by the endpoint.

          • (dict) --

            The event buses the endpoint is associated with.

            • EventBusArn (string) --

              The ARN of the event bus the endpoint is associated with.

        • RoleArn (string) --

          The ARN of the role used by event replication for the endpoint.

        • EndpointId (string) --

          The URL subdomain of the endpoint. For example, if the URL for Endpoint is abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is abcde.veo .

        • EndpointUrl (string) --

          The URL of the endpoint.

        • State (string) --

          The current state of the endpoint.

        • StateReason (string) --

          The reason the endpoint is in its current state.

        • CreationTime (datetime) --

          The time the endpoint was created.

        • LastModifiedTime (datetime) --

          The last time the endpoint was modified.

    • NextToken (string) --

      If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

PutEvents (updated) Link ¶
Changes (request)
{'EndpointId': 'string'}

Sends custom events to Amazon EventBridge so that they can be matched to rules.

Note

PutEvents will only process nested JSON up to 1100 levels deep.

See also: AWS API Documentation

Request Syntax

client.put_events(
    Entries=[
        {
            'Time': datetime(2015, 1, 1),
            'Source': 'string',
            'Resources': [
                'string',
            ],
            'DetailType': 'string',
            'Detail': 'string',
            'EventBusName': 'string',
            'TraceHeader': 'string'
        },
    ],
    EndpointId='string'
)
type Entries

list

param Entries

[REQUIRED]

The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.

  • (dict) --

    Represents an event to be submitted.

    • Time (datetime) --

      The time stamp of the event, per RFC3339. If no time stamp is provided, the time stamp of the PutEvents call is used.

    • Source (string) --

      The source of the event.

    • Resources (list) --

      Amazon Web Services resources, identified by Amazon Resource Name (ARN), which the event primarily concerns. Any number, including zero, may be present.

      • (string) --

    • DetailType (string) --

      Free-form string used to decide what fields to expect in the event detail.

    • Detail (string) --

      A valid JSON object. There is no other schema imposed. The JSON object may contain fields and nested subobjects.

    • EventBusName (string) --

      The name or ARN of the event bus to receive the event. Only the rules that are associated with this event bus are used to match the event. If you omit this, the default event bus is used.

      Note

      If you're using a global endpoint with a custom bus, you must enter the name, not the ARN, of the event bus in either the primary or secondary Region here and the corresponding event bus in the other Region will be determined based on the endpoint referenced by the EndpointId .

    • TraceHeader (string) --

      An X-Ray trace header, which is an http header (X-Amzn-Trace-Id) that contains the trace-id associated with the event.

      To learn more about X-Ray trace headers, see Tracing header in the X-Ray Developer Guide.

type EndpointId

string

param EndpointId

The URL subdomain of the endpoint. For example, if the URL for Endpoint is abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is abcde.veo .

Warning

When using Java, you must include auth-crt on the class path.

rtype

dict

returns

Response Syntax

{
    'FailedEntryCount': 123,
    'Entries': [
        {
            'EventId': 'string',
            'ErrorCode': 'string',
            'ErrorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • FailedEntryCount (integer) --

      The number of failed entries.

    • Entries (list) --

      The successfully and unsuccessfully ingested events results. If the ingestion was successful, the entry has the event ID in it. Otherwise, you can use the error code and error message to identify the problem with the entry.

      • (dict) --

        Represents an event that failed to be submitted. For information about the errors that are common to all actions, see Common Errors.

        • EventId (string) --

          The ID of the event.

        • ErrorCode (string) --

          The error code that indicates why the event submission failed.

        • ErrorMessage (string) --

          The error message that explains why the event submission failed.