Amazon CloudWatch Logs

2015/07/28 - Amazon CloudWatch Logs - 4 new api methods

PutDestination (new) Link ¶

Creates or updates a Destination . A destination encapsulates a physical resource (such as a Kinesis stream) and allows you to subscribe to a real-time stream of log events of a different account, ingested through PutLogEvents requests. Currently, the only supported physical resource is a Amazon Kinesis stream belonging to the same account as the destination.

A destination controls what is written to its Amazon Kinesis stream through an access policy. By default, PutDestination does not set any access policy with the destination, which means a cross-account user will not be able to call PutSubscriptionFilter against this destination. To enable that, the destination owner must call PutDestinationPolicy after PutDestination.

Request Syntax

client.put_destination(
    destinationName='string',
    targetArn='string',
    roleArn='string'
)
type destinationName

string

param destinationName

[REQUIRED]

A name for the destination.

type targetArn

string

param targetArn

[REQUIRED]

The ARN of an Amazon Kinesis stream to deliver matching log events to.

type roleArn

string

param roleArn

[REQUIRED]

The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to do Amazon Kinesis PutRecord requests on the desitnation stream.

rtype

dict

returns

Response Syntax

{
    'destination': {
        'destinationName': 'string',
        'targetArn': 'string',
        'roleArn': 'string',
        'accessPolicy': 'string',
        'arn': 'string',
        'creationTime': 123
    }
}

Response Structure

  • (dict) --

    • destination (dict) --

      • destinationName (string) --

      • targetArn (string) --

      • roleArn (string) --

      • accessPolicy (string) --

      • arn (string) --

      • creationTime (integer) --

        A point in time expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.

DescribeDestinations (new) Link ¶

Returns all the destinations that are associated with the AWS account making the request. The list returned in the response is ASCII-sorted by destination name.

By default, this operation returns up to 50 destinations. If there are more destinations to list, the response would contain a nextToken value in the response body. You can also limit the number of destinations returned in the response by specifying the limit parameter in the request.

Request Syntax

client.describe_destinations(
    DestinationNamePrefix='string',
    nextToken='string',
    limit=123
)
type DestinationNamePrefix

string

param DestinationNamePrefix

Will only return destinations that match the provided destinationNamePrefix. If you don't specify a value, no prefix is applied.

type nextToken

string

param nextToken

A string token used for pagination that points to the next page of results. It must be a value obtained from the response of the previous request. The token expires after 24 hours.

type limit

integer

param limit

The maximum number of results to return.

rtype

dict

returns

Response Syntax

{
    'destinations': [
        {
            'destinationName': 'string',
            'targetArn': 'string',
            'roleArn': 'string',
            'accessPolicy': 'string',
            'arn': 'string',
            'creationTime': 123
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • destinations (list) --

      • (dict) --

        • destinationName (string) --

        • targetArn (string) --

        • roleArn (string) --

        • accessPolicy (string) --

        • arn (string) --

        • creationTime (integer) --

          A point in time expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.

    • nextToken (string) --

      A string token used for pagination that points to the next page of results. It must be a value obtained from the response of the previous request. The token expires after 24 hours.

DeleteDestination (new) Link ¶

Deletes the destination with the specified name and eventually disables all the subscription filters that publish to it. This will not delete the physical resource encapsulated by the destination.

Request Syntax

client.delete_destination(
    destinationName='string'
)
type destinationName

string

param destinationName

[REQUIRED]

The name of destination to delete.

returns

None

PutDestinationPolicy (new) Link ¶

Creates or updates an access policy associated with an existing Destination . An access policy is an IAM policy document that is used to authorize claims to register a subscription filter against a given destination.

Request Syntax

client.put_destination_policy(
    destinationName='string',
    accessPolicy='string'
)
type destinationName

string

param destinationName

[REQUIRED]

A name for an existing destination.

type accessPolicy

string

param accessPolicy

[REQUIRED]

An IAM policy document that authorizes cross-account users to deliver their log events to associated destination.

returns

None