amazonka-cloudwatch-logs-2.0: Amazon CloudWatch Logs SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.CloudWatchLogs.CreateLogGroup

Description

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

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

  • Log group names must be unique within a Region for an Amazon Web Services account.
  • Log group names can be between 1 and 512 characters long.
  • Log group names consist of the following characters: a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), '.' (period), and '#' (number sign)

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 keydoes 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.

Synopsis

Creating a Request

data CreateLogGroup Source #

See: newCreateLogGroup smart constructor.

Constructors

CreateLogGroup' 

Fields

Instances

Instances details
ToJSON CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

ToHeaders CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

ToPath CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

ToQuery CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

AWSRequest CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

Associated Types

type AWSResponse CreateLogGroup #

Generic CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

Associated Types

type Rep CreateLogGroup :: Type -> Type #

Read CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

Show CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

NFData CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

Methods

rnf :: CreateLogGroup -> () #

Eq CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

Hashable CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

type AWSResponse CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

type Rep CreateLogGroup Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

type Rep CreateLogGroup = D1 ('MetaData "CreateLogGroup" "Amazonka.CloudWatchLogs.CreateLogGroup" "amazonka-cloudwatch-logs-2.0-6gvDalNFsfE8djZ4aTfA4V" 'False) (C1 ('MetaCons "CreateLogGroup'" 'PrefixI 'True) (S1 ('MetaSel ('Just "kmsKeyId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (HashMap Text Text))) :*: S1 ('MetaSel ('Just "logGroupName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))

newCreateLogGroup Source #

Create a value of CreateLogGroup with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

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

$sel:tags:CreateLogGroup', createLogGroup_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.

CreateLogGroup, createLogGroup_logGroupName - The name of the log group.

Request Lenses

createLogGroup_kmsKeyId :: Lens' CreateLogGroup (Maybe Text) Source #

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

createLogGroup_tags :: Lens' CreateLogGroup (Maybe (HashMap Text Text)) Source #

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.

Destructuring the Response

data CreateLogGroupResponse Source #

See: newCreateLogGroupResponse smart constructor.

Instances

Instances details
Generic CreateLogGroupResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

Associated Types

type Rep CreateLogGroupResponse :: Type -> Type #

Read CreateLogGroupResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

Show CreateLogGroupResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

NFData CreateLogGroupResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

Methods

rnf :: CreateLogGroupResponse -> () #

Eq CreateLogGroupResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

type Rep CreateLogGroupResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateLogGroup

type Rep CreateLogGroupResponse = D1 ('MetaData "CreateLogGroupResponse" "Amazonka.CloudWatchLogs.CreateLogGroup" "amazonka-cloudwatch-logs-2.0-6gvDalNFsfE8djZ4aTfA4V" 'False) (C1 ('MetaCons "CreateLogGroupResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newCreateLogGroupResponse :: CreateLogGroupResponse Source #

Create a value of CreateLogGroupResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.