aws_sdk_sagemaker/operation/create_domain/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_domain::_create_domain_output::CreateDomainOutputBuilder;
3
4pub use crate::operation::create_domain::_create_domain_input::CreateDomainInputBuilder;
5
6impl crate::operation::create_domain::builders::CreateDomainInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_domain::CreateDomainOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_domain::CreateDomainError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_domain();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateDomain`.
24///
25/// <p>Creates a <code>Domain</code>. A domain consists of an associated Amazon Elastic File System volume, a list of authorized users, and a variety of security, application, policy, and Amazon Virtual Private Cloud (VPC) configurations. Users within a domain can share notebook files and other artifacts with each other.</p>
26/// <p><b>EFS storage</b></p>
27/// <p>When a domain is created, an EFS volume is created for use by all of the users within the domain. Each user receives a private home directory within the EFS volume for notebooks, Git repositories, and data files.</p>
28/// <p>SageMaker AI uses the Amazon Web Services Key Management Service (Amazon Web Services KMS) to encrypt the EFS volume attached to the domain with an Amazon Web Services managed key by default. For more control, you can specify a customer managed key. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/encryption-at-rest.html">Protect Data at Rest Using Encryption</a>.</p>
29/// <p><b>VPC configuration</b></p>
30/// <p>All traffic between the domain and the Amazon EFS volume is through the specified VPC and subnets. For other traffic, you can specify the <code>AppNetworkAccessType</code> parameter. <code>AppNetworkAccessType</code> corresponds to the network access type that you choose when you onboard to the domain. The following options are available:</p>
31/// <ul>
32/// <li>
33/// <p><code>PublicInternetOnly</code> - Non-EFS traffic goes through a VPC managed by Amazon SageMaker AI, which allows internet access. This is the default value.</p></li>
34/// <li>
35/// <p><code>VpcOnly</code> - All traffic is through the specified VPC and subnets. Internet access is disabled by default. To allow internet access, you must specify a NAT gateway.</p>
36/// <p>When internet access is disabled, you won't be able to run a Amazon SageMaker AI Studio notebook or to train or host models unless your VPC has an interface endpoint to the SageMaker AI API and runtime or a NAT gateway and your security groups allow outbound connections.</p></li>
37/// </ul><important>
38/// <p>NFS traffic over TCP on port 2049 needs to be allowed in both inbound and outbound rules in order to launch a Amazon SageMaker AI Studio app successfully.</p>
39/// </important>
40/// <p>For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/studio-notebooks-and-internet-access.html">Connect Amazon SageMaker AI Studio Notebooks to Resources in a VPC</a>.</p>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct CreateDomainFluentBuilder {
43 handle: ::std::sync::Arc<crate::client::Handle>,
44 inner: crate::operation::create_domain::builders::CreateDomainInputBuilder,
45 config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48 crate::client::customize::internal::CustomizableSend<
49 crate::operation::create_domain::CreateDomainOutput,
50 crate::operation::create_domain::CreateDomainError,
51 > for CreateDomainFluentBuilder
52{
53 fn send(
54 self,
55 config_override: crate::config::Builder,
56 ) -> crate::client::customize::internal::BoxFuture<
57 crate::client::customize::internal::SendResult<
58 crate::operation::create_domain::CreateDomainOutput,
59 crate::operation::create_domain::CreateDomainError,
60 >,
61 > {
62 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63 }
64}
65impl CreateDomainFluentBuilder {
66 /// Creates a new `CreateDomainFluentBuilder`.
67 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68 Self {
69 handle,
70 inner: ::std::default::Default::default(),
71 config_override: ::std::option::Option::None,
72 }
73 }
74 /// Access the CreateDomain as a reference.
75 pub fn as_input(&self) -> &crate::operation::create_domain::builders::CreateDomainInputBuilder {
76 &self.inner
77 }
78 /// Sends the request and returns the response.
79 ///
80 /// If an error occurs, an `SdkError` will be returned with additional details that
81 /// can be matched against.
82 ///
83 /// By default, any retryable failures will be retried twice. Retry behavior
84 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85 /// set when configuring the client.
86 pub async fn send(
87 self,
88 ) -> ::std::result::Result<
89 crate::operation::create_domain::CreateDomainOutput,
90 ::aws_smithy_runtime_api::client::result::SdkError<
91 crate::operation::create_domain::CreateDomainError,
92 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93 >,
94 > {
95 let input = self
96 .inner
97 .build()
98 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99 let runtime_plugins = crate::operation::create_domain::CreateDomain::operation_runtime_plugins(
100 self.handle.runtime_plugins.clone(),
101 &self.handle.conf,
102 self.config_override,
103 );
104 crate::operation::create_domain::CreateDomain::orchestrate(&runtime_plugins, input).await
105 }
106
107 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108 pub fn customize(
109 self,
110 ) -> crate::client::customize::CustomizableOperation<
111 crate::operation::create_domain::CreateDomainOutput,
112 crate::operation::create_domain::CreateDomainError,
113 Self,
114 > {
115 crate::client::customize::CustomizableOperation::new(self)
116 }
117 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118 self.set_config_override(::std::option::Option::Some(config_override.into()));
119 self
120 }
121
122 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123 self.config_override = config_override;
124 self
125 }
126 /// <p>A name for the domain.</p>
127 pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.inner = self.inner.domain_name(input.into());
129 self
130 }
131 /// <p>A name for the domain.</p>
132 pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.inner = self.inner.set_domain_name(input);
134 self
135 }
136 /// <p>A name for the domain.</p>
137 pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
138 self.inner.get_domain_name()
139 }
140 /// <p>The mode of authentication that members use to access the domain.</p>
141 pub fn auth_mode(mut self, input: crate::types::AuthMode) -> Self {
142 self.inner = self.inner.auth_mode(input);
143 self
144 }
145 /// <p>The mode of authentication that members use to access the domain.</p>
146 pub fn set_auth_mode(mut self, input: ::std::option::Option<crate::types::AuthMode>) -> Self {
147 self.inner = self.inner.set_auth_mode(input);
148 self
149 }
150 /// <p>The mode of authentication that members use to access the domain.</p>
151 pub fn get_auth_mode(&self) -> &::std::option::Option<crate::types::AuthMode> {
152 self.inner.get_auth_mode()
153 }
154 /// <p>The default settings to use to create a user profile when <code>UserSettings</code> isn't specified in the call to the <code>CreateUserProfile</code> API.</p>
155 /// <p><code>SecurityGroups</code> is aggregated when specified in both calls. For all other settings in <code>UserSettings</code>, the values specified in <code>CreateUserProfile</code> take precedence over those specified in <code>CreateDomain</code>.</p>
156 pub fn default_user_settings(mut self, input: crate::types::UserSettings) -> Self {
157 self.inner = self.inner.default_user_settings(input);
158 self
159 }
160 /// <p>The default settings to use to create a user profile when <code>UserSettings</code> isn't specified in the call to the <code>CreateUserProfile</code> API.</p>
161 /// <p><code>SecurityGroups</code> is aggregated when specified in both calls. For all other settings in <code>UserSettings</code>, the values specified in <code>CreateUserProfile</code> take precedence over those specified in <code>CreateDomain</code>.</p>
162 pub fn set_default_user_settings(mut self, input: ::std::option::Option<crate::types::UserSettings>) -> Self {
163 self.inner = self.inner.set_default_user_settings(input);
164 self
165 }
166 /// <p>The default settings to use to create a user profile when <code>UserSettings</code> isn't specified in the call to the <code>CreateUserProfile</code> API.</p>
167 /// <p><code>SecurityGroups</code> is aggregated when specified in both calls. For all other settings in <code>UserSettings</code>, the values specified in <code>CreateUserProfile</code> take precedence over those specified in <code>CreateDomain</code>.</p>
168 pub fn get_default_user_settings(&self) -> &::std::option::Option<crate::types::UserSettings> {
169 self.inner.get_default_user_settings()
170 }
171 /// <p>A collection of <code>Domain</code> settings.</p>
172 pub fn domain_settings(mut self, input: crate::types::DomainSettings) -> Self {
173 self.inner = self.inner.domain_settings(input);
174 self
175 }
176 /// <p>A collection of <code>Domain</code> settings.</p>
177 pub fn set_domain_settings(mut self, input: ::std::option::Option<crate::types::DomainSettings>) -> Self {
178 self.inner = self.inner.set_domain_settings(input);
179 self
180 }
181 /// <p>A collection of <code>Domain</code> settings.</p>
182 pub fn get_domain_settings(&self) -> &::std::option::Option<crate::types::DomainSettings> {
183 self.inner.get_domain_settings()
184 }
185 ///
186 /// Appends an item to `SubnetIds`.
187 ///
188 /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
189 ///
190 /// <p>The VPC subnets that the domain uses for communication.</p>
191 /// <p>The field is optional when the <code>AppNetworkAccessType</code> parameter is set to <code>PublicInternetOnly</code> for domains created from Amazon SageMaker Unified Studio.</p>
192 pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193 self.inner = self.inner.subnet_ids(input.into());
194 self
195 }
196 /// <p>The VPC subnets that the domain uses for communication.</p>
197 /// <p>The field is optional when the <code>AppNetworkAccessType</code> parameter is set to <code>PublicInternetOnly</code> for domains created from Amazon SageMaker Unified Studio.</p>
198 pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
199 self.inner = self.inner.set_subnet_ids(input);
200 self
201 }
202 /// <p>The VPC subnets that the domain uses for communication.</p>
203 /// <p>The field is optional when the <code>AppNetworkAccessType</code> parameter is set to <code>PublicInternetOnly</code> for domains created from Amazon SageMaker Unified Studio.</p>
204 pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
205 self.inner.get_subnet_ids()
206 }
207 /// <p>The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.</p>
208 /// <p>The field is optional when the <code>AppNetworkAccessType</code> parameter is set to <code>PublicInternetOnly</code> for domains created from Amazon SageMaker Unified Studio.</p>
209 pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210 self.inner = self.inner.vpc_id(input.into());
211 self
212 }
213 /// <p>The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.</p>
214 /// <p>The field is optional when the <code>AppNetworkAccessType</code> parameter is set to <code>PublicInternetOnly</code> for domains created from Amazon SageMaker Unified Studio.</p>
215 pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216 self.inner = self.inner.set_vpc_id(input);
217 self
218 }
219 /// <p>The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.</p>
220 /// <p>The field is optional when the <code>AppNetworkAccessType</code> parameter is set to <code>PublicInternetOnly</code> for domains created from Amazon SageMaker Unified Studio.</p>
221 pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
222 self.inner.get_vpc_id()
223 }
224 ///
225 /// Appends an item to `Tags`.
226 ///
227 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
228 ///
229 /// <p>Tags to associated with the Domain. Each tag consists of a key and an optional value. Tag keys must be unique per resource. Tags are searchable using the <code>Search</code> API.</p>
230 /// <p>Tags that you specify for the Domain are also added to all Apps that the Domain launches.</p>
231 pub fn tags(mut self, input: crate::types::Tag) -> Self {
232 self.inner = self.inner.tags(input);
233 self
234 }
235 /// <p>Tags to associated with the Domain. Each tag consists of a key and an optional value. Tag keys must be unique per resource. Tags are searchable using the <code>Search</code> API.</p>
236 /// <p>Tags that you specify for the Domain are also added to all Apps that the Domain launches.</p>
237 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
238 self.inner = self.inner.set_tags(input);
239 self
240 }
241 /// <p>Tags to associated with the Domain. Each tag consists of a key and an optional value. Tag keys must be unique per resource. Tags are searchable using the <code>Search</code> API.</p>
242 /// <p>Tags that you specify for the Domain are also added to all Apps that the Domain launches.</p>
243 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
244 self.inner.get_tags()
245 }
246 /// <p>Specifies the VPC used for non-EFS traffic. The default value is <code>PublicInternetOnly</code>.</p>
247 /// <ul>
248 /// <li>
249 /// <p><code>PublicInternetOnly</code> - Non-EFS traffic is through a VPC managed by Amazon SageMaker AI, which allows direct internet access</p></li>
250 /// <li>
251 /// <p><code>VpcOnly</code> - All traffic is through the specified VPC and subnets</p></li>
252 /// </ul>
253 pub fn app_network_access_type(mut self, input: crate::types::AppNetworkAccessType) -> Self {
254 self.inner = self.inner.app_network_access_type(input);
255 self
256 }
257 /// <p>Specifies the VPC used for non-EFS traffic. The default value is <code>PublicInternetOnly</code>.</p>
258 /// <ul>
259 /// <li>
260 /// <p><code>PublicInternetOnly</code> - Non-EFS traffic is through a VPC managed by Amazon SageMaker AI, which allows direct internet access</p></li>
261 /// <li>
262 /// <p><code>VpcOnly</code> - All traffic is through the specified VPC and subnets</p></li>
263 /// </ul>
264 pub fn set_app_network_access_type(mut self, input: ::std::option::Option<crate::types::AppNetworkAccessType>) -> Self {
265 self.inner = self.inner.set_app_network_access_type(input);
266 self
267 }
268 /// <p>Specifies the VPC used for non-EFS traffic. The default value is <code>PublicInternetOnly</code>.</p>
269 /// <ul>
270 /// <li>
271 /// <p><code>PublicInternetOnly</code> - Non-EFS traffic is through a VPC managed by Amazon SageMaker AI, which allows direct internet access</p></li>
272 /// <li>
273 /// <p><code>VpcOnly</code> - All traffic is through the specified VPC and subnets</p></li>
274 /// </ul>
275 pub fn get_app_network_access_type(&self) -> &::std::option::Option<crate::types::AppNetworkAccessType> {
276 self.inner.get_app_network_access_type()
277 }
278 /// <p>Use <code>KmsKeyId</code>.</p>
279 #[deprecated(note = "This property is deprecated, use KmsKeyId instead.")]
280 pub fn home_efs_file_system_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
281 self.inner = self.inner.home_efs_file_system_kms_key_id(input.into());
282 self
283 }
284 /// <p>Use <code>KmsKeyId</code>.</p>
285 #[deprecated(note = "This property is deprecated, use KmsKeyId instead.")]
286 pub fn set_home_efs_file_system_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
287 self.inner = self.inner.set_home_efs_file_system_kms_key_id(input);
288 self
289 }
290 /// <p>Use <code>KmsKeyId</code>.</p>
291 #[deprecated(note = "This property is deprecated, use KmsKeyId instead.")]
292 pub fn get_home_efs_file_system_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
293 self.inner.get_home_efs_file_system_kms_key_id()
294 }
295 /// <p>SageMaker AI uses Amazon Web Services KMS to encrypt EFS and EBS volumes attached to the domain with an Amazon Web Services managed key by default. For more control, specify a customer managed key.</p>
296 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
297 self.inner = self.inner.kms_key_id(input.into());
298 self
299 }
300 /// <p>SageMaker AI uses Amazon Web Services KMS to encrypt EFS and EBS volumes attached to the domain with an Amazon Web Services managed key by default. For more control, specify a customer managed key.</p>
301 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
302 self.inner = self.inner.set_kms_key_id(input);
303 self
304 }
305 /// <p>SageMaker AI uses Amazon Web Services KMS to encrypt EFS and EBS volumes attached to the domain with an Amazon Web Services managed key by default. For more control, specify a customer managed key.</p>
306 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
307 self.inner.get_kms_key_id()
308 }
309 /// <p>The entity that creates and manages the required security groups for inter-app communication in <code>VPCOnly</code> mode. Required when <code>CreateDomain.AppNetworkAccessType</code> is <code>VPCOnly</code> and <code>DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn</code> is provided. If setting up the domain for use with RStudio, this value must be set to <code>Service</code>.</p>
310 pub fn app_security_group_management(mut self, input: crate::types::AppSecurityGroupManagement) -> Self {
311 self.inner = self.inner.app_security_group_management(input);
312 self
313 }
314 /// <p>The entity that creates and manages the required security groups for inter-app communication in <code>VPCOnly</code> mode. Required when <code>CreateDomain.AppNetworkAccessType</code> is <code>VPCOnly</code> and <code>DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn</code> is provided. If setting up the domain for use with RStudio, this value must be set to <code>Service</code>.</p>
315 pub fn set_app_security_group_management(mut self, input: ::std::option::Option<crate::types::AppSecurityGroupManagement>) -> Self {
316 self.inner = self.inner.set_app_security_group_management(input);
317 self
318 }
319 /// <p>The entity that creates and manages the required security groups for inter-app communication in <code>VPCOnly</code> mode. Required when <code>CreateDomain.AppNetworkAccessType</code> is <code>VPCOnly</code> and <code>DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn</code> is provided. If setting up the domain for use with RStudio, this value must be set to <code>Service</code>.</p>
320 pub fn get_app_security_group_management(&self) -> &::std::option::Option<crate::types::AppSecurityGroupManagement> {
321 self.inner.get_app_security_group_management()
322 }
323 /// <p>Indicates whether custom tag propagation is supported for the domain. Defaults to <code>DISABLED</code>.</p>
324 pub fn tag_propagation(mut self, input: crate::types::TagPropagation) -> Self {
325 self.inner = self.inner.tag_propagation(input);
326 self
327 }
328 /// <p>Indicates whether custom tag propagation is supported for the domain. Defaults to <code>DISABLED</code>.</p>
329 pub fn set_tag_propagation(mut self, input: ::std::option::Option<crate::types::TagPropagation>) -> Self {
330 self.inner = self.inner.set_tag_propagation(input);
331 self
332 }
333 /// <p>Indicates whether custom tag propagation is supported for the domain. Defaults to <code>DISABLED</code>.</p>
334 pub fn get_tag_propagation(&self) -> &::std::option::Option<crate::types::TagPropagation> {
335 self.inner.get_tag_propagation()
336 }
337 /// <p>The default settings for shared spaces that users create in the domain.</p>
338 pub fn default_space_settings(mut self, input: crate::types::DefaultSpaceSettings) -> Self {
339 self.inner = self.inner.default_space_settings(input);
340 self
341 }
342 /// <p>The default settings for shared spaces that users create in the domain.</p>
343 pub fn set_default_space_settings(mut self, input: ::std::option::Option<crate::types::DefaultSpaceSettings>) -> Self {
344 self.inner = self.inner.set_default_space_settings(input);
345 self
346 }
347 /// <p>The default settings for shared spaces that users create in the domain.</p>
348 pub fn get_default_space_settings(&self) -> &::std::option::Option<crate::types::DefaultSpaceSettings> {
349 self.inner.get_default_space_settings()
350 }
351}