@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.709Z") @Stability(value=Stable) public class LogRetention extends software.constructs.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.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.logs.*;
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())
.removalPolicy(RemovalPolicy.DESTROY)
.role(role)
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
LogRetention.Builder
A fluent builder for
LogRetention. |
| Modifier | Constructor and Description |
|---|---|
|
LogRetention(software.constructs.Construct scope,
String id,
LogRetentionProps props) |
protected |
LogRetention(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
LogRetention(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getLogGroupArn()
The ARN of the LogGroup.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected LogRetention(software.amazon.jsii.JsiiObjectRef objRef)
protected LogRetention(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public LogRetention(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
LogRetentionProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public String getLogGroupArn()
Copyright © 2022. All rights reserved.