@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.754Z") @Stability(value=Stable) public class CompositePrincipal extends PrincipalBase
A composite principal cannot have conditions. i.e. multiple ServicePrincipals that form a composite principal
Example:
Role role = Role.Builder.create(this, "MyRole")
.assumedBy(new CompositePrincipal(
new ServicePrincipal("ec2.amazonaws.com"),
new AccountPrincipal("1818188181818187272")))
.build();
software.amazon.jsii.JsiiObject.InitializationModeIAssumeRolePrincipal.Jsii$DefaultIComparablePrincipal.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
CompositePrincipal(IPrincipal... principals) |
protected |
CompositePrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CompositePrincipal(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
CompositePrincipal |
addPrincipals(IPrincipal... principals)
Adds IAM principals to the composite principal.
|
void |
addToAssumeRolePolicy(PolicyDocument doc)
Add the princpial to the AssumeRolePolicyDocument.
|
String |
dedupeString()
Return whether or not this principal is equal to the given principal.
|
String |
getAssumeRoleAction()
When this Principal is used in an AssumeRole policy, the action to use.
|
PrincipalPolicyFragment |
getPolicyFragment()
Return the policy fragment that identifies this principal in a Policy.
|
String |
toString()
Returns a string representation of an object.
|
addToPolicy, addToPrincipalPolicy, getGrantPrincipal, getPrincipalAccount, toJSON, withConditions, withSessionTagsprotected CompositePrincipal(software.amazon.jsii.JsiiObjectRef objRef)
protected CompositePrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CompositePrincipal(@NotNull
IPrincipal... principals)
principals - This parameter is required.@Stability(value=Stable) @NotNull public CompositePrincipal addPrincipals(@NotNull IPrincipal... principals)
Composite principals cannot have conditions.
principals - IAM principals that will be added to the composite principal. This parameter is required.@Stability(value=Stable)
public void addToAssumeRolePolicy(@NotNull
PolicyDocument doc)
Add the statements to the AssumeRolePolicyDocument necessary to give this principal permissions to assume the given role.
addToAssumeRolePolicy in interface IAssumeRolePrincipaladdToAssumeRolePolicy in class PrincipalBasedoc - This parameter is required.@Stability(value=Stable) @Nullable public String dedupeString()
dedupeString in interface IComparablePrincipaldedupeString in class PrincipalBase@Stability(value=Stable) @NotNull public String toString()
toString in class PrincipalBase@Stability(value=Stable) @NotNull public String getAssumeRoleAction()
getAssumeRoleAction in interface IPrincipalgetAssumeRoleAction in class PrincipalBase@Stability(value=Stable) @NotNull public PrincipalPolicyFragment getPolicyFragment()
getPolicyFragment in interface IPrincipalgetPolicyFragment in class PrincipalBaseCopyright © 2022. All rights reserved.