1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>By default, EC2 instances run on shared tenancy hardware. This means that multiple Amazon Web Services accounts might share the same physical hardware. When you use dedicated hardware, the physical server that hosts your instances is dedicated to your Amazon Web Services account. Instance placement settings contain the details for the physical hardware where instances that Image Builder launches during image creation will run.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Placement {
/// <p>The Availability Zone where your build and test instances will launch.</p>
pub availability_zone: ::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. An instance with a tenancy of <code>host</code> runs on a Dedicated Host.</p>
/// <p>If tenancy is set to <code>host</code>, then you can optionally specify one target for placement – either host ID or host resource group ARN. If automatic placement is enabled for your host, and you don't specify any placement target, Amazon EC2 will try to find an available host for your build and test instances.</p>
pub tenancy: ::std::option::Option<crate::types::TenancyType>,
/// <p>The ID of the Dedicated Host on which build and test instances run. This only applies if <code>tenancy</code> is <code>host</code>. If you specify the host ID, you must not specify the resource group ARN. If you specify both, Image Builder returns an error.</p>
pub host_id: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the host resource group in which to launch build and test instances. This only applies if <code>tenancy</code> is <code>host</code>. If you specify the resource group ARN, you must not specify the host ID. If you specify both, Image Builder returns an error.</p>
pub host_resource_group_arn: ::std::option::Option<::std::string::String>,
}
impl Placement {
/// <p>The Availability Zone where your build and test instances will launch.</p>
pub fn availability_zone(&self) -> ::std::option::Option<&str> {
self.availability_zone.as_deref()
}
/// <p>The tenancy of the instance. An instance with a tenancy of <code>dedicated</code> runs on single-tenant hardware. An instance with a tenancy of <code>host</code> runs on a Dedicated Host.</p>
/// <p>If tenancy is set to <code>host</code>, then you can optionally specify one target for placement – either host ID or host resource group ARN. If automatic placement is enabled for your host, and you don't specify any placement target, Amazon EC2 will try to find an available host for your build and test instances.</p>
pub fn tenancy(&self) -> ::std::option::Option<&crate::types::TenancyType> {
self.tenancy.as_ref()
}
/// <p>The ID of the Dedicated Host on which build and test instances run. This only applies if <code>tenancy</code> is <code>host</code>. If you specify the host ID, you must not specify the resource group ARN. If you specify both, Image Builder returns an error.</p>
pub fn host_id(&self) -> ::std::option::Option<&str> {
self.host_id.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the host resource group in which to launch build and test instances. This only applies if <code>tenancy</code> is <code>host</code>. If you specify the resource group ARN, you must not specify the host ID. If you specify both, Image Builder returns an error.</p>
pub fn host_resource_group_arn(&self) -> ::std::option::Option<&str> {
self.host_resource_group_arn.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: ::std::option::Option<::std::string::String>,
pub(crate) tenancy: ::std::option::Option<crate::types::TenancyType>,
pub(crate) host_id: ::std::option::Option<::std::string::String>,
pub(crate) host_resource_group_arn: ::std::option::Option<::std::string::String>,
}
impl PlacementBuilder {
/// <p>The Availability Zone where your build and test instances will launch.</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 where your build and test instances will launch.</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 where your build and test instances will launch.</p>
pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
&self.availability_zone
}
/// <p>The tenancy of the instance. An instance with a tenancy of <code>dedicated</code> runs on single-tenant hardware. An instance with a tenancy of <code>host</code> runs on a Dedicated Host.</p>
/// <p>If tenancy is set to <code>host</code>, then you can optionally specify one target for placement – either host ID or host resource group ARN. If automatic placement is enabled for your host, and you don't specify any placement target, Amazon EC2 will try to find an available host for your build and test instances.</p>
pub fn tenancy(mut self, input: crate::types::TenancyType) -> 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. An instance with a tenancy of <code>host</code> runs on a Dedicated Host.</p>
/// <p>If tenancy is set to <code>host</code>, then you can optionally specify one target for placement – either host ID or host resource group ARN. If automatic placement is enabled for your host, and you don't specify any placement target, Amazon EC2 will try to find an available host for your build and test instances.</p>
pub fn set_tenancy(mut self, input: ::std::option::Option<crate::types::TenancyType>) -> 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. An instance with a tenancy of <code>host</code> runs on a Dedicated Host.</p>
/// <p>If tenancy is set to <code>host</code>, then you can optionally specify one target for placement – either host ID or host resource group ARN. If automatic placement is enabled for your host, and you don't specify any placement target, Amazon EC2 will try to find an available host for your build and test instances.</p>
pub fn get_tenancy(&self) -> &::std::option::Option<crate::types::TenancyType> {
&self.tenancy
}
/// <p>The ID of the Dedicated Host on which build and test instances run. This only applies if <code>tenancy</code> is <code>host</code>. If you specify the host ID, you must not specify the resource group ARN. If you specify both, Image Builder returns an error.</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 build and test instances run. This only applies if <code>tenancy</code> is <code>host</code>. If you specify the host ID, you must not specify the resource group ARN. If you specify both, Image Builder returns an error.</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 build and test instances run. This only applies if <code>tenancy</code> is <code>host</code>. If you specify the host ID, you must not specify the resource group ARN. If you specify both, Image Builder returns an error.</p>
pub fn get_host_id(&self) -> &::std::option::Option<::std::string::String> {
&self.host_id
}
/// <p>The Amazon Resource Name (ARN) of the host resource group in which to launch build and test instances. This only applies if <code>tenancy</code> is <code>host</code>. If you specify the resource group ARN, you must not specify the host ID. If you specify both, Image Builder returns an error.</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 Amazon Resource Name (ARN) of the host resource group in which to launch build and test instances. This only applies if <code>tenancy</code> is <code>host</code>. If you specify the resource group ARN, you must not specify the host ID. If you specify both, Image Builder returns an error.</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 Amazon Resource Name (ARN) of the host resource group in which to launch build and test instances. This only applies if <code>tenancy</code> is <code>host</code>. If you specify the resource group ARN, you must not specify the host ID. If you specify both, Image Builder returns an error.</p>
pub fn get_host_resource_group_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.host_resource_group_arn
}
/// Consumes the builder and constructs a [`Placement`](crate::types::Placement).
pub fn build(self) -> crate::types::Placement {
crate::types::Placement {
availability_zone: self.availability_zone,
tenancy: self.tenancy,
host_id: self.host_id,
host_resource_group_arn: self.host_resource_group_arn,
}
}
}