@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.790Z") @Stability(value=Stable) public class User extends Resource implements IIdentity, IUser
Example:
IChainable definition;
User user = new User(this, "MyUser");
StateMachine stateMachine = StateMachine.Builder.create(this, "StateMachine")
.definition(definition)
.build();
//give user permission to send task success to the state machine
stateMachine.grant(user, "states:SendTaskSuccess");
| Modifier and Type | Class and Description |
|---|---|
static class |
User.Builder
A fluent builder for
User. |
software.amazon.jsii.JsiiObject.InitializationModeIUser.Jsii$Default, IUser.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
User(software.constructs.Construct scope,
String id) |
|
User(software.constructs.Construct scope,
String id,
UserProps props) |
protected |
User(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
User(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addManagedPolicy(IManagedPolicy policy)
Attaches a managed policy to the user.
|
void |
addToGroup(IGroup group)
Adds this user to a group.
|
Boolean |
addToPolicy(PolicyStatement statement)
Add to the policy of this principal.
|
AddToPrincipalPolicyResult |
addToPrincipalPolicy(PolicyStatement statement)
Adds an IAM statement to the default policy.
|
void |
attachInlinePolicy(Policy policy)
Attaches a policy to this user.
|
static IUser |
fromUserArn(software.constructs.Construct scope,
String id,
String userArn)
Import an existing user given a user ARN.
|
static IUser |
fromUserAttributes(software.constructs.Construct scope,
String id,
UserAttributes attrs)
Import an existing user given user attributes.
|
static IUser |
fromUserName(software.constructs.Construct scope,
String id,
String userName)
Import an existing user given a username.
|
String |
getAssumeRoleAction()
When this Principal is used in an AssumeRole policy, the action to use.
|
IPrincipal |
getGrantPrincipal()
The principal to grant permissions to.
|
IManagedPolicy |
getPermissionsBoundary()
Returns the permissions boundary attached to this user.
|
PrincipalPolicyFragment |
getPolicyFragment()
Return the policy fragment that identifies this principal in a Policy.
|
String |
getPrincipalAccount()
The AWS account ID of this principal.
|
String |
getUserArn()
An attribute that represents the user's ARN.
|
String |
getUserName()
An attribute that represents the user name.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackprotected User(software.amazon.jsii.JsiiObjectRef objRef)
protected User(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public User(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
UserProps props)
scope - This parameter is required.id - This parameter is required.props - @Stability(value=Stable)
public User(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - This parameter is required.id - This parameter is required.@Stability(value=Stable) @NotNull public static IUser fromUserArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String userArn)
If the ARN comes from a Token, the User cannot have a path; if so, any attempt to reference its username will fail.
scope - construct scope. This parameter is required.id - construct id. This parameter is required.userArn - the ARN of an existing user to import. This parameter is required.@Stability(value=Stable) @NotNull public static IUser fromUserAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull UserAttributes attrs)
If the ARN comes from a Token, the User cannot have a path; if so, any attempt to reference its username will fail.
scope - construct scope. This parameter is required.id - construct id. This parameter is required.attrs - the attributes of the user to import. This parameter is required.@Stability(value=Stable) @NotNull public static IUser fromUserName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String userName)
scope - construct scope. This parameter is required.id - construct id. This parameter is required.userName - the username of the existing user to import. This parameter is required.@Stability(value=Stable)
public void addManagedPolicy(@NotNull
IManagedPolicy policy)
addManagedPolicy in interface IIdentitypolicy - The managed policy to attach. This parameter is required.@Stability(value=Stable)
public void addToGroup(@NotNull
IGroup group)
addToGroup in interface IUsergroup - This parameter is required.@Stability(value=Stable) @NotNull public Boolean addToPolicy(@NotNull PolicyStatement statement)
statement - This parameter is required.@Stability(value=Stable) @NotNull public AddToPrincipalPolicyResult addToPrincipalPolicy(@NotNull PolicyStatement statement)
addToPrincipalPolicy in interface IPrincipalstatement - This parameter is required.@Stability(value=Stable)
public void attachInlinePolicy(@NotNull
Policy policy)
attachInlinePolicy in interface IIdentitypolicy - This parameter is required.@Stability(value=Stable) @NotNull public String getAssumeRoleAction()
getAssumeRoleAction in interface IPrincipal@Stability(value=Stable) @NotNull public IPrincipal getGrantPrincipal()
getGrantPrincipal in interface IGrantable@Stability(value=Stable) @NotNull public PrincipalPolicyFragment getPolicyFragment()
getPolicyFragment in interface IPrincipal@Stability(value=Stable) @NotNull public String getUserArn()
getUserArn in interface IUser@Stability(value=Stable) @NotNull public String getUserName()
getUserName in interface IUser@Stability(value=Stable) @Nullable public IManagedPolicy getPermissionsBoundary()
@Stability(value=Stable) @Nullable public String getPrincipalAccount()
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.
getPrincipalAccount in interface IPrincipalCopyright © 2022. All rights reserved.