Class CfnLogGroup
The AWS::Logs::LogGroup
resource specifies a log group.
Inherited Members
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnLogGroup : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnLogGroup
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
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:
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html
CloudformationResource: AWS::Logs::LogGroup
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.AWS.Logs;
var dataProtectionPolicy;
var cfnLogGroup = new CfnLogGroup(this, "MyCfnLogGroup", new CfnLogGroupProps {
DataProtectionPolicy = dataProtectionPolicy,
KmsKeyId = "kmsKeyId",
LogGroupClass = "logGroupClass",
LogGroupName = "logGroupName",
RetentionInDays = 123,
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
CfnLogGroup(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnLogGroup(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnLogGroup(Construct, String, ICfnLogGroupProps) |
Properties
AttrArn | The ARN of the log group, such as |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
DataProtectionPolicy | Creates a data protection policy and assigns it to the log group. |
KmsKeyId | The Amazon Resource Name (ARN) of the AWS KMS key to use when encrypting log data. |
LogGroupClass | Specifies the log group class for this log group. |
LogGroupName | The name of the log group. |
RetentionInDays | The number of days to retain the log events in the specified log group. |
Tags | Tag Manager which manages the tags for this resource. |
TagsRaw | An array of key-value pairs to apply to the log group. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnLogGroup(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnLogGroup(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnLogGroup(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnLogGroup(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnLogGroup(Construct, String, ICfnLogGroupProps)
public CfnLogGroup(Construct scope, string id, ICfnLogGroupProps props = null)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnLogGroupProps
Resource properties.
Properties
AttrArn
The ARN of the log group, such as arn:aws:logs:us-west-1:123456789012:log-group:/mystack-testgroup-12ABC1AB12A1:*
.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Arn
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
DataProtectionPolicy
Creates a data protection policy and assigns it to the log group.
public virtual object DataProtectionPolicy { get; set; }
Property Value
System.Object
KmsKeyId
The Amazon Resource Name (ARN) of the AWS KMS key to use when encrypting log data.
public virtual string KmsKeyId { get; set; }
Property Value
System.String
LogGroupClass
Specifies the log group class for this log group.
public virtual string LogGroupClass { get; set; }
Property Value
System.String
Remarks
There are two classes:.
LogGroupName
The name of the log group.
public virtual string LogGroupName { get; set; }
Property Value
System.String
RetentionInDays
The number of days to retain the log events in the specified log group.
public virtual Nullable<double> RetentionInDays { get; set; }
Property Value
System.Nullable<System.Double>
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
An array of key-value pairs to apply to the log group.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfnTag[]
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>