AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Creates a log group with the specified name. You can create up to 1,000,000 log groups per Region per account.

You must use the following guidelines when naming a log group:

When you create a log group, by default the log events in the log group do not expire. To set a retention policy so that events expire and are deleted after a specified time, use PutRetentionPolicy.

If you associate an KMS key with the log group, ingested data is encrypted using the KMS key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs. This enables CloudWatch Logs to decrypt this data whenever it is requested.

If you attempt to associate a KMS key with the log group but the KMS key does not exist or the KMS key is disabled, you receive an InvalidParameterException error.

CloudWatch Logs supports only symmetric KMS keys. Do not associate an asymmetric KMS key with your log group. For more information, see Using Symmetric and Asymmetric Keys.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to CreateLogGroupAsync.

Namespace: Amazon.CloudWatchLogs
Assembly: AWSSDK.CloudWatchLogs.dll
Version: 3.x.y.z

Syntax

C#
public virtual CreateLogGroupResponse CreateLogGroup(
         CreateLogGroupRequest request
)

Parameters

request
Type: Amazon.CloudWatchLogs.Model.CreateLogGroupRequest

Container for the necessary parameters to execute the CreateLogGroup service method.

Return Value


The response from the CreateLogGroup service method, as returned by CloudWatchLogs.

Exceptions

ExceptionCondition
InvalidParameterException A parameter is specified incorrectly.
LimitExceededException You have reached the maximum number of resources that can be created.
OperationAbortedException Multiple concurrent requests to update the same resource were in conflict.
ResourceAlreadyExistsException The specified resource already exists.
ServiceUnavailableException The service cannot complete the request.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

See Also