Class Ec2Environment

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.cloud9.Ec2Environment
All Implemented Interfaces:
IConstruct, IDependable, IResource, IEc2Environment, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:40.077Z") @Stability(Experimental) public class Ec2Environment extends Resource implements IEc2Environment
(experimental) A Cloud9 Environment with Amazon EC2.

Example:

 // create a cloud9 ec2 environment in a new VPC
 Vpc vpc = Vpc.Builder.create(this, "VPC").maxAzs(3).build();
 Ec2Environment.Builder.create(this, "Cloud9Env").vpc(vpc).build();
 // or create the cloud9 environment in the default VPC with specific instanceType
 IVpc defaultVpc = Vpc.fromLookup(this, "DefaultVPC", VpcLookupOptions.builder().isDefault(true).build());
 Ec2Environment.Builder.create(this, "Cloud9Env2")
         .vpc(defaultVpc)
         .instanceType(new InstanceType("t3.large"))
         .build();
 // or specify in a different subnetSelection
 Ec2Environment c9env = Ec2Environment.Builder.create(this, "Cloud9Env3")
         .vpc(vpc)
         .subnetSelection(SubnetSelection.builder()
                 .subnetType(SubnetType.PRIVATE_WITH_NAT)
                 .build())
         .build();
 // print the Cloud9 IDE URL in the output
 // print the Cloud9 IDE URL in the output
 CfnOutput.Builder.create(this, "URL").value(c9env.getIdeUrl()).build();
 
  • Constructor Details

    • Ec2Environment

      protected Ec2Environment(software.amazon.jsii.JsiiObjectRef objRef)
    • Ec2Environment

      protected Ec2Environment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Ec2Environment

      @Stability(Experimental) public Ec2Environment(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull Ec2EnvironmentProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromEc2EnvironmentName

      @Stability(Experimental) @NotNull public static IEc2Environment fromEc2EnvironmentName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String ec2EnvironmentName)
      (experimental) import from EnvironmentEc2Name.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      ec2EnvironmentName - This parameter is required.
    • getEc2EnvironmentArn

      @Stability(Experimental) @NotNull public String getEc2EnvironmentArn()
      (experimental) The environment ARN of this Cloud9 environment.
      Specified by:
      getEc2EnvironmentArn in interface IEc2Environment
    • getEc2EnvironmentName

      @Stability(Experimental) @NotNull public String getEc2EnvironmentName()
      (experimental) The environment name of this Cloud9 environment.
      Specified by:
      getEc2EnvironmentName in interface IEc2Environment
    • getEnvironmentId

      @Stability(Experimental) @NotNull public String getEnvironmentId()
      (experimental) The environment ID of this Cloud9 environment.
    • getIdeUrl

      @Stability(Experimental) @NotNull public String getIdeUrl()
      (experimental) The complete IDE URL of this Cloud9 environment.
    • getVpc

      @Stability(Experimental) @NotNull public IVpc getVpc()
      (experimental) VPC ID.