Class SessionTagsPrincipal
Enables session tags on role assumptions from a principal.
public class SessionTagsPrincipal : PrincipalBase, IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
- Inheritance
-
SessionTagsPrincipal
- Implements
- Inherited Members
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IAM;
IPrincipal principal;
var sessionTagsPrincipal = new SessionTagsPrincipal(principal);
Remarks
For more information on session tags, see: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
ExampleMetadata: fixture=_generated
Constructors
SessionTagsPrincipal(IPrincipal)
public SessionTagsPrincipal(IPrincipal principal)
Parameters
principal
IPrincipal
Properties
AssumeRoleAction
When this Principal is used in an AssumeRole policy, the action to use.
public override string AssumeRoleAction { get; }
Property Value
PolicyFragment
Return the policy fragment that identifies this principal in a Policy.
public override PrincipalPolicyFragment PolicyFragment { get; }
Property Value
PrincipalAccount
The AWS account ID of this principal.
public override string? PrincipalAccount { get; }
Property Value
Remarks
Can be undefined when the account is not known (for example, for service principals). Can be a Token - in that case, it's assumed to be AWS::AccountId.
Methods
AddToAssumeRolePolicy(PolicyDocument)
Add the princpial to the AssumeRolePolicyDocument.
public override void AddToAssumeRolePolicy(PolicyDocument doc)
Parameters
doc
PolicyDocument
Remarks
Add the statements to the AssumeRolePolicyDocument necessary to give this principal permissions to assume the given role.
AddToPolicy(PolicyStatement)
Add to the policy of this principal.
public override bool AddToPolicy(PolicyStatement statement)
Parameters
statement
PolicyStatement
Returns
AddToPrincipalPolicy(PolicyStatement)
Add to the policy of this principal.
public override IAddToPrincipalPolicyResult AddToPrincipalPolicy(PolicyStatement statement)
Parameters
statement
PolicyStatement
Returns
AppendDedupe(string)
Append the given string to the wrapped principal's dedupe string (if available).
protected virtual string? AppendDedupe(string append)
Parameters
append
string
Returns
DedupeString()
Return whether or not this principal is equal to the given principal.
public override string? DedupeString()