interface IGroup
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.IAM.IGroup |
Java | software.amazon.awscdk.services.iam.IGroup |
Python | aws_cdk.aws_iam.IGroup |
TypeScript (source) | @aws-cdk/aws-iam » IGroup |
Implemented by
Group
Obtainable from
Group
.fromGroupArn()
, Group
.fromGroupName()
Represents an IAM Group.
See also: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html
Properties
Name | Type | Description |
---|---|---|
assume | string | When this Principal is used in an AssumeRole policy, the action to use. |
env | Resource | The environment this resource belongs to. |
grant | IPrincipal | The principal to grant permissions to. |
group | string | Returns the IAM Group ARN. |
group | string | Returns the IAM Group Name. |
node | Construct | The construct tree node for this construct. |
policy | Principal | Return the policy fragment that identifies this principal in a Policy. |
stack | Stack | The stack in which this resource is defined. |
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.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
grantPrincipal
Type:
IPrincipal
The principal to grant permissions to.
groupArn
Type:
string
Returns the IAM Group ARN.
groupName
Type:
string
Returns the IAM Group Name.
node
Type:
Construct
The construct tree node for this construct.
policyFragment
Type:
Principal
Return the policy fragment that identifies this principal in a Policy.
stack
Type:
Stack
The stack in which this resource is defined.
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 | Attaches a managed policy to this principal. |
add | Add to the policy of this principal. |
add | Add to the policy of this principal. |
apply | Apply the given removal policy to this resource. |
attach | Attaches an inline policy to this principal. |
ManagedPolicy(policy)
addpublic addManagedPolicy(policy: IManagedPolicy): void
Parameters
- policy
IManaged
— The managed policy.Policy
Attaches a managed policy to this principal.
ToPolicy(statement)
addpublic addToPolicy(statement: PolicyStatement): boolean
⚠️ Deprecated: Use addToPrincipalPolicy
instead.
Parameters
- statement
Policy
Statement
Returns
boolean
Add to the policy of this principal.
ToPrincipalPolicy(statement)
addpublic addToPrincipalPolicy(statement: PolicyStatement): AddToPrincipalPolicyResult
Parameters
- statement
Policy
Statement
Returns
Add to the policy of this principal.
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
InlinePolicy(policy)
attachpublic attachInlinePolicy(policy: Policy): void
Parameters
- policy
Policy
— The policy resource to attach to this principal [disable-awslint:ref-via-interface].
Attaches an inline policy to this principal.
This is the same as calling policy.addToXxx(principal)
.