Ec2EnvironmentProps

class aws_cdk.aws_cloud9.Ec2EnvironmentProps(*, vpc, cloned_repositories=None, connection_type=None, description=None, ec2_environment_name=None, instance_type=None, subnet_selection=None)

Bases: object

(experimental) Properties for Ec2Environment.

Parameters
  • vpc (IVpc) – (experimental) The VPC that AWS Cloud9 will use to communicate with the Amazon Elastic Compute Cloud (Amazon EC2) instance.

  • cloned_repositories (Optional[Sequence[CloneRepository]]) – (experimental) The AWS CodeCommit repository to be cloned. Default: - do not clone any repository

  • connection_type (Optional[ConnectionType]) – (experimental) 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) Default: - CONNECT_SSH

  • description (Optional[str]) – (experimental) Description of the environment. Default: - no description

  • ec2_environment_name (Optional[str]) – (experimental) Name of the environment. Default: - automatically generated name

  • instance_type (Optional[InstanceType]) – (experimental) The type of instance to connect to the environment. Default: - t2.micro

  • subnet_selection (Union[SubnetSelection, Dict[str, Any], None]) – (experimental) The subnetSelection of the VPC that AWS Cloud9 will use to communicate with the Amazon EC2 instance. Default: - all public subnets of the VPC are selected.

Stability

experimental

ExampleMetadata

infused

Example:

# create a cloud9 ec2 environment in a new VPC
vpc = ec2.Vpc(self, "VPC", max_azs=3)
cloud9.Ec2Environment(self, "Cloud9Env", vpc=vpc)

# or create the cloud9 environment in the default VPC with specific instanceType
default_vpc = ec2.Vpc.from_lookup(self, "DefaultVPC", is_default=True)
cloud9.Ec2Environment(self, "Cloud9Env2",
    vpc=default_vpc,
    instance_type=ec2.InstanceType("t3.large")
)

# or specify in a different subnetSelection
c9env = cloud9.Ec2Environment(self, "Cloud9Env3",
    vpc=vpc,
    subnet_selection=ec2.SubnetSelection(
        subnet_type=ec2.SubnetType.PRIVATE_WITH_NAT
    )
)

# print the Cloud9 IDE URL in the output
CfnOutput(self, "URL", value=c9env.ide_url)

Attributes

cloned_repositories

(experimental) The AWS CodeCommit repository to be cloned.

Default
  • do not clone any repository

Stability

experimental

Return type

Optional[List[CloneRepository]]

connection_type

(experimental) 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)

Default
  • CONNECT_SSH

Stability

experimental

Return type

Optional[ConnectionType]

description

(experimental) Description of the environment.

Default
  • no description

Stability

experimental

Return type

Optional[str]

ec2_environment_name

(experimental) Name of the environment.

Default
  • automatically generated name

Stability

experimental

Return type

Optional[str]

instance_type

(experimental) The type of instance to connect to the environment.

Default
  • t2.micro

Stability

experimental

Return type

Optional[InstanceType]

subnet_selection

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

Default
  • all public subnets of the VPC are selected.

Stability

experimental

Return type

Optional[SubnetSelection]

vpc

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

Stability

experimental

Return type

IVpc