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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Create as many Clusters as you want, but create at least one. Each Cluster groups together Nodes that you want to treat as a collection. Within the Cluster, you will set up some Nodes as active Nodes, and some as backup Nodes, for Node failover purposes. Each Node can belong to only one Cluster.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateClusterInput {
/// Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.
pub cluster_type: ::std::option::Option<crate::types::ClusterType>,
/// The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.
pub instance_role_arn: ::std::option::Option<::std::string::String>,
/// Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.
pub name: ::std::option::Option<::std::string::String>,
/// Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.
pub network_settings: ::std::option::Option<crate::types::ClusterNetworkSettingsCreateRequest>,
/// The unique ID of the request.
pub request_id: ::std::option::Option<::std::string::String>,
/// A collection of key-value pairs.
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateClusterInput {
/// Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.
pub fn cluster_type(&self) -> ::std::option::Option<&crate::types::ClusterType> {
self.cluster_type.as_ref()
}
/// The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.
pub fn instance_role_arn(&self) -> ::std::option::Option<&str> {
self.instance_role_arn.as_deref()
}
/// Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.
pub fn network_settings(&self) -> ::std::option::Option<&crate::types::ClusterNetworkSettingsCreateRequest> {
self.network_settings.as_ref()
}
/// The unique ID of the request.
pub fn request_id(&self) -> ::std::option::Option<&str> {
self.request_id.as_deref()
}
/// A collection of key-value pairs.
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
}
impl CreateClusterInput {
/// Creates a new builder-style object to manufacture [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterInputBuilder {
crate::operation::create_cluster::builders::CreateClusterInputBuilder::default()
}
}
/// A builder for [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateClusterInputBuilder {
pub(crate) cluster_type: ::std::option::Option<crate::types::ClusterType>,
pub(crate) instance_role_arn: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) network_settings: ::std::option::Option<crate::types::ClusterNetworkSettingsCreateRequest>,
pub(crate) request_id: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateClusterInputBuilder {
/// Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.
pub fn cluster_type(mut self, input: crate::types::ClusterType) -> Self {
self.cluster_type = ::std::option::Option::Some(input);
self
}
/// Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.
pub fn set_cluster_type(mut self, input: ::std::option::Option<crate::types::ClusterType>) -> Self {
self.cluster_type = input;
self
}
/// Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.
pub fn get_cluster_type(&self) -> &::std::option::Option<crate::types::ClusterType> {
&self.cluster_type
}
/// The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.
pub fn instance_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_role_arn = ::std::option::Option::Some(input.into());
self
}
/// The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.
pub fn set_instance_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_role_arn = input;
self
}
/// The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.
pub fn get_instance_role_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_role_arn
}
/// Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.
pub fn network_settings(mut self, input: crate::types::ClusterNetworkSettingsCreateRequest) -> Self {
self.network_settings = ::std::option::Option::Some(input);
self
}
/// Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.
pub fn set_network_settings(mut self, input: ::std::option::Option<crate::types::ClusterNetworkSettingsCreateRequest>) -> Self {
self.network_settings = input;
self
}
/// Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.
pub fn get_network_settings(&self) -> &::std::option::Option<crate::types::ClusterNetworkSettingsCreateRequest> {
&self.network_settings
}
/// The unique ID of the request.
pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.request_id = ::std::option::Option::Some(input.into());
self
}
/// The unique ID of the request.
pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.request_id = input;
self
}
/// The unique ID of the request.
pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
&self.request_id
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// A collection of key-value pairs.
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = ::std::option::Option::Some(hash_map);
self
}
/// A collection of key-value pairs.
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.tags = input;
self
}
/// A collection of key-value pairs.
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
/// Consumes the builder and constructs a [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterInput {
cluster_type: self.cluster_type,
instance_role_arn: self.instance_role_arn,
name: self.name,
network_settings: self.network_settings,
request_id: self.request_id,
tags: self.tags,
})
}
}