Class CfnLogGroup
A CloudFormation AWS::Logs::LogGroup
.
Inherited Members
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.AWS.Logs.dll
Syntax (csharp)
public class CfnLogGroup : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnLogGroup
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
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:
CloudformationResource: AWS::Logs::LogGroup
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html
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",
LogGroupName = "logGroupName",
RetentionInDays = 123,
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
CfnLogGroup(Construct, String, ICfnLogGroupProps) | Create a new |
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 |
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. |
LogGroupName | The name of the log group. |
RetentionInDays | The number of days to retain the log events in the specified log group. |
Tags | 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(Construct, String, ICfnLogGroupProps)
Create a new AWS::Logs::LogGroup
.
public CfnLogGroup(Construct scope, string id, ICfnLogGroupProps props = null)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnLogGroupProps
- resource properties.
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
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
Remarks
A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data. When a user who does not have permission to view masked data views a log event that includes masked data, the sensitive data is replaced by asterisks.
For more information, including a list of types of data that can be audited and masked, see Protect sensitive log data with masking .
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
Remarks
To associate an AWS KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs . This enables CloudWatch Logs to decrypt this data whenever it is requested.
If you attempt to associate a KMS key with the log group but the KMS key doesn't exist or is deactivated, you will receive an InvalidParameterException
error.
Log group data is always encrypted in CloudWatch Logs . If you omit this key, the encryption does not use AWS KMS . For more information, see Encrypt log data in CloudWatch Logs using AWS Key Management Service
LogGroupName
The name of the log group.
public virtual string LogGroupName { get; set; }
Property Value
System.String
Remarks
If you don't specify a name, AWS CloudFormation generates a unique ID for the log group.
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>
Remarks
Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.
To set a log group so that its log events do not expire, use DeleteRetentionPolicy .
Tags
An array of key-value pairs to apply to the log group.
public virtual TagManager Tags { get; }
Property Value
Remarks
For more information, see Tag .
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>