aws_sdk_cloudhsm/operation/create_hsm/_create_hsm_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the inputs for the <code>CreateHsm</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateHsmInput {
7 /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
8 pub subnet_id: ::std::option::Option<::std::string::String>,
9 /// <p>The SSH public key to install on the HSM.</p>
10 pub ssh_key: ::std::option::Option<::std::string::String>,
11 /// <p>The IP address to assign to the HSM's ENI.</p>
12 /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
13 pub eni_ip: ::std::option::Option<::std::string::String>,
14 /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
15 pub iam_role_arn: ::std::option::Option<::std::string::String>,
16 /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
17 pub external_id: ::std::option::Option<::std::string::String>,
18 /// <p>Specifies the type of subscription for the HSM.</p>
19 /// <ul>
20 /// <li>
21 /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
22 /// <li>
23 /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
24 /// </ul>
25 pub subscription_type: ::std::option::Option<crate::types::SubscriptionType>,
26 /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
27 pub client_token: ::std::option::Option<::std::string::String>,
28 /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
29 pub syslog_ip: ::std::option::Option<::std::string::String>,
30}
31impl CreateHsmInput {
32 /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
33 pub fn subnet_id(&self) -> ::std::option::Option<&str> {
34 self.subnet_id.as_deref()
35 }
36 /// <p>The SSH public key to install on the HSM.</p>
37 pub fn ssh_key(&self) -> ::std::option::Option<&str> {
38 self.ssh_key.as_deref()
39 }
40 /// <p>The IP address to assign to the HSM's ENI.</p>
41 /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
42 pub fn eni_ip(&self) -> ::std::option::Option<&str> {
43 self.eni_ip.as_deref()
44 }
45 /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
46 pub fn iam_role_arn(&self) -> ::std::option::Option<&str> {
47 self.iam_role_arn.as_deref()
48 }
49 /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
50 pub fn external_id(&self) -> ::std::option::Option<&str> {
51 self.external_id.as_deref()
52 }
53 /// <p>Specifies the type of subscription for the HSM.</p>
54 /// <ul>
55 /// <li>
56 /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
57 /// <li>
58 /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
59 /// </ul>
60 pub fn subscription_type(&self) -> ::std::option::Option<&crate::types::SubscriptionType> {
61 self.subscription_type.as_ref()
62 }
63 /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
64 pub fn client_token(&self) -> ::std::option::Option<&str> {
65 self.client_token.as_deref()
66 }
67 /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
68 pub fn syslog_ip(&self) -> ::std::option::Option<&str> {
69 self.syslog_ip.as_deref()
70 }
71}
72impl CreateHsmInput {
73 /// Creates a new builder-style object to manufacture [`CreateHsmInput`](crate::operation::create_hsm::CreateHsmInput).
74 pub fn builder() -> crate::operation::create_hsm::builders::CreateHsmInputBuilder {
75 crate::operation::create_hsm::builders::CreateHsmInputBuilder::default()
76 }
77}
78
79/// A builder for [`CreateHsmInput`](crate::operation::create_hsm::CreateHsmInput).
80#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
81#[non_exhaustive]
82pub struct CreateHsmInputBuilder {
83 pub(crate) subnet_id: ::std::option::Option<::std::string::String>,
84 pub(crate) ssh_key: ::std::option::Option<::std::string::String>,
85 pub(crate) eni_ip: ::std::option::Option<::std::string::String>,
86 pub(crate) iam_role_arn: ::std::option::Option<::std::string::String>,
87 pub(crate) external_id: ::std::option::Option<::std::string::String>,
88 pub(crate) subscription_type: ::std::option::Option<crate::types::SubscriptionType>,
89 pub(crate) client_token: ::std::option::Option<::std::string::String>,
90 pub(crate) syslog_ip: ::std::option::Option<::std::string::String>,
91}
92impl CreateHsmInputBuilder {
93 /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
94 /// This field is required.
95 pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96 self.subnet_id = ::std::option::Option::Some(input.into());
97 self
98 }
99 /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
100 pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101 self.subnet_id = input;
102 self
103 }
104 /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
105 pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
106 &self.subnet_id
107 }
108 /// <p>The SSH public key to install on the HSM.</p>
109 /// This field is required.
110 pub fn ssh_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 self.ssh_key = ::std::option::Option::Some(input.into());
112 self
113 }
114 /// <p>The SSH public key to install on the HSM.</p>
115 pub fn set_ssh_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.ssh_key = input;
117 self
118 }
119 /// <p>The SSH public key to install on the HSM.</p>
120 pub fn get_ssh_key(&self) -> &::std::option::Option<::std::string::String> {
121 &self.ssh_key
122 }
123 /// <p>The IP address to assign to the HSM's ENI.</p>
124 /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
125 pub fn eni_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126 self.eni_ip = ::std::option::Option::Some(input.into());
127 self
128 }
129 /// <p>The IP address to assign to the HSM's ENI.</p>
130 /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
131 pub fn set_eni_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.eni_ip = input;
133 self
134 }
135 /// <p>The IP address to assign to the HSM's ENI.</p>
136 /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
137 pub fn get_eni_ip(&self) -> &::std::option::Option<::std::string::String> {
138 &self.eni_ip
139 }
140 /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
141 /// This field is required.
142 pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.iam_role_arn = ::std::option::Option::Some(input.into());
144 self
145 }
146 /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
147 pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148 self.iam_role_arn = input;
149 self
150 }
151 /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
152 pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
153 &self.iam_role_arn
154 }
155 /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
156 pub fn external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157 self.external_id = ::std::option::Option::Some(input.into());
158 self
159 }
160 /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
161 pub fn set_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162 self.external_id = input;
163 self
164 }
165 /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
166 pub fn get_external_id(&self) -> &::std::option::Option<::std::string::String> {
167 &self.external_id
168 }
169 /// <p>Specifies the type of subscription for the HSM.</p>
170 /// <ul>
171 /// <li>
172 /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
173 /// <li>
174 /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
175 /// </ul>
176 /// This field is required.
177 pub fn subscription_type(mut self, input: crate::types::SubscriptionType) -> Self {
178 self.subscription_type = ::std::option::Option::Some(input);
179 self
180 }
181 /// <p>Specifies the type of subscription for the HSM.</p>
182 /// <ul>
183 /// <li>
184 /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
185 /// <li>
186 /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
187 /// </ul>
188 pub fn set_subscription_type(mut self, input: ::std::option::Option<crate::types::SubscriptionType>) -> Self {
189 self.subscription_type = input;
190 self
191 }
192 /// <p>Specifies the type of subscription for the HSM.</p>
193 /// <ul>
194 /// <li>
195 /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
196 /// <li>
197 /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
198 /// </ul>
199 pub fn get_subscription_type(&self) -> &::std::option::Option<crate::types::SubscriptionType> {
200 &self.subscription_type
201 }
202 /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
203 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204 self.client_token = ::std::option::Option::Some(input.into());
205 self
206 }
207 /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
208 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209 self.client_token = input;
210 self
211 }
212 /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
213 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
214 &self.client_token
215 }
216 /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
217 pub fn syslog_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218 self.syslog_ip = ::std::option::Option::Some(input.into());
219 self
220 }
221 /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
222 pub fn set_syslog_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223 self.syslog_ip = input;
224 self
225 }
226 /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
227 pub fn get_syslog_ip(&self) -> &::std::option::Option<::std::string::String> {
228 &self.syslog_ip
229 }
230 /// Consumes the builder and constructs a [`CreateHsmInput`](crate::operation::create_hsm::CreateHsmInput).
231 pub fn build(self) -> ::std::result::Result<crate::operation::create_hsm::CreateHsmInput, ::aws_smithy_types::error::operation::BuildError> {
232 ::std::result::Result::Ok(crate::operation::create_hsm::CreateHsmInput {
233 subnet_id: self.subnet_id,
234 ssh_key: self.ssh_key,
235 eni_ip: self.eni_ip,
236 iam_role_arn: self.iam_role_arn,
237 external_id: self.external_id,
238 subscription_type: self.subscription_type,
239 client_token: self.client_token,
240 syslog_ip: self.syslog_ip,
241 })
242 }
243}