software.amazon.awscdk.services.cloud9.alpha.Ec2EnvironmentProps Maven / Gradle / Ivy
Show all versions of cloud9-alpha Show documentation
package software.amazon.awscdk.services.cloud9.alpha;
/**
* (experimental) Properties for Ec2Environment.
*
* Example:
*
*
* 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();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-24T10:56:41.902Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.cloud9.alpha.$Module.class, fqn = "@aws-cdk/aws-cloud9-alpha.Ec2EnvironmentProps")
@software.amazon.jsii.Jsii.Proxy(Ec2EnvironmentProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface Ec2EnvironmentProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The image ID used for creating an Amazon EC2 environment.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.cloud9.alpha.ImageId getImageId();
/**
* (experimental) The VPC that AWS Cloud9 will use to communicate with the Amazon Elastic Compute Cloud (Amazon EC2) instance.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.IVpc getVpc();
/**
* (experimental) 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."
*
* Default: - The instance will not be shut down automatically.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getAutomaticStop() {
return null;
}
/**
* (experimental) The AWS CodeCommit repository to be cloned.
*
* Default: - do not clone any repository
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getClonedRepositories() {
return null;
}
/**
* (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
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.cloud9.alpha.ConnectionType getConnectionType() {
return null;
}
/**
* (experimental) Description of the environment.
*
* Default: - no description
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getDescription() {
return null;
}
/**
* (experimental) Name of the environment.
*
* Default: - automatically generated name
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getEc2EnvironmentName() {
return null;
}
/**
* (experimental) The type of instance to connect to the environment.
*
* Default: - t2.micro
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.InstanceType getInstanceType() {
return null;
}
/**
* (experimental) Owner of the environment.
*
* The owner has full control of the environment and can invite additional members.
*
* Default: - The identity that CloudFormation executes under will be the owner
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.cloud9.alpha.Owner getOwner() {
return null;
}
/**
* (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.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.SubnetSelection getSubnetSelection() {
return null;
}
/**
* @return a {@link Builder} of {@link Ec2EnvironmentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link Ec2EnvironmentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.cloud9.alpha.ImageId imageId;
software.amazon.awscdk.services.ec2.IVpc vpc;
software.amazon.awscdk.Duration automaticStop;
java.util.List clonedRepositories;
software.amazon.awscdk.services.cloud9.alpha.ConnectionType connectionType;
java.lang.String description;
java.lang.String ec2EnvironmentName;
software.amazon.awscdk.services.ec2.InstanceType instanceType;
software.amazon.awscdk.services.cloud9.alpha.Owner owner;
software.amazon.awscdk.services.ec2.SubnetSelection subnetSelection;
/**
* Sets the value of {@link Ec2EnvironmentProps#getImageId}
* @param imageId The image ID used for creating an Amazon EC2 environment. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder imageId(software.amazon.awscdk.services.cloud9.alpha.ImageId imageId) {
this.imageId = imageId;
return this;
}
/**
* Sets the value of {@link Ec2EnvironmentProps#getVpc}
* @param vpc The VPC that AWS Cloud9 will use to communicate with the Amazon Elastic Compute Cloud (Amazon EC2) instance. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder vpc(software.amazon.awscdk.services.ec2.IVpc vpc) {
this.vpc = vpc;
return this;
}
/**
* Sets the value of {@link Ec2EnvironmentProps#getAutomaticStop}
* @param automaticStop 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."
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder automaticStop(software.amazon.awscdk.Duration automaticStop) {
this.automaticStop = automaticStop;
return this;
}
/**
* Sets the value of {@link Ec2EnvironmentProps#getClonedRepositories}
* @param clonedRepositories The AWS CodeCommit repository to be cloned.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder clonedRepositories(java.util.List extends software.amazon.awscdk.services.cloud9.alpha.CloneRepository> clonedRepositories) {
this.clonedRepositories = (java.util.List)clonedRepositories;
return this;
}
/**
* Sets the value of {@link Ec2EnvironmentProps#getConnectionType}
* @param connectionType 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)
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder connectionType(software.amazon.awscdk.services.cloud9.alpha.ConnectionType connectionType) {
this.connectionType = connectionType;
return this;
}
/**
* Sets the value of {@link Ec2EnvironmentProps#getDescription}
* @param description Description of the environment.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder description(java.lang.String description) {
this.description = description;
return this;
}
/**
* Sets the value of {@link Ec2EnvironmentProps#getEc2EnvironmentName}
* @param ec2EnvironmentName Name of the environment.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder ec2EnvironmentName(java.lang.String ec2EnvironmentName) {
this.ec2EnvironmentName = ec2EnvironmentName;
return this;
}
/**
* Sets the value of {@link Ec2EnvironmentProps#getInstanceType}
* @param instanceType The type of instance to connect to the environment.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder instanceType(software.amazon.awscdk.services.ec2.InstanceType instanceType) {
this.instanceType = instanceType;
return this;
}
/**
* Sets the value of {@link Ec2EnvironmentProps#getOwner}
* @param owner Owner of the environment.
* The owner has full control of the environment and can invite additional members.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder owner(software.amazon.awscdk.services.cloud9.alpha.Owner owner) {
this.owner = owner;
return this;
}
/**
* Sets the value of {@link Ec2EnvironmentProps#getSubnetSelection}
* @param subnetSelection The subnetSelection of the VPC that AWS Cloud9 will use to communicate with the Amazon EC2 instance.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder subnetSelection(software.amazon.awscdk.services.ec2.SubnetSelection subnetSelection) {
this.subnetSelection = subnetSelection;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link Ec2EnvironmentProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public Ec2EnvironmentProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link Ec2EnvironmentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements Ec2EnvironmentProps {
private final software.amazon.awscdk.services.cloud9.alpha.ImageId imageId;
private final software.amazon.awscdk.services.ec2.IVpc vpc;
private final software.amazon.awscdk.Duration automaticStop;
private final java.util.List clonedRepositories;
private final software.amazon.awscdk.services.cloud9.alpha.ConnectionType connectionType;
private final java.lang.String description;
private final java.lang.String ec2EnvironmentName;
private final software.amazon.awscdk.services.ec2.InstanceType instanceType;
private final software.amazon.awscdk.services.cloud9.alpha.Owner owner;
private final software.amazon.awscdk.services.ec2.SubnetSelection subnetSelection;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.imageId = software.amazon.jsii.Kernel.get(this, "imageId", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloud9.alpha.ImageId.class));
this.vpc = software.amazon.jsii.Kernel.get(this, "vpc", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.IVpc.class));
this.automaticStop = software.amazon.jsii.Kernel.get(this, "automaticStop", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class));
this.clonedRepositories = software.amazon.jsii.Kernel.get(this, "clonedRepositories", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloud9.alpha.CloneRepository.class)));
this.connectionType = software.amazon.jsii.Kernel.get(this, "connectionType", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloud9.alpha.ConnectionType.class));
this.description = software.amazon.jsii.Kernel.get(this, "description", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.ec2EnvironmentName = software.amazon.jsii.Kernel.get(this, "ec2EnvironmentName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.instanceType = software.amazon.jsii.Kernel.get(this, "instanceType", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.InstanceType.class));
this.owner = software.amazon.jsii.Kernel.get(this, "owner", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloud9.alpha.Owner.class));
this.subnetSelection = software.amazon.jsii.Kernel.get(this, "subnetSelection", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.SubnetSelection.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.imageId = java.util.Objects.requireNonNull(builder.imageId, "imageId is required");
this.vpc = java.util.Objects.requireNonNull(builder.vpc, "vpc is required");
this.automaticStop = builder.automaticStop;
this.clonedRepositories = (java.util.List)builder.clonedRepositories;
this.connectionType = builder.connectionType;
this.description = builder.description;
this.ec2EnvironmentName = builder.ec2EnvironmentName;
this.instanceType = builder.instanceType;
this.owner = builder.owner;
this.subnetSelection = builder.subnetSelection;
}
@Override
public final software.amazon.awscdk.services.cloud9.alpha.ImageId getImageId() {
return this.imageId;
}
@Override
public final software.amazon.awscdk.services.ec2.IVpc getVpc() {
return this.vpc;
}
@Override
public final software.amazon.awscdk.Duration getAutomaticStop() {
return this.automaticStop;
}
@Override
public final java.util.List getClonedRepositories() {
return this.clonedRepositories;
}
@Override
public final software.amazon.awscdk.services.cloud9.alpha.ConnectionType getConnectionType() {
return this.connectionType;
}
@Override
public final java.lang.String getDescription() {
return this.description;
}
@Override
public final java.lang.String getEc2EnvironmentName() {
return this.ec2EnvironmentName;
}
@Override
public final software.amazon.awscdk.services.ec2.InstanceType getInstanceType() {
return this.instanceType;
}
@Override
public final software.amazon.awscdk.services.cloud9.alpha.Owner getOwner() {
return this.owner;
}
@Override
public final software.amazon.awscdk.services.ec2.SubnetSelection getSubnetSelection() {
return this.subnetSelection;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("imageId", om.valueToTree(this.getImageId()));
data.set("vpc", om.valueToTree(this.getVpc()));
if (this.getAutomaticStop() != null) {
data.set("automaticStop", om.valueToTree(this.getAutomaticStop()));
}
if (this.getClonedRepositories() != null) {
data.set("clonedRepositories", om.valueToTree(this.getClonedRepositories()));
}
if (this.getConnectionType() != null) {
data.set("connectionType", om.valueToTree(this.getConnectionType()));
}
if (this.getDescription() != null) {
data.set("description", om.valueToTree(this.getDescription()));
}
if (this.getEc2EnvironmentName() != null) {
data.set("ec2EnvironmentName", om.valueToTree(this.getEc2EnvironmentName()));
}
if (this.getInstanceType() != null) {
data.set("instanceType", om.valueToTree(this.getInstanceType()));
}
if (this.getOwner() != null) {
data.set("owner", om.valueToTree(this.getOwner()));
}
if (this.getSubnetSelection() != null) {
data.set("subnetSelection", om.valueToTree(this.getSubnetSelection()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-cloud9-alpha.Ec2EnvironmentProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Ec2EnvironmentProps.Jsii$Proxy that = (Ec2EnvironmentProps.Jsii$Proxy) o;
if (!imageId.equals(that.imageId)) return false;
if (!vpc.equals(that.vpc)) return false;
if (this.automaticStop != null ? !this.automaticStop.equals(that.automaticStop) : that.automaticStop != null) return false;
if (this.clonedRepositories != null ? !this.clonedRepositories.equals(that.clonedRepositories) : that.clonedRepositories != null) return false;
if (this.connectionType != null ? !this.connectionType.equals(that.connectionType) : that.connectionType != null) return false;
if (this.description != null ? !this.description.equals(that.description) : that.description != null) return false;
if (this.ec2EnvironmentName != null ? !this.ec2EnvironmentName.equals(that.ec2EnvironmentName) : that.ec2EnvironmentName != null) return false;
if (this.instanceType != null ? !this.instanceType.equals(that.instanceType) : that.instanceType != null) return false;
if (this.owner != null ? !this.owner.equals(that.owner) : that.owner != null) return false;
return this.subnetSelection != null ? this.subnetSelection.equals(that.subnetSelection) : that.subnetSelection == null;
}
@Override
public final int hashCode() {
int result = this.imageId.hashCode();
result = 31 * result + (this.vpc.hashCode());
result = 31 * result + (this.automaticStop != null ? this.automaticStop.hashCode() : 0);
result = 31 * result + (this.clonedRepositories != null ? this.clonedRepositories.hashCode() : 0);
result = 31 * result + (this.connectionType != null ? this.connectionType.hashCode() : 0);
result = 31 * result + (this.description != null ? this.description.hashCode() : 0);
result = 31 * result + (this.ec2EnvironmentName != null ? this.ec2EnvironmentName.hashCode() : 0);
result = 31 * result + (this.instanceType != null ? this.instanceType.hashCode() : 0);
result = 31 * result + (this.owner != null ? this.owner.hashCode() : 0);
result = 31 * result + (this.subnetSelection != null ? this.subnetSelection.hashCode() : 0);
return result;
}
}
}