Class CustomDataIdentifier
A custom data identifier.
Inherited Members
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CustomDataIdentifier : DataIdentifier
Syntax (vb)
Public Class CustomDataIdentifier
Inherits DataIdentifier
Remarks
Include a custom data identifier name and regular expression in the JSON policy used to define the data protection policy.
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.KinesisFirehose.Alpha;
using Amazon.CDK.AWS.KinesisFirehose.Destinations.Alpha;
var logGroupDestination = new LogGroup(this, "LogGroupLambdaAudit", new LogGroupProps {
LogGroupName = "auditDestinationForCDK"
});
var bucket = new Bucket(this, "audit-bucket");
var s3Destination = new S3Bucket(bucket);
var deliveryStream = new DeliveryStream(this, "Delivery Stream", new DeliveryStreamProps {
Destinations = new [] { s3Destination }
});
var dataProtectionPolicy = new DataProtectionPolicy(new DataProtectionPolicyProps {
Name = "data protection policy",
Description = "policy description",
Identifiers = new [] { DataIdentifier.DRIVERSLICENSE_US, // managed data identifier
new DataIdentifier("EmailAddress"), // forward compatibility for new managed data identifiers
new CustomDataIdentifier("EmployeeId", "EmployeeId-\\d{9}") }, // custom data identifier
LogGroupAuditDestination = logGroupDestination,
S3BucketAuditDestination = bucket,
DeliveryStreamNameAuditDestination = deliveryStream.DeliveryStreamName
});
new LogGroup(this, "LogGroupLambda", new LogGroupProps {
LogGroupName = "cdkIntegLogGroup",
DataProtectionPolicy = dataProtectionPolicy
});
Synopsis
Constructors
CustomDataIdentifier(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CustomDataIdentifier(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CustomDataIdentifier(String, String) | Create a custom data identifier. |
Properties
Name | |
Regex |
Methods
ToString() | String representation of a CustomDataIdentifier. |
Constructors
CustomDataIdentifier(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CustomDataIdentifier(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CustomDataIdentifier(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CustomDataIdentifier(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CustomDataIdentifier(String, String)
Create a custom data identifier.
public CustomDataIdentifier(string name, string regex)
Parameters
- name System.String
- the name of the custom data identifier.
- regex System.String
- the regular expresssion to detect and mask log events for.
Properties
Name
- the name of the custom data identifier.
public override string Name { get; }
Property Value
System.String
Overrides
Remarks
This cannot share the same name as a managed data identifier.
Regex
- the regular expresssion to detect and mask log events for.
public virtual string Regex { get; }
Property Value
System.String
Methods
ToString()
String representation of a CustomDataIdentifier.
public override string ToString()
Returns
System.String
the name and RegEx of the custom data identifier