@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-25T18:29:02.512Z") public class LogRetention extends Construct
The log group is created if it doesn't already exist. The policy
is removed when retentionDays
is undefined
or equal to Infinity
.
Log group can be created in the region that is different from stack region by
specifying logGroupRegion
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.iam.*; import software.amazon.awscdk.services.logs.*; import software.amazon.awscdk.core.*; Role role; LogRetention logRetention = LogRetention.Builder.create(this, "MyLogRetention") .logGroupName("logGroupName") .retention(RetentionDays.ONE_DAY) // the properties below are optional .logGroupRegion("logGroupRegion") .logRetentionRetryOptions(LogRetentionRetryOptions.builder() .base(Duration.minutes(30)) .maxRetries(123) .build()) .role(role) .build();
Modifier and Type | Class and Description |
---|---|
static class |
LogRetention.Builder
A fluent builder for
LogRetention . |
IConstruct.Jsii$Default, IConstruct.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
LogRetention(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
LogRetention(software.amazon.jsii.JsiiObjectRef objRef) |
|
LogRetention(software.constructs.Construct scope,
java.lang.String id,
LogRetentionProps props) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getLogGroupArn()
The ARN of the LogGroup.
|
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
protected LogRetention(software.amazon.jsii.JsiiObjectRef objRef)
protected LogRetention(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public LogRetention(software.constructs.Construct scope, java.lang.String id, LogRetentionProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.