aws-sdk-ec2 1.222.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes the placement of an instance.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Placement {
    /// <p>The ID of the Availability Zone of the instance.</p>
    /// <p>On input, you can specify <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code>, but not both. If you specify neither one, Amazon EC2 automatically selects an Availability Zone for you.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub availability_zone_id: ::std::option::Option<::std::string::String>,
    /// <p>The affinity setting for the instance on the Dedicated Host.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a>.</p>
    pub affinity: ::std::option::Option<::std::string::String>,
    /// <p>The name of the placement group that the instance is in.</p>
    /// <p>On input, you can specify <code>GroupId</code> or <code>GroupName</code>, but not both.</p>
    pub group_name: ::std::option::Option<::std::string::String>,
    /// <p>The number of the partition that the instance is in. Valid only if the placement group strategy is set to <code>partition</code>.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub partition_number: ::std::option::Option<i32>,
    /// <p>The ID of the Dedicated Host on which the instance resides.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a>.</p>
    pub host_id: ::std::option::Option<::std::string::String>,
    /// <p>The tenancy of the instance. An instance with a tenancy of <code>dedicated</code> runs on single-tenant hardware.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>. The <code>host</code> tenancy is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a> or for T3 instances that are configured for the <code>unlimited</code> CPU credit option.</p>
    pub tenancy: ::std::option::Option<crate::types::Tenancy>,
    /// <p>Reserved for future use.</p>
    pub spread_domain: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the host resource group in which to launch the instances.</p>
    /// <p>On input, if you specify this parameter, either omit the <b>Tenancy</b> parameter or set it to <code>host</code>.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub host_resource_group_arn: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the placement group that the instance is in.</p>
    /// <p>On input, you can specify <code>GroupId</code> or <code>GroupName</code>, but not both.</p>
    pub group_id: ::std::option::Option<::std::string::String>,
    /// <p>The Availability Zone of the instance.</p>
    /// <p>On input, you can specify <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code>, but not both. If you specify neither one, Amazon EC2 automatically selects an Availability Zone for you.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub availability_zone: ::std::option::Option<::std::string::String>,
}
impl Placement {
    /// <p>The ID of the Availability Zone of the instance.</p>
    /// <p>On input, you can specify <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code>, but not both. If you specify neither one, Amazon EC2 automatically selects an Availability Zone for you.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn availability_zone_id(&self) -> ::std::option::Option<&str> {
        self.availability_zone_id.as_deref()
    }
    /// <p>The affinity setting for the instance on the Dedicated Host.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a>.</p>
    pub fn affinity(&self) -> ::std::option::Option<&str> {
        self.affinity.as_deref()
    }
    /// <p>The name of the placement group that the instance is in.</p>
    /// <p>On input, you can specify <code>GroupId</code> or <code>GroupName</code>, but not both.</p>
    pub fn group_name(&self) -> ::std::option::Option<&str> {
        self.group_name.as_deref()
    }
    /// <p>The number of the partition that the instance is in. Valid only if the placement group strategy is set to <code>partition</code>.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn partition_number(&self) -> ::std::option::Option<i32> {
        self.partition_number
    }
    /// <p>The ID of the Dedicated Host on which the instance resides.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a>.</p>
    pub fn host_id(&self) -> ::std::option::Option<&str> {
        self.host_id.as_deref()
    }
    /// <p>The tenancy of the instance. An instance with a tenancy of <code>dedicated</code> runs on single-tenant hardware.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>. The <code>host</code> tenancy is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a> or for T3 instances that are configured for the <code>unlimited</code> CPU credit option.</p>
    pub fn tenancy(&self) -> ::std::option::Option<&crate::types::Tenancy> {
        self.tenancy.as_ref()
    }
    /// <p>Reserved for future use.</p>
    pub fn spread_domain(&self) -> ::std::option::Option<&str> {
        self.spread_domain.as_deref()
    }
    /// <p>The ARN of the host resource group in which to launch the instances.</p>
    /// <p>On input, if you specify this parameter, either omit the <b>Tenancy</b> parameter or set it to <code>host</code>.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn host_resource_group_arn(&self) -> ::std::option::Option<&str> {
        self.host_resource_group_arn.as_deref()
    }
    /// <p>The ID of the placement group that the instance is in.</p>
    /// <p>On input, you can specify <code>GroupId</code> or <code>GroupName</code>, but not both.</p>
    pub fn group_id(&self) -> ::std::option::Option<&str> {
        self.group_id.as_deref()
    }
    /// <p>The Availability Zone of the instance.</p>
    /// <p>On input, you can specify <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code>, but not both. If you specify neither one, Amazon EC2 automatically selects an Availability Zone for you.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn availability_zone(&self) -> ::std::option::Option<&str> {
        self.availability_zone.as_deref()
    }
}
impl Placement {
    /// Creates a new builder-style object to manufacture [`Placement`](crate::types::Placement).
    pub fn builder() -> crate::types::builders::PlacementBuilder {
        crate::types::builders::PlacementBuilder::default()
    }
}

/// A builder for [`Placement`](crate::types::Placement).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PlacementBuilder {
    pub(crate) availability_zone_id: ::std::option::Option<::std::string::String>,
    pub(crate) affinity: ::std::option::Option<::std::string::String>,
    pub(crate) group_name: ::std::option::Option<::std::string::String>,
    pub(crate) partition_number: ::std::option::Option<i32>,
    pub(crate) host_id: ::std::option::Option<::std::string::String>,
    pub(crate) tenancy: ::std::option::Option<crate::types::Tenancy>,
    pub(crate) spread_domain: ::std::option::Option<::std::string::String>,
    pub(crate) host_resource_group_arn: ::std::option::Option<::std::string::String>,
    pub(crate) group_id: ::std::option::Option<::std::string::String>,
    pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
}
impl PlacementBuilder {
    /// <p>The ID of the Availability Zone of the instance.</p>
    /// <p>On input, you can specify <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code>, but not both. If you specify neither one, Amazon EC2 automatically selects an Availability Zone for you.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn availability_zone_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.availability_zone_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the Availability Zone of the instance.</p>
    /// <p>On input, you can specify <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code>, but not both. If you specify neither one, Amazon EC2 automatically selects an Availability Zone for you.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn set_availability_zone_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.availability_zone_id = input;
        self
    }
    /// <p>The ID of the Availability Zone of the instance.</p>
    /// <p>On input, you can specify <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code>, but not both. If you specify neither one, Amazon EC2 automatically selects an Availability Zone for you.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn get_availability_zone_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.availability_zone_id
    }
    /// <p>The affinity setting for the instance on the Dedicated Host.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a>.</p>
    pub fn affinity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.affinity = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The affinity setting for the instance on the Dedicated Host.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a>.</p>
    pub fn set_affinity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.affinity = input;
        self
    }
    /// <p>The affinity setting for the instance on the Dedicated Host.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a>.</p>
    pub fn get_affinity(&self) -> &::std::option::Option<::std::string::String> {
        &self.affinity
    }
    /// <p>The name of the placement group that the instance is in.</p>
    /// <p>On input, you can specify <code>GroupId</code> or <code>GroupName</code>, but not both.</p>
    pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.group_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the placement group that the instance is in.</p>
    /// <p>On input, you can specify <code>GroupId</code> or <code>GroupName</code>, but not both.</p>
    pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.group_name = input;
        self
    }
    /// <p>The name of the placement group that the instance is in.</p>
    /// <p>On input, you can specify <code>GroupId</code> or <code>GroupName</code>, but not both.</p>
    pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.group_name
    }
    /// <p>The number of the partition that the instance is in. Valid only if the placement group strategy is set to <code>partition</code>.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn partition_number(mut self, input: i32) -> Self {
        self.partition_number = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of the partition that the instance is in. Valid only if the placement group strategy is set to <code>partition</code>.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn set_partition_number(mut self, input: ::std::option::Option<i32>) -> Self {
        self.partition_number = input;
        self
    }
    /// <p>The number of the partition that the instance is in. Valid only if the placement group strategy is set to <code>partition</code>.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn get_partition_number(&self) -> &::std::option::Option<i32> {
        &self.partition_number
    }
    /// <p>The ID of the Dedicated Host on which the instance resides.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a>.</p>
    pub fn host_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.host_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the Dedicated Host on which the instance resides.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a>.</p>
    pub fn set_host_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.host_id = input;
        self
    }
    /// <p>The ID of the Dedicated Host on which the instance resides.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a>.</p>
    pub fn get_host_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.host_id
    }
    /// <p>The tenancy of the instance. An instance with a tenancy of <code>dedicated</code> runs on single-tenant hardware.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>. The <code>host</code> tenancy is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a> or for T3 instances that are configured for the <code>unlimited</code> CPU credit option.</p>
    pub fn tenancy(mut self, input: crate::types::Tenancy) -> Self {
        self.tenancy = ::std::option::Option::Some(input);
        self
    }
    /// <p>The tenancy of the instance. An instance with a tenancy of <code>dedicated</code> runs on single-tenant hardware.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>. The <code>host</code> tenancy is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a> or for T3 instances that are configured for the <code>unlimited</code> CPU credit option.</p>
    pub fn set_tenancy(mut self, input: ::std::option::Option<crate::types::Tenancy>) -> Self {
        self.tenancy = input;
        self
    }
    /// <p>The tenancy of the instance. An instance with a tenancy of <code>dedicated</code> runs on single-tenant hardware.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>. The <code>host</code> tenancy is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html">ImportInstance</a> or for T3 instances that are configured for the <code>unlimited</code> CPU credit option.</p>
    pub fn get_tenancy(&self) -> &::std::option::Option<crate::types::Tenancy> {
        &self.tenancy
    }
    /// <p>Reserved for future use.</p>
    pub fn spread_domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.spread_domain = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Reserved for future use.</p>
    pub fn set_spread_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.spread_domain = input;
        self
    }
    /// <p>Reserved for future use.</p>
    pub fn get_spread_domain(&self) -> &::std::option::Option<::std::string::String> {
        &self.spread_domain
    }
    /// <p>The ARN of the host resource group in which to launch the instances.</p>
    /// <p>On input, if you specify this parameter, either omit the <b>Tenancy</b> parameter or set it to <code>host</code>.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn host_resource_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.host_resource_group_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the host resource group in which to launch the instances.</p>
    /// <p>On input, if you specify this parameter, either omit the <b>Tenancy</b> parameter or set it to <code>host</code>.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn set_host_resource_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.host_resource_group_arn = input;
        self
    }
    /// <p>The ARN of the host resource group in which to launch the instances.</p>
    /// <p>On input, if you specify this parameter, either omit the <b>Tenancy</b> parameter or set it to <code>host</code>.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn get_host_resource_group_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.host_resource_group_arn
    }
    /// <p>The ID of the placement group that the instance is in.</p>
    /// <p>On input, you can specify <code>GroupId</code> or <code>GroupName</code>, but not both.</p>
    pub fn group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.group_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the placement group that the instance is in.</p>
    /// <p>On input, you can specify <code>GroupId</code> or <code>GroupName</code>, but not both.</p>
    pub fn set_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.group_id = input;
        self
    }
    /// <p>The ID of the placement group that the instance is in.</p>
    /// <p>On input, you can specify <code>GroupId</code> or <code>GroupName</code>, but not both.</p>
    pub fn get_group_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.group_id
    }
    /// <p>The Availability Zone of the instance.</p>
    /// <p>On input, you can specify <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code>, but not both. If you specify neither one, Amazon EC2 automatically selects an Availability Zone for you.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.availability_zone = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Availability Zone of the instance.</p>
    /// <p>On input, you can specify <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code>, but not both. If you specify neither one, Amazon EC2 automatically selects an Availability Zone for you.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.availability_zone = input;
        self
    }
    /// <p>The Availability Zone of the instance.</p>
    /// <p>On input, you can specify <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code>, but not both. If you specify neither one, Amazon EC2 automatically selects an Availability Zone for you.</p>
    /// <p>This parameter is not supported for <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet">CreateFleet</a>.</p>
    pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
        &self.availability_zone
    }
    /// Consumes the builder and constructs a [`Placement`](crate::types::Placement).
    pub fn build(self) -> crate::types::Placement {
        crate::types::Placement {
            availability_zone_id: self.availability_zone_id,
            affinity: self.affinity,
            group_name: self.group_name,
            partition_number: self.partition_number,
            host_id: self.host_id,
            tenancy: self.tenancy,
            spread_domain: self.spread_domain,
            host_resource_group_arn: self.host_resource_group_arn,
            group_id: self.group_id,
            availability_zone: self.availability_zone,
        }
    }
}