Amazon CloudWatch Events

2017/06/29 - Amazon CloudWatch Events - 3 new api methods

Changes  Update events client to latest version

RemovePermission (new) Link ¶

Revokes the permission of another AWS account to be able to put events to your default event bus. Specify the account to revoke by the StatementId value that you associated with the account when you granted it permission with PutPermission. You can find the StatementId by using DescribeEventBus.

See also: AWS API Documentation

Request Syntax

client.remove_permission(
    StatementId='string'
)
type StatementId:

string

param StatementId:

[REQUIRED]

The statement ID corresponding to the account that is no longer allowed to put events to the default event bus.

returns:

None

DescribeEventBus (new) Link ¶

Displays the external AWS accounts that are permitted to write events to your account using your account's event bus, and the associated policy. To enable your account to receive events from other accounts, use PutPermission.

See also: AWS API Documentation

Request Syntax

client.describe_event_bus()
rtype:

dict

returns:

Response Syntax

{
    'Name': 'string',
    'Arn': 'string',
    'Policy': 'string'
}

Response Structure

  • (dict) --

    • Name (string) --

      The name of the event bus. Currently, this is always default.

    • Arn (string) --

      The Amazon Resource Name (ARN) of the account permitted to write events to the current account.

    • Policy (string) --

      The policy that enables the external account to send events to your account.

PutPermission (new) Link ¶

Running PutPermission permits the specified AWS account to put events to your account's default event bus. CloudWatch Events rules in your account are triggered by these events arriving to your default event bus.

For another account to send events to your account, that external account must have a CloudWatch Events rule with your account's default event bus as a target.

To enable multiple AWS accounts to put events to your default event bus, run PutPermission once for each of these accounts.

See also: AWS API Documentation

Request Syntax

client.put_permission(
    Action='string',
    Principal='string',
    StatementId='string'
)
type Action:

string

param Action:

[REQUIRED]

The action that you are enabling the other account to perform. Currently, this must be events:PutEvents.

type Principal:

string

param Principal:

[REQUIRED]

The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify "*" to permit any account to put events to your default event bus.

If you specify "*", avoid creating rules that may match undesirable events. To create more secure rules, make sure that the event pattern for each rule contains an account field with a specific account ID from which to receive events. Rules with an account field do not match any events sent from other accounts.

type StatementId:

string

param StatementId:

[REQUIRED]

An identifier string for the external account that you are granting permissions to. If you later want to revoke the permission for this external account, specify this StatementId when you run RemovePermission.

returns:

None