All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.cloud9.EnvironmentEC2 Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

The newest version!
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.cloud9;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.cloud9.EnvironmentEC2Args;
import com.pulumi.aws.cloud9.inputs.EnvironmentEC2State;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Provides a Cloud9 EC2 Development Environment.
 * 
 * ## Example Usage
 * 
 * Basic usage:
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.cloud9.EnvironmentEC2;
 * import com.pulumi.aws.cloud9.EnvironmentEC2Args;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var example = new EnvironmentEC2("example", EnvironmentEC2Args.builder()
 *             .instanceType("t2.micro")
 *             .name("example-env")
 *             .imageId("amazonlinux-2023-x86_64")
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * Get the URL of the Cloud9 environment after creation: * * <!--Start PulumiCodeChooser --> *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.cloud9.EnvironmentEC2;
 * import com.pulumi.aws.cloud9.EnvironmentEC2Args;
 * import com.pulumi.aws.ec2.Ec2Functions;
 * import com.pulumi.aws.ec2.inputs.GetInstanceArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var example = new EnvironmentEC2("example", EnvironmentEC2Args.builder()
 *             .instanceType("t2.micro")
 *             .build());
 * 
 *         final var cloud9Instance = Ec2Functions.getInstance(GetInstanceArgs.builder()
 *             .filters(GetInstanceFilterArgs.builder()
 *                 .name("tag:aws:cloud9:environment")
 *                 .values(example.id())
 *                 .build())
 *             .build());
 * 
 *         ctx.export("cloud9Url", example.id().applyValue(id -> String.format("https://%s.console.aws.amazon.com/cloud9/ide/%s", region,id)));
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * Allocate a static IP to the Cloud9 environment: * * <!--Start PulumiCodeChooser --> *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.cloud9.EnvironmentEC2;
 * import com.pulumi.aws.cloud9.EnvironmentEC2Args;
 * import com.pulumi.aws.ec2.Ec2Functions;
 * import com.pulumi.aws.ec2.inputs.GetInstanceArgs;
 * import com.pulumi.aws.ec2.Eip;
 * import com.pulumi.aws.ec2.EipArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var example = new EnvironmentEC2("example", EnvironmentEC2Args.builder()
 *             .instanceType("t2.micro")
 *             .build());
 * 
 *         final var cloud9Instance = Ec2Functions.getInstance(GetInstanceArgs.builder()
 *             .filters(GetInstanceFilterArgs.builder()
 *                 .name("tag:aws:cloud9:environment")
 *                 .values(example.id())
 *                 .build())
 *             .build());
 * 
 *         var cloud9Eip = new Eip("cloud9Eip", EipArgs.builder()
 *             .instance(cloud9Instance.applyValue(getInstanceResult -> getInstanceResult).applyValue(cloud9Instance -> cloud9Instance.applyValue(getInstanceResult -> getInstanceResult.id())))
 *             .domain("vpc")
 *             .build());
 * 
 *         ctx.export("cloud9PublicIp", cloud9Eip.publicIp());
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * */ @ResourceType(type="aws:cloud9/environmentEC2:EnvironmentEC2") public class EnvironmentEC2 extends com.pulumi.resources.CustomResource { /** * The ARN of the environment. * */ @Export(name="arn", refs={String.class}, tree="[0]") private Output arn; /** * @return The ARN of the environment. * */ public Output arn() { return this.arn; } /** * The number of minutes until the running instance is shut down after the environment has last been used. * */ @Export(name="automaticStopTimeMinutes", refs={Integer.class}, tree="[0]") private Output automaticStopTimeMinutes; /** * @return The number of minutes until the running instance is shut down after the environment has last been used. * */ public Output> automaticStopTimeMinutes() { return Codegen.optional(this.automaticStopTimeMinutes); } /** * The connection type used for connecting to an Amazon EC2 environment. Valid values are `CONNECT_SSH` and `CONNECT_SSM`. For more information please refer [AWS documentation for Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html). * */ @Export(name="connectionType", refs={String.class}, tree="[0]") private Output connectionType; /** * @return The connection type used for connecting to an Amazon EC2 environment. Valid values are `CONNECT_SSH` and `CONNECT_SSM`. For more information please refer [AWS documentation for Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html). * */ public Output> connectionType() { return Codegen.optional(this.connectionType); } /** * The description of the environment. * */ @Export(name="description", refs={String.class}, tree="[0]") private Output description; /** * @return The description of the environment. * */ public Output> description() { return Codegen.optional(this.description); } /** * The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance. Valid values are * * `amazonlinux-2-x86_64` * * `amazonlinux-2023-x86_64` * * `ubuntu-18.04-x86_64` * * `ubuntu-22.04-x86_64` * * `resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64` * * `resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2023-x86_64` * * `resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64` * * `resolve:ssm:/aws/service/cloud9/amis/ubuntu-22.04-x86_64` * */ @Export(name="imageId", refs={String.class}, tree="[0]") private Output imageId; /** * @return The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance. Valid values are * * `amazonlinux-2-x86_64` * * `amazonlinux-2023-x86_64` * * `ubuntu-18.04-x86_64` * * `ubuntu-22.04-x86_64` * * `resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64` * * `resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2023-x86_64` * * `resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64` * * `resolve:ssm:/aws/service/cloud9/amis/ubuntu-22.04-x86_64` * */ public Output imageId() { return this.imageId; } /** * The type of instance to connect to the environment, e.g., `t2.micro`. * */ @Export(name="instanceType", refs={String.class}, tree="[0]") private Output instanceType; /** * @return The type of instance to connect to the environment, e.g., `t2.micro`. * */ public Output instanceType() { return this.instanceType; } /** * The name of the environment. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The name of the environment. * */ public Output name() { return this.name; } /** * The ARN of the environment owner. This can be ARN of any AWS IAM principal. Defaults to the environment's creator. * */ @Export(name="ownerArn", refs={String.class}, tree="[0]") private Output ownerArn; /** * @return The ARN of the environment owner. This can be ARN of any AWS IAM principal. Defaults to the environment's creator. * */ public Output ownerArn() { return this.ownerArn; } /** * The ID of the subnet in Amazon VPC that AWS Cloud9 will use to communicate with the Amazon EC2 instance. * */ @Export(name="subnetId", refs={String.class}, tree="[0]") private Output subnetId; /** * @return The ID of the subnet in Amazon VPC that AWS Cloud9 will use to communicate with the Amazon EC2 instance. * */ public Output> subnetId() { return Codegen.optional(this.subnetId); } /** * Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. * * @deprecated * Please use `tags` instead. * */ @Deprecated /* Please use `tags` instead. */ @Export(name="tagsAll", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tagsAll; /** * @return A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. * */ public Output> tagsAll() { return this.tagsAll; } /** * The type of the environment (e.g., `ssh` or `ec2`). * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return The type of the environment (e.g., `ssh` or `ec2`). * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public EnvironmentEC2(java.lang.String name) { this(name, EnvironmentEC2Args.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public EnvironmentEC2(java.lang.String name, EnvironmentEC2Args args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public EnvironmentEC2(java.lang.String name, EnvironmentEC2Args args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:cloud9/environmentEC2:EnvironmentEC2", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private EnvironmentEC2(java.lang.String name, Output id, @Nullable EnvironmentEC2State state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:cloud9/environmentEC2:EnvironmentEC2", name, state, makeResourceOptions(options, id), false); } private static EnvironmentEC2Args makeArgs(EnvironmentEC2Args args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? EnvironmentEC2Args.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state * @param options Optional settings to control the behavior of the CustomResource. */ public static EnvironmentEC2 get(java.lang.String name, Output id, @Nullable EnvironmentEC2State state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new EnvironmentEC2(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy