PutDeliverySource - Amazon CloudWatch Logs
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

PutDeliverySource

Creates or updates a logical delivery source. A delivery source represents an Amazon resource that sends logs to an logs delivery destination. The destination can be CloudWatch Logs, Amazon S3, or Firehose.

To configure logs delivery between a delivery destination and an Amazon service that is supported as a delivery source, you must do the following:

  • Use PutDeliverySource to create a delivery source, which is a logical object that represents the resource that is actually sending the logs.

  • Use PutDeliveryDestination to create a delivery destination, which is a logical object that represents the actual delivery destination. For more information, see PutDeliveryDestination.

  • If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination.

  • Use CreateDelivery to create a delivery by pairing exactly one delivery source and one delivery destination. For more information, see CreateDelivery.

You can configure a single delivery source to send logs to multiple destinations by creating multiple deliveries. You can also create multiple deliveries to configure multiple delivery sources to send logs to the same delivery destination.

Only some Amazon services support being configured as a delivery source. These services are listed as Supported [V2 Permissions] in the table at Enabling logging from Amazon services.

If you use this operation to update an existing delivery source, all the current delivery source parameters are overwritten with the new parameter values that you specify.

Request Syntax

{ "logType": "string", "name": "string", "resourceArn": "string", "tags": { "string" : "string" } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

logType

Defines the type of log that the source is sending.

  • For Amazon CodeWhisperer, the valid value is EVENT_LOGS.

  • For IAM Identity Center, the valid value is ERROR_LOGS.

  • For Amazon WorkMail, the valid values are ACCESS_CONTROL_LOGS, AUTHENTICATION_LOGS, WORKMAIL_AVAILABILITY_PROVIDER_LOGS, and WORKMAIL_MAILBOX_ACCESS_LOGS.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: [\w]*

Required: Yes

name

A name for this delivery source. This name must be unique for all delivery sources in your account.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 60.

Pattern: [\w-]*

Required: Yes

resourceArn

The ARN of the Amazon resource that is generating and sending logs. For example, arn:aws:workmail:us-east-1:123456789012:organization/m-1234EXAMPLEabcd1234abcd1234abcd1234

Type: String

Required: Yes

tags

An optional list of key-value pairs to associate with the resource.

For more information about tagging, see Tagging Amazon resources

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$

Value Length Constraints: Maximum length of 256.

Value Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

Required: No

Response Syntax

{ "deliverySource": { "arn": "string", "logType": "string", "name": "string", "resourceArns": [ "string" ], "service": "string", "tags": { "string" : "string" } } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

deliverySource

A structure containing information about the delivery source that was just created or updated.

Type: DeliverySource object

Errors

For information about the errors that are common to all actions, see Common Errors.

ConflictException

This operation attempted to create a resource that already exists.

HTTP Status Code: 400

ResourceNotFoundException

The specified resource does not exist.

HTTP Status Code: 400

ServiceQuotaExceededException

This request exceeds a service quota.

HTTP Status Code: 400

ServiceUnavailableException

The service cannot complete the request.

HTTP Status Code: 500

ThrottlingException

The request was throttled because of quota limits.

HTTP Status Code: 400

ValidationException

One of the parameters for the request is not valid.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: