import { userWithAccessKey } from '@time-loop/cdk-user-with-access-key'
new userWithAccessKey.UserWithAccessKey(scope: Construct, id: Namer, props?: UserWithAccessKeyProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
multi-convention-namer.Namer |
No description. |
props |
@time-loop/cdk-user-with-access-key.userWithAccessKey.UserWithAccessKeyProps |
No description. |
- Type: constructs.Construct
- Type: multi-convention-namer.Namer
- Type: @time-loop/cdk-user-with-access-key.userWithAccessKey.UserWithAccessKeyProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
addManagedPolicy |
Attaches a managed policy to the user. |
addToGroup |
Adds this user to a group. |
addToPolicy |
Add to the policy of this principal. |
addToPrincipalPolicy |
Adds an IAM statement to the default policy. |
attachInlinePolicy |
Attaches a policy to this user. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
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
).
- Type: aws-cdk-lib.RemovalPolicy
public addManagedPolicy(policy: IManagedPolicy): void
Attaches a managed policy to the user.
- Type: aws-cdk-lib.aws_iam.IManagedPolicy
The managed policy to attach.
public addToGroup(group: IGroup): void
Adds this user to a group.
- Type: aws-cdk-lib.aws_iam.IGroup
public addToPolicy(statement: PolicyStatement): boolean
Add to the policy of this principal.
- Type: aws-cdk-lib.aws_iam.PolicyStatement
public addToPrincipalPolicy(statement: PolicyStatement): AddToPrincipalPolicyResult
Adds an IAM statement to the default policy.
- Type: aws-cdk-lib.aws_iam.PolicyStatement
public attachInlinePolicy(policy: Policy): void
Attaches a policy to this user.
- Type: aws-cdk-lib.aws_iam.Policy
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isResource |
Check whether the given construct is a Resource. |
fromUserArn |
Import an existing user given a user ARN. |
fromUserAttributes |
Import an existing user given user attributes. |
fromUserName |
Import an existing user given a username. |
import { userWithAccessKey } from '@time-loop/cdk-user-with-access-key'
userWithAccessKey.UserWithAccessKey.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
import { userWithAccessKey } from '@time-loop/cdk-user-with-access-key'
userWithAccessKey.UserWithAccessKey.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
import { userWithAccessKey } from '@time-loop/cdk-user-with-access-key'
userWithAccessKey.UserWithAccessKey.fromUserArn(scope: Construct, id: string, userArn: string)
Import an existing user given a user ARN.
If the ARN comes from a Token, the User cannot have a path; if so, any attempt to reference its username will fail.
- Type: constructs.Construct
construct scope.
- Type: string
construct id.
- Type: string
the ARN of an existing user to import.
import { userWithAccessKey } from '@time-loop/cdk-user-with-access-key'
userWithAccessKey.UserWithAccessKey.fromUserAttributes(scope: Construct, id: string, attrs: UserAttributes)
Import an existing user given user attributes.
If the ARN comes from a Token, the User cannot have a path; if so, any attempt to reference its username will fail.
- Type: constructs.Construct
construct scope.
- Type: string
construct id.
- Type: aws-cdk-lib.aws_iam.UserAttributes
the attributes of the user to import.
import { userWithAccessKey } from '@time-loop/cdk-user-with-access-key'
userWithAccessKey.UserWithAccessKey.fromUserName(scope: Construct, id: string, userName: string)
Import an existing user given a username.
- Type: constructs.Construct
construct scope.
- Type: string
construct id.
- Type: string
the username of the existing user to import.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
assumeRoleAction |
string |
When this Principal is used in an AssumeRole policy, the action to use. |
grantPrincipal |
aws-cdk-lib.aws_iam.IPrincipal |
The principal to grant permissions to. |
policyFragment |
aws-cdk-lib.aws_iam.PrincipalPolicyFragment |
Return the policy fragment that identifies this principal in a Policy. |
userArn |
string |
An attribute that represents the user's ARN. |
userName |
string |
An attribute that represents the user name. |
permissionsBoundary |
aws-cdk-lib.aws_iam.IManagedPolicy |
Returns the permissions boundary attached to this user. |
principalAccount |
string |
The AWS account ID of this principal. |
credentialsSecret |
aws-cdk-lib.aws_secretsmanager.ISecret |
No description. |
encryptionKey |
aws-cdk-lib.aws_kms.IKey |
No description. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
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.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly assumeRoleAction: string;
- Type: string
When this Principal is used in an AssumeRole policy, the action to use.
public readonly grantPrincipal: IPrincipal;
- Type: aws-cdk-lib.aws_iam.IPrincipal
The principal to grant permissions to.
public readonly policyFragment: PrincipalPolicyFragment;
- Type: aws-cdk-lib.aws_iam.PrincipalPolicyFragment
Return the policy fragment that identifies this principal in a Policy.
public readonly userArn: string;
- Type: string
An attribute that represents the user's ARN.
public readonly userName: string;
- Type: string
An attribute that represents the user name.
public readonly permissionsBoundary: IManagedPolicy;
- Type: aws-cdk-lib.aws_iam.IManagedPolicy
Returns the permissions boundary attached to this user.
public readonly principalAccount: string;
- Type: string
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.
public readonly credentialsSecret: ISecret;
- Type: aws-cdk-lib.aws_secretsmanager.ISecret
public readonly encryptionKey: IKey;
- Type: aws-cdk-lib.aws_kms.IKey
We must use this interface because otherwise, using strictly aws_iam.IGrantable
results in cyclic dependencies if the grantable resource is created in the same Stack as the secret. Yeah, it's ugly...but it's what we've got to work with.
import { userWithAccessKey } from '@time-loop/cdk-user-with-access-key'
const secretGrantees: userWithAccessKey.SecretGrantees = { ... }
Name | Type | Description |
---|---|---|
groups |
aws-cdk-lib.aws_iam.IGroup[] |
No description. |
roles |
aws-cdk-lib.aws_iam.IRole[] |
No description. |
users |
aws-cdk-lib.aws_iam.IUser[] |
No description. |
public readonly groups: IGroup[];
- Type: aws-cdk-lib.aws_iam.IGroup[]
- Default: []
public readonly roles: IRole[];
- Type: aws-cdk-lib.aws_iam.IRole[]
- Default: []
public readonly users: IUser[];
- Type: aws-cdk-lib.aws_iam.IUser[]
- Default: []
import { userWithAccessKey } from '@time-loop/cdk-user-with-access-key'
const userWithAccessKeyProps: userWithAccessKey.UserWithAccessKeyProps = { ... }
Name | Type | Description |
---|---|---|
groups |
aws-cdk-lib.aws_iam.IGroup[] |
Groups to add this user to. |
managedPolicies |
aws-cdk-lib.aws_iam.IManagedPolicy[] |
A list of managed policies associated with this role. |
password |
aws-cdk-lib.SecretValue |
The password for the user. This is required so the user can access the AWS Management Console. |
passwordResetRequired |
boolean |
Specifies whether the user is required to set a new password the next time the user logs in to the AWS Management Console. |
path |
string |
The path for the user name. |
permissionsBoundary |
aws-cdk-lib.aws_iam.IManagedPolicy |
AWS supports permissions boundaries for IAM entities (users or roles). |
userName |
string |
A name for the IAM user. |
encryptionKey |
aws-cdk-lib.aws_kms.IKey |
No description. |
grantees |
@time-loop/cdk-user-with-access-key.userWithAccessKey.SecretGrantees |
Would you like us to grant read on the credentialsSecret to anyone? |
secretName |
string |
No description. |
public readonly groups: IGroup[];
- Type: aws-cdk-lib.aws_iam.IGroup[]
- Default: No groups.
Groups to add this user to.
You can also use addToGroup
to add this
user to a group.
public readonly managedPolicies: IManagedPolicy[];
- Type: aws-cdk-lib.aws_iam.IManagedPolicy[]
- Default: No managed policies.
A list of managed policies associated with this role.
You can add managed policies later using
addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName(policyName))
.
public readonly password: SecretValue;
- Type: aws-cdk-lib.SecretValue
- Default: User won't be able to access the management console without a password.
The password for the user. This is required so the user can access the AWS Management Console.
You can use SecretValue.unsafePlainText
to specify a password in plain text or
use secretsmanager.Secret.fromSecretAttributes
to reference a secret in
Secrets Manager.
public readonly passwordResetRequired: boolean;
- Type: boolean
- Default: false
Specifies whether the user is required to set a new password the next time the user logs in to the AWS Management Console.
If this is set to 'true', you must also specify "initialPassword".
public readonly path: string;
- Type: string
- Default: /
The path for the user name.
For more information about paths, see IAM Identifiers in the IAM User Guide.
public readonly permissionsBoundary: IManagedPolicy;
- Type: aws-cdk-lib.aws_iam.IManagedPolicy
- Default: No permissions boundary.
AWS supports permissions boundaries for IAM entities (users or roles).
A permissions boundary is an advanced feature for using a managed policy to set the maximum permissions that an identity-based policy can grant to an IAM entity. An entity's permissions boundary allows it to perform only the actions that are allowed by both its identity-based policies and its permissions boundaries.
https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html
public readonly userName: string;
- Type: string
- Default: Generated by CloudFormation (recommended)
A name for the IAM user.
For valid values, see the UserName parameter for the CreateUser action in the IAM API Reference. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the user name.
If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
If you specify a name, you must specify the CAPABILITY_NAMED_IAM value to acknowledge your template's capabilities. For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
public readonly encryptionKey: IKey;
- Type: aws-cdk-lib.aws_kms.IKey
- Default: undefined - generate a KMS key.
public readonly grantees: SecretGrantees;
- Type: @time-loop/cdk-user-with-access-key.userWithAccessKey.SecretGrantees
- Default: [] - no grantees
Would you like us to grant read on the credentialsSecret to anyone?
public readonly secretName: string;
- Type: string
- Default: undefined - have CDK generate an ugly unique secret name