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 pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192 self.inner = self.inner.subnet_ids(input.into());
193 self
194 }
195 /// <p>The VPC subnets that the domain uses for communication.</p>
196 pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
197 self.inner = self.inner.set_subnet_ids(input);
198 self
199 }
200 /// <p>The VPC subnets that the domain uses for communication.</p>
201 pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
202 self.inner.get_subnet_ids()
203 }
204 /// <p>The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.</p>
205 pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206 self.inner = self.inner.vpc_id(input.into());
207 self
208 }
209 /// <p>The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.</p>
210 pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
211 self.inner = self.inner.set_vpc_id(input);
212 self
213 }
214 /// <p>The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.</p>
215 pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
216 self.inner.get_vpc_id()
217 }
218 ///
219 /// Appends an item to `Tags`.
220 ///
221 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
222 ///
223 /// <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>
224 /// <p>Tags that you specify for the Domain are also added to all Apps that the Domain launches.</p>
225 pub fn tags(mut self, input: crate::types::Tag) -> Self {
226 self.inner = self.inner.tags(input);
227 self
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 set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
232 self.inner = self.inner.set_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 get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
238 self.inner.get_tags()
239 }
240 /// <p>Specifies the VPC used for non-EFS traffic. The default value is <code>PublicInternetOnly</code>.</p>
241 /// <ul>
242 /// <li>
243 /// <p><code>PublicInternetOnly</code> - Non-EFS traffic is through a VPC managed by Amazon SageMaker AI, which allows direct internet access</p></li>
244 /// <li>
245 /// <p><code>VpcOnly</code> - All traffic is through the specified VPC and subnets</p></li>
246 /// </ul>
247 pub fn app_network_access_type(mut self, input: crate::types::AppNetworkAccessType) -> Self {
248 self.inner = self.inner.app_network_access_type(input);
249 self
250 }
251 /// <p>Specifies the VPC used for non-EFS traffic. The default value is <code>PublicInternetOnly</code>.</p>
252 /// <ul>
253 /// <li>
254 /// <p><code>PublicInternetOnly</code> - Non-EFS traffic is through a VPC managed by Amazon SageMaker AI, which allows direct internet access</p></li>
255 /// <li>
256 /// <p><code>VpcOnly</code> - All traffic is through the specified VPC and subnets</p></li>
257 /// </ul>
258 pub fn set_app_network_access_type(mut self, input: ::std::option::Option<crate::types::AppNetworkAccessType>) -> Self {
259 self.inner = self.inner.set_app_network_access_type(input);
260 self
261 }
262 /// <p>Specifies the VPC used for non-EFS traffic. The default value is <code>PublicInternetOnly</code>.</p>
263 /// <ul>
264 /// <li>
265 /// <p><code>PublicInternetOnly</code> - Non-EFS traffic is through a VPC managed by Amazon SageMaker AI, which allows direct internet access</p></li>
266 /// <li>
267 /// <p><code>VpcOnly</code> - All traffic is through the specified VPC and subnets</p></li>
268 /// </ul>
269 pub fn get_app_network_access_type(&self) -> &::std::option::Option<crate::types::AppNetworkAccessType> {
270 self.inner.get_app_network_access_type()
271 }
272 /// <p>Use <code>KmsKeyId</code>.</p>
273 #[deprecated(note = "This property is deprecated, use KmsKeyId instead.")]
274 pub fn home_efs_file_system_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
275 self.inner = self.inner.home_efs_file_system_kms_key_id(input.into());
276 self
277 }
278 /// <p>Use <code>KmsKeyId</code>.</p>
279 #[deprecated(note = "This property is deprecated, use KmsKeyId instead.")]
280 pub fn set_home_efs_file_system_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
281 self.inner = self.inner.set_home_efs_file_system_kms_key_id(input);
282 self
283 }
284 /// <p>Use <code>KmsKeyId</code>.</p>
285 #[deprecated(note = "This property is deprecated, use KmsKeyId instead.")]
286 pub fn get_home_efs_file_system_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
287 self.inner.get_home_efs_file_system_kms_key_id()
288 }
289 /// <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>
290 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
291 self.inner = self.inner.kms_key_id(input.into());
292 self
293 }
294 /// <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>
295 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
296 self.inner = self.inner.set_kms_key_id(input);
297 self
298 }
299 /// <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>
300 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
301 self.inner.get_kms_key_id()
302 }
303 /// <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>
304 pub fn app_security_group_management(mut self, input: crate::types::AppSecurityGroupManagement) -> Self {
305 self.inner = self.inner.app_security_group_management(input);
306 self
307 }
308 /// <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>
309 pub fn set_app_security_group_management(mut self, input: ::std::option::Option<crate::types::AppSecurityGroupManagement>) -> Self {
310 self.inner = self.inner.set_app_security_group_management(input);
311 self
312 }
313 /// <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>
314 pub fn get_app_security_group_management(&self) -> &::std::option::Option<crate::types::AppSecurityGroupManagement> {
315 self.inner.get_app_security_group_management()
316 }
317 /// <p>Indicates whether custom tag propagation is supported for the domain. Defaults to <code>DISABLED</code>.</p>
318 pub fn tag_propagation(mut self, input: crate::types::TagPropagation) -> Self {
319 self.inner = self.inner.tag_propagation(input);
320 self
321 }
322 /// <p>Indicates whether custom tag propagation is supported for the domain. Defaults to <code>DISABLED</code>.</p>
323 pub fn set_tag_propagation(mut self, input: ::std::option::Option<crate::types::TagPropagation>) -> Self {
324 self.inner = self.inner.set_tag_propagation(input);
325 self
326 }
327 /// <p>Indicates whether custom tag propagation is supported for the domain. Defaults to <code>DISABLED</code>.</p>
328 pub fn get_tag_propagation(&self) -> &::std::option::Option<crate::types::TagPropagation> {
329 self.inner.get_tag_propagation()
330 }
331 /// <p>The default settings for shared spaces that users create in the domain.</p>
332 pub fn default_space_settings(mut self, input: crate::types::DefaultSpaceSettings) -> Self {
333 self.inner = self.inner.default_space_settings(input);
334 self
335 }
336 /// <p>The default settings for shared spaces that users create in the domain.</p>
337 pub fn set_default_space_settings(mut self, input: ::std::option::Option<crate::types::DefaultSpaceSettings>) -> Self {
338 self.inner = self.inner.set_default_space_settings(input);
339 self
340 }
341 /// <p>The default settings for shared spaces that users create in the domain.</p>
342 pub fn get_default_space_settings(&self) -> &::std::option::Option<crate::types::DefaultSpaceSettings> {
343 self.inner.get_default_space_settings()
344 }
345}