Class SessionTagsPrincipal
Enables session tags on role assumptions from a principal.
Inherited Members
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class SessionTagsPrincipal : PrincipalBase, IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
Syntax (vb)
Public Class SessionTagsPrincipal Inherits PrincipalBase Implements IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
Remarks
For more information on session tags, see: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
ExampleMetadata: fixture=_generated
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);
Synopsis
Constructors
SessionTagsPrincipal(IPrincipal) | Enables session tags on role assumptions from a principal. |
Properties
AssumeRoleAction | When this Principal is used in an AssumeRole policy, the action to use. |
PolicyFragment | Return the policy fragment that identifies this principal in a Policy. |
PrincipalAccount | The AWS account ID of this principal. |
Methods
AddToAssumeRolePolicy(PolicyDocument) | Add the principal to the AssumeRolePolicyDocument. |
AddToPolicy(PolicyStatement) | Add to the policy of this principal. |
AddToPrincipalPolicy(PolicyStatement) | Add to the policy of this principal. |
AppendDedupe(string) | Append the given string to the wrapped principal's dedupe string (if available). |
DedupeString() | Return whether or not this principal is equal to the given principal. |
Constructors
SessionTagsPrincipal(IPrincipal)
Enables session tags on role assumptions from a principal.
public SessionTagsPrincipal(IPrincipal principal)
Parameters
- principal IPrincipal
Remarks
For more information on session tags, see: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
ExampleMetadata: fixture=_generated
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);
Properties
AssumeRoleAction
When this Principal is used in an AssumeRole policy, the action to use.
public override string AssumeRoleAction { get; }
Property Value
Overrides
Remarks
For more information on session tags, see: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
ExampleMetadata: fixture=_generated
PolicyFragment
Return the policy fragment that identifies this principal in a Policy.
public override PrincipalPolicyFragment PolicyFragment { get; }
Property Value
Overrides
Remarks
For more information on session tags, see: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
ExampleMetadata: fixture=_generated
PrincipalAccount
The AWS account ID of this principal.
public override string? PrincipalAccount { get; }
Property Value
Overrides
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 principal to the AssumeRolePolicyDocument.
public override void AddToAssumeRolePolicy(PolicyDocument doc)
Parameters
- doc PolicyDocument
Overrides
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
Overrides
Remarks
For more information on session tags, see: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
ExampleMetadata: fixture=_generated
AddToPrincipalPolicy(PolicyStatement)
Add to the policy of this principal.
public override IAddToPrincipalPolicyResult AddToPrincipalPolicy(PolicyStatement statement)
Parameters
- statement PolicyStatement
Returns
Overrides
Remarks
For more information on session tags, see: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
ExampleMetadata: fixture=_generated
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
Remarks
For more information on session tags, see: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
ExampleMetadata: fixture=_generated
DedupeString()
Return whether or not this principal is equal to the given principal.
public override string? DedupeString()
Returns
Overrides
Remarks
For more information on session tags, see: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
ExampleMetadata: fixture=_generated