interface IAssumeRolePrincipal
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.IAM.IAssumeRolePrincipal |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsiam#IAssumeRolePrincipal |
Java | software.amazon.awscdk.services.iam.IAssumeRolePrincipal |
Python | aws_cdk.aws_iam.IAssumeRolePrincipal |
TypeScript (source) | aws-cdk-lib » aws_iam » IAssumeRolePrincipal |
Implemented by
Account
, Account
, Any
, Arn
, Canonical
, Composite
, Federated
, Open
, Organization
, Principal
, Saml
, Saml
, Service
, Session
, Star
, Web
, Via
A type of principal that has more control over its own representation in AssumeRolePolicyDocuments.
More complex types of identity providers need more control over Role's policy documents
than simply { Effect: 'Allow', Action: 'AssumeRole', Principal: <Whatever> }
.
If that control is necessary, they can implement IAssumeRolePrincipal
to get full
access to a Role's AssumeRolePolicyDocument.
Properties
Name | Type | Description |
---|---|---|
assume | string | When this Principal is used in an AssumeRole policy, the action to use. |
grant | IPrincipal | The principal to grant permissions to. |
policy | Principal | Return the policy fragment that identifies this principal in a Policy. |
principal | string | The AWS account ID of this principal. |
assumeRoleAction
Type:
string
When this Principal is used in an AssumeRole policy, the action to use.
grantPrincipal
Type:
IPrincipal
The principal to grant permissions to.
policyFragment
Type:
Principal
Return the policy fragment that identifies this principal in a Policy.
principalAccount?
Type:
string
(optional)
The AWS account ID of this principal.
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
Name | Description |
---|---|
add | Add the principal to the AssumeRolePolicyDocument. |
add | Add to the policy of this principal. |
addToAssumeRolePolicy(document)
public addToAssumeRolePolicy(document: PolicyDocument): void
Parameters
- document
Policy
Document
Add the principal to the AssumeRolePolicyDocument.
Add the statements to the AssumeRolePolicyDocument necessary to give this principal permissions to assume the given role.
addToPrincipalPolicy(statement)
public addToPrincipalPolicy(statement: PolicyStatement): AddToPrincipalPolicyResult
Parameters
- statement
Policy
Statement
Returns
Add to the policy of this principal.