class Owner
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Cloud9.Alpha.Owner |
Go | github.com/aws/aws-cdk-go/awscdkcloud9alpha/v2#Owner |
Java | software.amazon.awscdk.services.cloud9.alpha.Owner |
Python | aws_cdk.aws_cloud9_alpha.Owner |
TypeScript (source) | @aws-cdk/aws-cloud9-alpha ยป Owner |
An environment owner.
Example
import * as iam from 'aws-cdk-lib/aws-iam';
declare const vpc: ec2.Vpc;
new cloud9.Ec2Environment(this, 'C9Env', {
vpc,
imageId: cloud9.ImageId.AMAZON_LINUX_2,
owner: cloud9.Owner.federatedUser(Stack.of(this).account, "Admin/johndoe")
})
Properties
Name | Type | Description |
---|---|---|
owner | string | of environment owner. |
ownerArn
Type:
string
of environment owner.
Methods
Name | Description |
---|---|
static account | Make the Account Root User the environment owner (not recommended). |
static assumed | Make an IAM assumed role the environment owner. |
static federated | Make an IAM federated user the environment owner. |
static user(user) | Make an IAM user the environment owner. |
Root(accountId)
static accountpublic static accountRoot(accountId: string): Owner
Parameters
- accountId
string
โ the AccountId to use as the environment owner.
Returns
Make the Account Root User the environment owner (not recommended).
Role(accountId, roleName)
static assumedpublic static assumedRole(accountId: string, roleName: string): Owner
Parameters
- accountId
string
โ The account id of the target account. - roleName
string
โ The name of the assumed role.
Returns
Make an IAM assumed role the environment owner.
User(accountId, userName)
static federatedpublic static federatedUser(accountId: string, userName: string): Owner
Parameters
- accountId
string
โ The AccountId of the target account. - userName
string
โ The name of the federated user.
Returns
Make an IAM federated user the environment owner.
static user(user)
public static user(user: IUser): Owner
Parameters
- user
IUser
โ the User object to use as the environment owner.
Returns
Make an IAM user the environment owner.
User need to have AWSCloud9Administrator permissions