@aws-cdk_aws-cloud9-alpha.Ec2Environment

class Ec2Environment (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Cloud9.Alpha.Ec2Environment
Gogithub.com/aws/aws-cdk-go/awscdkcloud9alpha/v2#Ec2Environment
Javasoftware.amazon.awscdk.services.cloud9.alpha.Ec2Environment
Pythonaws_cdk.aws_cloud9_alpha.Ec2Environment
TypeScript (source)@aws-cdk/aws-cloud9-alpha ยป Ec2Environment

Implements IConstruct, IDependable, IResource, IEc2Environment

A Cloud9 Environment with Amazon EC2.

Example

import * as iam from 'aws-cdk-lib/aws-iam';

const user = new iam.User(this, 'user');
user.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('AWSCloud9Administrator'));
declare const vpc: ec2.Vpc;
new cloud9.Ec2Environment(this, 'C9Env', {
  vpc,
  imageId: cloud9.ImageId.AMAZON_LINUX_2,

  owner: cloud9.Owner.user(user)
})

Initializer

new Ec2Environment(scope: Construct, id: string, props: Ec2EnvironmentProps)

Parameters

  • scope Construct
  • id string
  • props Ec2EnvironmentProps

Construct Props

NameTypeDescription
imageId๐Ÿ”นImageIdThe image ID used for creating an Amazon EC2 environment.
vpc๐Ÿ”นIVpcThe VPC that AWS Cloud9 will use to communicate with the Amazon Elastic Compute Cloud (Amazon EC2) instance.
automaticStop?๐Ÿ”นDurationThe number of minutes until the running instance is shut down after the environment was last used.
clonedRepositories?๐Ÿ”นCloneRepository[]The AWS CodeCommit repository to be cloned.
connectionType?๐Ÿ”นConnectionTypeThe connection type used for connecting to an Amazon EC2 environment.
description?๐Ÿ”นstringDescription of the environment.
ec2EnvironmentName?๐Ÿ”นstringName of the environment.
instanceType?๐Ÿ”นInstanceTypeThe type of instance to connect to the environment.
owner?๐Ÿ”นOwnerOwner of the environment.
subnetSelection?๐Ÿ”นSubnetSelectionThe subnetSelection of the VPC that AWS Cloud9 will use to communicate with the Amazon EC2 instance.

imageId๐Ÿ”น

Type: ImageId

The image ID used for creating an Amazon EC2 environment.


vpc๐Ÿ”น

Type: IVpc

The VPC that AWS Cloud9 will use to communicate with the Amazon Elastic Compute Cloud (Amazon EC2) instance.


automaticStop?๐Ÿ”น

Type: Duration (optional, default: The instance will not be shut down automatically.)

The number of minutes until the running instance is shut down after the environment was last used.

Setting a value of 0 means the instance will never be automatically shut down."


clonedRepositories?๐Ÿ”น

Type: CloneRepository[] (optional, default: do not clone any repository)

The AWS CodeCommit repository to be cloned.


connectionType?๐Ÿ”น

Type: ConnectionType (optional, default: CONNECT_SSH)

The connection type used for connecting to an Amazon EC2 environment.

Valid values are: CONNECT_SSH (default) and CONNECT_SSM (connected through AWS Systems Manager)


description?๐Ÿ”น

Type: string (optional, default: no description)

Description of the environment.


ec2EnvironmentName?๐Ÿ”น

Type: string (optional, default: automatically generated name)

Name of the environment.


instanceType?๐Ÿ”น

Type: InstanceType (optional, default: t2.micro)

The type of instance to connect to the environment.


owner?๐Ÿ”น

Type: Owner (optional, default: The identity that CloudFormation executes under will be the owner)

Owner of the environment.

The owner has full control of the environment and can invite additional members.


subnetSelection?๐Ÿ”น

Type: SubnetSelection (optional, default: all public subnets of the VPC are selected.)

The subnetSelection of the VPC that AWS Cloud9 will use to communicate with the Amazon EC2 instance.

Properties

NameTypeDescription
ec2EnvironmentArn๐Ÿ”นstringThe environment ARN of this Cloud9 environment.
ec2EnvironmentName๐Ÿ”นstringThe environment name of this Cloud9 environment.
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
environmentId๐Ÿ”นstringThe environment ID of this Cloud9 environment.
ideUrl๐Ÿ”นstringThe complete IDE URL of this Cloud9 environment.
node๐Ÿ”นNodeThe tree node.
stack๐Ÿ”นStackThe stack in which this resource is defined.
vpc๐Ÿ”นIVpcVPC ID.

ec2EnvironmentArn๐Ÿ”น

Type: string

The environment ARN of this Cloud9 environment.


ec2EnvironmentName๐Ÿ”น

Type: string

The environment name of this Cloud9 environment.


env๐Ÿ”น

Type: 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.


environmentId๐Ÿ”น

Type: string

The environment ID of this Cloud9 environment.


ideUrl๐Ÿ”น

Type: string

The complete IDE URL of this Cloud9 environment.


node๐Ÿ”น

Type: Node

The tree node.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.


vpc๐Ÿ”น

Type: IVpc

VPC ID.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromEc2EnvironmentName(scope, id, ec2EnvironmentName)๐Ÿ”นimport from EnvironmentEc2Name.

applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

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).


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromEc2EnvironmentName(scope, id, ec2EnvironmentName)๐Ÿ”น

public static fromEc2EnvironmentName(scope: Construct, id: string, ec2EnvironmentName: string): IEc2Environment

Parameters

  • scope Construct
  • id string
  • ec2EnvironmentName string

Returns

  • IEc2Environment

import from EnvironmentEc2Name.