- class aws_cdk.aws_cloud9_alpha.Ec2Environment(scope, id, *, image_id, vpc, cloned_repositories=None, connection_type=None, description=None, ec2_environment_name=None, instance_type=None, subnet_selection=None)
(experimental) A Cloud9 Environment with Amazon EC2.
import aws_cdk.aws_codecommit as codecommit # create a new Cloud9 environment and clone the two repositories # vpc: ec2.Vpc # create a codecommit repository to clone into the cloud9 environment repo_new = codecommit.Repository(self, "RepoNew", repository_name="new-repo" ) # import an existing codecommit repository to clone into the cloud9 environment repo_existing = codecommit.Repository.from_repository_name(self, "RepoExisting", "existing-repo") cloud9.Ec2Environment(self, "C9Env", vpc=vpc, cloned_repositories=[ cloud9.CloneRepository.from_code_commit(repo_new, "/src/new-repo"), cloud9.CloneRepository.from_code_commit(repo_existing, "/src/existing-repo") ], image_id=cloud9.ImageId.AMAZON_LINUX_2 )
ImageId) – (experimental) The image ID used for creating an Amazon EC2 environment.
IVpc) – (experimental) The VPC that AWS Cloud9 will use to communicate with the Amazon Elastic Compute Cloud (Amazon EC2) instance.
CloneRepository]]) – (experimental) The AWS CodeCommit repository to be cloned. Default: - do not clone any repository
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
str]) – (experimental) Description of the environment. Default: - no description
str]) – (experimental) Name of the environment. Default: - automatically generated name
InstanceType]) – (experimental) The type of instance to connect to the environment. Default: - t2.micro
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.
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 (
- Return type
Returns a string representation of this construct.
- Return type
(experimental) The environment ARN of this Cloud9 environment.
(experimental) The environment name of this Cloud9 environment.
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.
(experimental) The environment ID of this Cloud9 environment.
(experimental) The complete IDE URL of this Cloud9 environment.
The tree node.
The stack in which this resource is defined.
(experimental) VPC ID.
- classmethod from_ec2_environment_name(scope, id, ec2_environment_name)
(experimental) import from EnvironmentEc2Name.
- classmethod is_construct(x)
xis a construct.
Use this method instead of
instanceofto properly detect
Constructinstances, even when the construct library is symlinked.
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the class
Constructin each copy of the
constructslibrary is seen as a different class, and an instance of one class will not test as
instanceofthe other class.
npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the
constructslibrary can be accidentally installed, and
instanceofwill behave unpredictably. It is safest to avoid using
instanceof, and using this type-testing method instead.
Any) – Any object.
- Return type
xis an object created from a class which extends
- classmethod is_owned_resource(construct)
Returns true if the construct was created by CDK, and false otherwise.
- Return type