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.

Container for the parameters to the CreateLogGroup operation. 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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.CloudWatchLogs.AmazonCloudWatchLogsRequest
      Amazon.CloudWatchLogs.Model.CreateLogGroupRequest

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

Syntax

C#
public class CreateLogGroupRequest : AmazonCloudWatchLogsRequest
         IAmazonWebServiceRequest

The CreateLogGroupRequest type exposes the following members

Constructors

NameDescription
Public Method CreateLogGroupRequest()

Empty constructor used to set properties independently even when a simple constructor is available

Public Method CreateLogGroupRequest(string)

Instantiates CreateLogGroupRequest with the parameterized properties

Properties

NameTypeDescription
Public Property KmsKeyId System.String

Gets and sets the property KmsKeyId.

The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. For more information, see Amazon Resource Names.

Public Property LogGroupClass Amazon.CloudWatchLogs.LogGroupClass

Gets and sets the property LogGroupClass.

Use this parameter to specify the log group class for this log group. There are two classes:

  • The Standard log class supports all CloudWatch Logs features.

  • The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs lower costs.

If you omit this parameter, the default of STANDARD is used.

The value of logGroupClass can't be changed after a log group is created.

For details about the features supported by each class, see Log classes

Public Property LogGroupName System.String

Gets and sets the property LogGroupName.

A name for the log group.

Public Property Tags System.Collections.Generic.Dictionary<System.String, System.String>

Gets and sets the property Tags.

The key-value pairs to use for the tags.

You can grant users access to certain log groups while preventing them from accessing other log groups. To do so, tag your groups and use IAM policies that refer to those tags. To assign tags when you create a log group, you must have either the logs:TagResource or logs:TagLogGroup permission. For more information about tagging, see Tagging Amazon Web Services resources. For more information about using tags to control access, see Controlling access to Amazon Web Services resources using tags.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer, 3.5