aws_sdk_cloud9/client/
create_environment_ec2.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`CreateEnvironmentEC2`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`name(impl Into<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::set_name):<br>required: **true**<br><p>The name of the environment to create.</p> <p>This name is visible to other IAM users in the same Amazon Web Services account.</p><br>
7    ///   - [`description(impl Into<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::description) / [`set_description(Option<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::set_description):<br>required: **false**<br><p>The description of the environment to create.</p><br>
8    ///   - [`client_request_token(impl Into<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::client_request_token) / [`set_client_request_token(Option<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::set_client_request_token):<br>required: **false**<br><p>A unique, case-sensitive string that helps Cloud9 to ensure this operation completes no more than one time.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Client Tokens</a> in the <i>Amazon EC2 API Reference</i>.</p><br>
9    ///   - [`instance_type(impl Into<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::instance_type) / [`set_instance_type(Option<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::set_instance_type):<br>required: **true**<br><p>The type of instance to connect to the environment (for example, <code>t2.micro</code>).</p><br>
10    ///   - [`subnet_id(impl Into<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::subnet_id) / [`set_subnet_id(Option<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::set_subnet_id):<br>required: **false**<br><p>The ID of the subnet in Amazon VPC that Cloud9 will use to communicate with the Amazon EC2 instance.</p><br>
11    ///   - [`image_id(impl Into<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::image_id) / [`set_image_id(Option<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::set_image_id):<br>required: **true**<br><p>The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance. To choose an AMI for the instance, you must specify a valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path.</p> <p></p> <p>We recommend using Amazon Linux 2023 as the AMI to create your environment as it is fully supported.</p> <p>From December 16, 2024, Ubuntu 18.04 will be removed from the list of available <code>imageIds</code> for Cloud9. This change is necessary as Ubuntu 18.04 has ended standard support on May 31, 2023. This change will only affect direct API consumers, and not Cloud9 console users.</p> <p>Since Ubuntu 18.04 has ended standard support as of May 31, 2023, we recommend you choose Ubuntu 22.04.</p> <p><b>AMI aliases </b></p> <ul>  <li>   <p>Amazon Linux 2: <code>amazonlinux-2-x86_64</code></p></li>  <li>   <p>Amazon Linux 2023 (recommended): <code>amazonlinux-2023-x86_64</code></p></li>  <li>   <p>Ubuntu 18.04: <code>ubuntu-18.04-x86_64</code></p></li>  <li>   <p>Ubuntu 22.04: <code>ubuntu-22.04-x86_64</code></p></li> </ul> <p><b>SSM paths</b></p> <ul>  <li>   <p>Amazon Linux 2: <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64</code></p></li>  <li>   <p>Amazon Linux 2023 (recommended): <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2023-x86_64</code></p></li>  <li>   <p>Ubuntu 18.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64</code></p></li>  <li>   <p>Ubuntu 22.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-22.04-x86_64</code></p></li> </ul><br>
12    ///   - [`automatic_stop_time_minutes(i32)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::automatic_stop_time_minutes) / [`set_automatic_stop_time_minutes(Option<i32>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::set_automatic_stop_time_minutes):<br>required: **false**<br><p>The number of minutes until the running instance is shut down after the environment has last been used.</p><br>
13    ///   - [`owner_arn(impl Into<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::owner_arn) / [`set_owner_arn(Option<String>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::set_owner_arn):<br>required: **false**<br><p>The Amazon Resource Name (ARN) of the environment owner. This ARN can be the ARN of any IAM principal. If this value is not specified, the ARN defaults to this environment's creator.</p><br>
14    ///   - [`tags(Tag)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::tags) / [`set_tags(Option<Vec::<Tag>>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::set_tags):<br>required: **false**<br><p>An array of key-value pairs that will be associated with the new Cloud9 development environment.</p><br>
15    ///   - [`connection_type(ConnectionType)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::connection_type) / [`set_connection_type(Option<ConnectionType>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::set_connection_type):<br>required: **false**<br><p>The connection type used for connecting to an Amazon EC2 environment. Valid values are <code>CONNECT_SSH</code> (default) and <code>CONNECT_SSM</code> (connected through Amazon EC2 Systems Manager).</p> <p>For more information, see <a href="https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html">Accessing no-ingress EC2 instances with Amazon EC2 Systems Manager</a> in the <i>Cloud9 User Guide</i>.</p><br>
16    ///   - [`dry_run(bool)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::dry_run) / [`set_dry_run(Option<bool>)`](crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::set_dry_run):<br>required: **false**<br><p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p><br>
17    /// - On success, responds with [`CreateEnvironmentEc2Output`](crate::operation::create_environment_ec2::CreateEnvironmentEc2Output) with field(s):
18    ///   - [`environment_id(Option<String>)`](crate::operation::create_environment_ec2::CreateEnvironmentEc2Output::environment_id): <p>The ID of the environment that was created.</p>
19    /// - On failure, responds with [`SdkError<CreateEnvironmentEC2Error>`](crate::operation::create_environment_ec2::CreateEnvironmentEC2Error)
20    pub fn create_environment_ec2(&self) -> crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder {
21        crate::operation::create_environment_ec2::builders::CreateEnvironmentEC2FluentBuilder::new(self.handle.clone())
22    }
23}