Class Tags
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.assertions.Tags
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-21T06:34:02.306Z")
@Stability(Stable)
public class Tags
extends software.amazon.jsii.JsiiObject
Allows assertions on the tags associated with a synthesized CDK stack's manifest.
Stack tags are not part of the synthesized template, so can only be checked from the manifest in this manner.
Example:
Tags tags = Tags.fromStack(stack);
// using a default 'objectLike' Matcher
tags.hasValues(Map.of(
"tag-name", "tag-value"));
// ... with Matchers embedded
tags.hasValues(Map.of(
"tag-name", Match.stringLikeRegexp("value")));
// or another object Matcher at the top level
tags.hasValues(Match.objectEquals(Map.of(
"tag-name", Match.anyValue())));
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionall()Get the tags associated with the manifest.static TagsFind tags associated with a synthesized CDKStack.voidhasNone()Assert that the there are no tags associated with the synthesized CDK Stack's manifest.voidAssert that the given Matcher or object matches the tags associated with the synthesized CDK Stack's manifest.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Tags
protected Tags(software.amazon.jsii.JsiiObjectRef objRef) -
Tags
protected Tags(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
fromStack
Find tags associated with a synthesized CDKStack.- Parameters:
stack- the CDK Stack to find tags on. This parameter is required.
-
all
Get the tags associated with the manifest.This will be an empty object if no tags were supplied.
- Returns:
- The tags associated with the stack's synthesized manifest.
-
hasNone
@Stability(Stable) public void hasNone()Assert that the there are no tags associated with the synthesized CDK Stack's manifest.This is a convenience method over
hasValues(Match.exact({})), and is present because the more obvious method of detecting no tags (Match.absent()) will not work. Manifests default the tag set to an empty object. -
hasValues
Assert that the given Matcher or object matches the tags associated with the synthesized CDK Stack's manifest.- Parameters:
tags- the expected set of tags. This parameter is required.
-