Class CfnTagAssociationProps
Properties for defining a CfnTagAssociation
.
Inheritance
System.Object
CfnTagAssociationProps
Implements
Namespace: Amazon.CDK.AWS.LakeFormation
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnTagAssociationProps : Object, ICfnTagAssociationProps
Syntax (vb)
Public Class CfnTagAssociationProps
Inherits Object
Implements ICfnTagAssociationProps
Remarks
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
CfnTagAssociationProps() |
Properties
LfTags | A structure containing an LF-tag key-value pair. |
Resource | UTF-8 string (valid values: |
Constructors
CfnTagAssociationProps()
public CfnTagAssociationProps()
Properties
LfTags
A structure containing an LF-tag key-value pair.
public object LfTags { get; set; }
Property Value
System.Object
Remarks
Resource
UTF-8 string (valid values: DATABASE | TABLE
).
public object Resource { get; set; }
Property Value
System.Object
Remarks
The resource for which the LF-tag policy applies.