Class CfnTag
The AWS::LakeFormation::Tag
resource represents an LF-tag, which consists of a key and one or more possible values for the key.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.LakeFormation
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnTag : CfnResource, IInspectable
Syntax (vb)
Public Class CfnTag
Inherits CfnResource
Implements IInspectable
Remarks
During a stack operation, AWS CloudFormation calls the AWS Lake Formation CreateLFTag
API to create a tag, and UpdateLFTag
API to update a tag resource, and a DeleteLFTag
to delete it.
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lakeformation-tag.html
CloudformationResource: AWS::LakeFormation::Tag
ExampleMetadata: infused
Examples
using Amazon.CDK;
using Amazon.CDK.AWS.Glue.Alpha;
using Amazon.CDK.AWS.LakeFormation;
Stack stack;
string accountId;
var tagKey = "aws";
var tagValues = new [] { "dev" };
var database = new Database(this, "Database");
var table = new S3Table(this, "Table", new S3TableProps {
Database = database,
Columns = new [] { new Column {
Name = "col1",
Type = Schema.STRING
}, new Column {
Name = "col2",
Type = Schema.STRING
} },
DataFormat = DataFormat.CSV
});
var synthesizer = (DefaultStackSynthesizer)stack.Synthesizer;
new CfnDataLakeSettings(this, "DataLakeSettings", new CfnDataLakeSettingsProps {
Admins = new [] { new DataLakePrincipalProperty {
DataLakePrincipalIdentifier = stack.FormatArn(new ArnComponents {
Service = "iam",
Resource = "role",
Region = "",
Account = accountId,
ResourceName = "Admin"
})
}, new DataLakePrincipalProperty {
// The CDK cloudformation execution role.
DataLakePrincipalIdentifier = synthesizer.CloudFormationExecutionRoleArn.Replace("${AWS::Partition}", "aws")
} }
});
var tag = new CfnTag(this, "Tag", new CfnTagProps {
CatalogId = accountId,
TagKey = tagKey,
TagValues = tagValues
});
var lfTagPairProperty = new LFTagPairProperty {
CatalogId = accountId,
TagKey = tagKey,
TagValues = tagValues
};
var tagAssociation = new CfnTagAssociation(this, "TagAssociation", new CfnTagAssociationProps {
LfTags = new [] { lfTagPairProperty },
Resource = new ResourceProperty {
TableWithColumns = new TableWithColumnsResourceProperty {
DatabaseName = database.DatabaseName,
ColumnNames = new [] { "col1", "col2" },
CatalogId = accountId,
Name = table.TableName
}
}
});
tagAssociation.Node.AddDependency(tag);
tagAssociation.Node.AddDependency(table);
Synopsis
Constructors
CfnTag(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnTag(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnTag(Construct, String, ICfnTagProps) |
Properties
CatalogId | Catalog id string, not less than 1 or more than 255 bytes long, matching the single-line string pattern . |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
TagKey | UTF-8 string, not less than 1 or more than 255 bytes long, matching the single-line string pattern . |
TagValues | An array of UTF-8 strings, not less than 1 or more than 50 strings. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnTag(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnTag(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnTag(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnTag(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnTag(Construct, String, ICfnTagProps)
public CfnTag(Construct scope, string id, ICfnTagProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnTagProps
Resource properties.
Properties
CatalogId
Catalog id string, not less than 1 or more than 255 bytes long, matching the single-line string pattern .
public virtual string CatalogId { get; set; }
Property Value
System.String
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
TagKey
UTF-8 string, not less than 1 or more than 255 bytes long, matching the single-line string pattern .
public virtual string TagKey { get; set; }
Property Value
System.String
TagValues
An array of UTF-8 strings, not less than 1 or more than 50 strings.
public virtual string[] TagValues { get; set; }
Property Value
System.String[]
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>