Class LogRetentionProps
Construction properties for a LogRetention.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class LogRetentionProps : Object, ILogRetentionProps
Syntax (vb)
Public Class LogRetentionProps
Inherits Object
Implements ILogRetentionProps
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.Logs;
Role role;
var logRetentionProps = new LogRetentionProps {
LogGroupName = "logGroupName",
Retention = RetentionDays.ONE_DAY,
// the properties below are optional
LogGroupRegion = "logGroupRegion",
LogRetentionRetryOptions = new LogRetentionRetryOptions {
Base = Duration.Minutes(30),
MaxRetries = 123
},
RemovalPolicy = RemovalPolicy.DESTROY,
Role = role
};
Synopsis
Constructors
LogRetentionProps() |
Properties
LogGroupName | The log group name. |
LogGroupRegion | The region where the log group should be created. |
LogRetentionRetryOptions | Retry options for all AWS API calls. |
RemovalPolicy | The removalPolicy for the log group when the stack is deleted. |
Retention | The number of days log events are kept in CloudWatch Logs. |
Role | The IAM role for the Lambda function associated with the custom resource. |
Constructors
LogRetentionProps()
public LogRetentionProps()
Properties
LogGroupName
The log group name.
public string LogGroupName { get; set; }
Property Value
System.String
LogGroupRegion
The region where the log group should be created.
public string LogGroupRegion { get; set; }
Property Value
System.String
Remarks
Default: - same region as the stack
LogRetentionRetryOptions
Retry options for all AWS API calls.
public ILogRetentionRetryOptions LogRetentionRetryOptions { get; set; }
Property Value
Remarks
Default: - AWS SDK default retry options
RemovalPolicy
The removalPolicy for the log group when the stack is deleted.
public Nullable<RemovalPolicy> RemovalPolicy { get; set; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
Default: RemovalPolicy.RETAIN
Retention
The number of days log events are kept in CloudWatch Logs.
public RetentionDays Retention { get; set; }
Property Value
Role
The IAM role for the Lambda function associated with the custom resource.
public IRole Role { get; set; }
Property Value
Remarks
Default: - A new role is created