public class Tag extends Object implements Serializable
You can pass custom key-value pair attributes when you assume a role or federate a user. These are called session tags. You can then use the session tags to control access to resources. For more information, see Tagging AWS STS Sessions in the IAM User Guide.
| Constructor and Description |
|---|
Tag() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getKey()
The key for a session tag.
|
String |
getValue()
The value for a session tag.
|
int |
hashCode() |
void |
setKey(String key)
The key for a session tag.
|
void |
setValue(String value)
The value for a session tag.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Tag |
withKey(String key)
The key for a session tag.
|
Tag |
withValue(String value)
The value for a session tag.
|
public String getKey()
The key for a session tag.
You can pass up to 50 session tags. The plain text session tag keys can’t exceed 128 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
Constraints:
Length: 1 - 128
Pattern: [\p{L}\p{Z}\p{N}_.:/=+\-@]+
The key for a session tag.
You can pass up to 50 session tags. The plain text session tag keys can’t exceed 128 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
public void setKey(String key)
The key for a session tag.
You can pass up to 50 session tags. The plain text session tag keys can’t exceed 128 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
Constraints:
Length: 1 - 128
Pattern: [\p{L}\p{Z}\p{N}_.:/=+\-@]+
key - The key for a session tag.
You can pass up to 50 session tags. The plain text session tag keys can’t exceed 128 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
public Tag withKey(String key)
The key for a session tag.
You can pass up to 50 session tags. The plain text session tag keys can’t exceed 128 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 128
Pattern: [\p{L}\p{Z}\p{N}_.:/=+\-@]+
key - The key for a session tag.
You can pass up to 50 session tags. The plain text session tag keys can’t exceed 128 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
public String getValue()
The value for a session tag.
You can pass up to 50 session tags. The plain text session tag values can’t exceed 256 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
Constraints:
Length: 0 - 256
Pattern: [\p{L}\p{Z}\p{N}_.:/=+\-@]*
The value for a session tag.
You can pass up to 50 session tags. The plain text session tag values can’t exceed 256 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
public void setValue(String value)
The value for a session tag.
You can pass up to 50 session tags. The plain text session tag values can’t exceed 256 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
Constraints:
Length: 0 - 256
Pattern: [\p{L}\p{Z}\p{N}_.:/=+\-@]*
value - The value for a session tag.
You can pass up to 50 session tags. The plain text session tag values can’t exceed 256 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
public Tag withValue(String value)
The value for a session tag.
You can pass up to 50 session tags. The plain text session tag values can’t exceed 256 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 0 - 256
Pattern: [\p{L}\p{Z}\p{N}_.:/=+\-@]*
value - The value for a session tag.
You can pass up to 50 session tags. The plain text session tag values can’t exceed 256 characters. For these and additional limits, see IAM and STS Character Limits in the IAM User Guide.
public String toString()
toString in class ObjectObject.toString()Copyright © 2019. All rights reserved.