Table of Contents

Class Tag

Namespace
Amazon.CDK
Assembly
Amazon.CDK.dll

The Tag Aspect will handle adding a tag to this node and cascading tags to children.

public class Tag : DeputyBase, IAspect
Inheritance
Tag
Implements

Examples

// The code below shows an example of how to instantiate this type.
            // The values are placeholders you should change.
            using Amazon.CDK;
            var tag = new Tag("key", "value", new TagProps {
                ApplyToLaunchedInstances = false,
                ExcludeResourceTypes = new [] { "excludeResourceTypes" },
                IncludeResourceTypes = new [] { "includeResourceTypes" },
                Priority = 123
            });

Remarks

ExampleMetadata: fixture=_generated

Constructors

Tag(string, string, ITagProps?)

public Tag(string key, string value, ITagProps? props = null)

Parameters

key string
value string
props ITagProps

Properties

Key

The string key for the tag.

public virtual string Key { get; }

Property Value

string

Props

protected virtual ITagProps Props { get; }

Property Value

ITagProps

Value

The string value of the tag.

public virtual string Value { get; }

Property Value

string

Methods

Add(Construct, string, string, ITagProps?)

(deprecated) DEPRECATED: add tags to the node of a construct and all its the taggable children.

[Obsolete("use `Tags.of(scope).add()`")]
public static void Add(Construct scope, string key, string value, ITagProps? props = null)

Parameters

scope Construct
key string
value string
props ITagProps

Remarks

Stability: Deprecated

ApplyTag(ITaggable)

protected virtual void ApplyTag(ITaggable resource)

Parameters

resource ITaggable

Remove(Construct, string, ITagProps?)

(deprecated) DEPRECATED: remove tags to the node of a construct and all its the taggable children.

[Obsolete("use `Tags.of(scope).remove()`")]
public static void Remove(Construct scope, string key, ITagProps? props = null)

Parameters

scope Construct
key string
props ITagProps

Remarks

Stability: Deprecated

Visit(IConstruct)

All aspects can visit an IConstruct.

public virtual void Visit(IConstruct construct)

Parameters

construct IConstruct