Class CfnLogGroup
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.logs.CfnLogGroup
- All Implemented Interfaces:
IInspectable
,ITaggable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-12-11T23:26:35.959Z")
@Stability(Stable)
public class CfnLogGroup
extends CfnResource
implements IInspectable, ITaggable
The
AWS::Logs::LogGroup
resource specifies a log group.
A log group defines common properties for log streams, such as their retention and access control rules. Each log stream must belong to one log group.
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:
- Log group names must be unique within a Region for an AWS 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), and '.' (period).
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.logs.*; Object dataProtectionPolicy; CfnLogGroup cfnLogGroup = CfnLogGroup.Builder.create(this, "MyCfnLogGroup") .dataProtectionPolicy(dataProtectionPolicy) .kmsKeyId("kmsKeyId") .logGroupClass("logGroupClass") .logGroupName("logGroupName") .retentionInDays(123) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnLogGroup
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnLogGroup
(software.amazon.jsii.JsiiObjectRef objRef) CfnLogGroup
(software.constructs.Construct scope, String id) CfnLogGroup
(software.constructs.Construct scope, String id, CfnLogGroupProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe ARN of the log group, such asarn:aws:logs:us-west-1:123456789012:log-group:/mystack-testgroup-12ABC1AB12A1:*
.Creates a data protection policy and assigns it to the log group.The Amazon Resource Name (ARN) of the AWS KMS key to use when encrypting log data.Specifies the log group class for this log group.The name of the log group.The number of days to retain the log events in the specified log group.getTags()
Tag Manager which manages the tags for this resource.An array of key-value pairs to apply to the log group.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setDataProtectionPolicy
(Object value) Creates a data protection policy and assigns it to the log group.void
setKmsKeyId
(String value) The Amazon Resource Name (ARN) of the AWS KMS key to use when encrypting log data.void
setLogGroupClass
(String value) Specifies the log group class for this log group.void
setLogGroupName
(String value) The name of the log group.void
setRetentionInDays
(Number value) The number of days to retain the log events in the specified log group.void
setTagsRaw
(List<CfnTag> value) An array of key-value pairs to apply to the log group.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnLogGroup
protected CfnLogGroup(software.amazon.jsii.JsiiObjectRef objRef) -
CfnLogGroup
protected CfnLogGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnLogGroup
@Stability(Stable) public CfnLogGroup(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnLogGroupProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties.
-
CfnLogGroup
@Stability(Stable) public CfnLogGroup(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrArn
The ARN of the log group, such asarn:aws:logs:us-west-1:123456789012:log-group:/mystack-testgroup-12ABC1AB12A1:*
. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getDataProtectionPolicy
Creates a data protection policy and assigns it to the log group. -
setDataProtectionPolicy
Creates a data protection policy and assigns it to the log group. -
getKmsKeyId
The Amazon Resource Name (ARN) of the AWS KMS key to use when encrypting log data. -
setKmsKeyId
The Amazon Resource Name (ARN) of the AWS KMS key to use when encrypting log data. -
getLogGroupClass
Specifies the log group class for this log group.There are two classes:.
-
setLogGroupClass
Specifies the log group class for this log group.There are two classes:.
-
getLogGroupName
The name of the log group. -
setLogGroupName
The name of the log group. -
getRetentionInDays
The number of days to retain the log events in the specified log group. -
setRetentionInDays
The number of days to retain the log events in the specified log group. -
getTagsRaw
An array of key-value pairs to apply to the log group. -
setTagsRaw
An array of key-value pairs to apply to the log group.
-