Skip to content
v2.277.0

Experimental

@aws-cdk/aws-cloud9-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

Ec2EnvironmentProps Struct ​

Properties for Ec2Environment.

Example ​

ts
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)
})
python
import aws_cdk.aws_iam as iam
# vpc: ec2.Vpc


user = iam.User(self, "user")
user.add_managed_policy(iam.ManagedPolicy.from_aws_managed_policy_name("AWSCloud9Administrator"))
cloud9.Ec2Environment(self, "C9Env",
    vpc=vpc,
    image_id=cloud9.ImageId.AMAZON_LINUX_2,

    owner=cloud9.Owner.user(user)
)
java
import software.amazon.awscdk.services.iam.*;
Vpc vpc;


User user = new User(this, "user");
user.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName("AWSCloud9Administrator"));
Ec2Environment.Builder.create(this, "C9Env")
        .vpc(vpc)
        .imageId(ImageId.AMAZON_LINUX_2)

        .owner(Owner.user(user))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Cloud9.Alpha
using Amazon.CDK.AWS.IAM;
Vpc vpc;


var user = new User(this, "user");
user.AddManagedPolicy(ManagedPolicy.FromAwsManagedPolicyName("AWSCloud9Administrator"));
new Ec2Environment(this, "C9Env", new Ec2EnvironmentProps {
    Vpc = vpc,
    ImageId = ImageId.AMAZON_LINUX_2,

    Owner = Owner.User(user)
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkcloud9alpha/v2
import "github.com/aws/aws-cdk-go/awscdk"
var vpc Vpc


user := iam.NewUser(this, jsii.String("user"))
user.AddManagedPolicy(iam.ManagedPolicy_FromAwsManagedPolicyName(jsii.String("AWSCloud9Administrator")))
cloud9.NewEc2Environment(this, jsii.String("C9Env"), &Ec2EnvironmentProps{
	Vpc: Vpc,
	ImageId: cloud9.ImageId_AMAZON_LINUX_2,

	Owner: cloud9.Owner_User(user),
})

Properties ​

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

Default: The instance will not be shut down automatically.

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

clonedRepositoriesoptionalCloneRepository[]cloned_repositoriesoptionaltyping.List[CloneRepository]clonedRepositoriesoptionalList<CloneRepository>ClonedRepositoriesoptionalCloneRepository[]ClonedRepositoriesoptional*[]CloneRepository#
The AWS CodeCommit repository to be cloned.

Default: do not clone any repository

connectionTypeoptionalConnectionTypeconnection_typeoptionalConnectionTypeconnectionTypeoptionalConnectionTypeConnectionTypeoptionalConnectionTypeConnectionTypeoptionalConnectionType= 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)

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
Description of the environment.

Default: no description

ec2EnvironmentNameoptionalstringec2_environment_nameoptionalstrec2EnvironmentNameoptionalStringEc2EnvironmentNameoptionalstringEc2EnvironmentNameoptional*string#
Name of the environment.

Default: automatically generated name

imageIdImageIdimage_idImageIdimageIdImageIdImageIdImageIdImageIdImageIdrequired#
The image ID used for creating an Amazon EC2 environment.
instanceTypeoptionalInstanceTypeinstance_typeoptionalInstanceTypeinstanceTypeoptionalInstanceTypeInstanceTypeoptionalInstanceTypeInstanceTypeoptionalInstanceType= t2.micro#
The type of instance to connect to the environment.
owneroptionalOwnerowneroptionalOwnerowneroptionalOwnerOwneroptionalOwnerOwneroptionalOwner#
Owner of the environment.

Default: The identity that CloudFormation executes under will be the owner

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

subnetSelectionoptionalSubnetSelectionsubnet_selectionoptionalSubnetSelectionsubnetSelectionoptionalSubnetSelectionSubnetSelectionoptionalSubnetSelectionSubnetSelectionoptionalSubnetSelection#
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.

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