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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_domain::_create_domain_output::CreateDomainOutputBuilder;
pub use crate::operation::create_domain::_create_domain_input::CreateDomainInputBuilder;
impl crate::operation::create_domain::builders::CreateDomainInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::create_domain::CreateDomainOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_domain::CreateDomainError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.create_domain();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `CreateDomain`.
///
/// <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>
/// <p><b>EFS storage</b></p>
/// <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>
/// <p>SageMaker 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>
/// <p><b>VPC configuration</b></p>
/// <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>
/// <ul>
/// <li>
/// <p><code>PublicInternetOnly</code> - Non-EFS traffic goes through a VPC managed by Amazon SageMaker, which allows internet access. This is the default value.</p></li>
/// <li>
/// <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>
/// <p>When internet access is disabled, you won't be able to run a Amazon SageMaker Studio notebook or to train or host models unless your VPC has an interface endpoint to the SageMaker API and runtime or a NAT gateway and your security groups allow outbound connections.</p></li>
/// </ul><important>
/// <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 Studio app successfully.</p>
/// </important>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/studio-notebooks-and-internet-access.html">Connect Amazon SageMaker Studio Notebooks to Resources in a VPC</a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateDomainFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_domain::builders::CreateDomainInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::create_domain::CreateDomainOutput,
crate::operation::create_domain::CreateDomainError,
> for CreateDomainFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::create_domain::CreateDomainOutput,
crate::operation::create_domain::CreateDomainError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl CreateDomainFluentBuilder {
/// Creates a new `CreateDomainFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the CreateDomain as a reference.
pub fn as_input(&self) -> &crate::operation::create_domain::builders::CreateDomainInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::create_domain::CreateDomainOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_domain::CreateDomainError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::create_domain::CreateDomain::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::create_domain::CreateDomain::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::create_domain::CreateDomainOutput,
crate::operation::create_domain::CreateDomainError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>A name for the domain.</p>
pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.domain_name(input.into());
self
}
/// <p>A name for the domain.</p>
pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_domain_name(input);
self
}
/// <p>A name for the domain.</p>
pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_domain_name()
}
/// <p>The mode of authentication that members use to access the domain.</p>
pub fn auth_mode(mut self, input: crate::types::AuthMode) -> Self {
self.inner = self.inner.auth_mode(input);
self
}
/// <p>The mode of authentication that members use to access the domain.</p>
pub fn set_auth_mode(mut self, input: ::std::option::Option<crate::types::AuthMode>) -> Self {
self.inner = self.inner.set_auth_mode(input);
self
}
/// <p>The mode of authentication that members use to access the domain.</p>
pub fn get_auth_mode(&self) -> &::std::option::Option<crate::types::AuthMode> {
self.inner.get_auth_mode()
}
/// <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>
/// <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>
pub fn default_user_settings(mut self, input: crate::types::UserSettings) -> Self {
self.inner = self.inner.default_user_settings(input);
self
}
/// <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>
/// <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>
pub fn set_default_user_settings(mut self, input: ::std::option::Option<crate::types::UserSettings>) -> Self {
self.inner = self.inner.set_default_user_settings(input);
self
}
/// <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>
/// <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>
pub fn get_default_user_settings(&self) -> &::std::option::Option<crate::types::UserSettings> {
self.inner.get_default_user_settings()
}
/// <p>A collection of <code>Domain</code> settings.</p>
pub fn domain_settings(mut self, input: crate::types::DomainSettings) -> Self {
self.inner = self.inner.domain_settings(input);
self
}
/// <p>A collection of <code>Domain</code> settings.</p>
pub fn set_domain_settings(mut self, input: ::std::option::Option<crate::types::DomainSettings>) -> Self {
self.inner = self.inner.set_domain_settings(input);
self
}
/// <p>A collection of <code>Domain</code> settings.</p>
pub fn get_domain_settings(&self) -> &::std::option::Option<crate::types::DomainSettings> {
self.inner.get_domain_settings()
}
///
/// Appends an item to `SubnetIds`.
///
/// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
///
/// <p>The VPC subnets that the domain uses for communication.</p>
pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.subnet_ids(input.into());
self
}
/// <p>The VPC subnets that the domain uses for communication.</p>
pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_subnet_ids(input);
self
}
/// <p>The VPC subnets that the domain uses for communication.</p>
pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_subnet_ids()
}
/// <p>The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.</p>
pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.vpc_id(input.into());
self
}
/// <p>The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.</p>
pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_vpc_id(input);
self
}
/// <p>The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.</p>
pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_vpc_id()
}
///
/// Appends an item to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <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>
/// <p>Tags that you specify for the Domain are also added to all Apps that the Domain launches.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <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>
/// <p>Tags that you specify for the Domain are also added to all Apps that the Domain launches.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// <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>
/// <p>Tags that you specify for the Domain are also added to all Apps that the Domain launches.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
self.inner.get_tags()
}
/// <p>Specifies the VPC used for non-EFS traffic. The default value is <code>PublicInternetOnly</code>.</p>
/// <ul>
/// <li>
/// <p><code>PublicInternetOnly</code> - Non-EFS traffic is through a VPC managed by Amazon SageMaker, which allows direct internet access</p></li>
/// <li>
/// <p><code>VpcOnly</code> - All traffic is through the specified VPC and subnets</p></li>
/// </ul>
pub fn app_network_access_type(mut self, input: crate::types::AppNetworkAccessType) -> Self {
self.inner = self.inner.app_network_access_type(input);
self
}
/// <p>Specifies the VPC used for non-EFS traffic. The default value is <code>PublicInternetOnly</code>.</p>
/// <ul>
/// <li>
/// <p><code>PublicInternetOnly</code> - Non-EFS traffic is through a VPC managed by Amazon SageMaker, which allows direct internet access</p></li>
/// <li>
/// <p><code>VpcOnly</code> - All traffic is through the specified VPC and subnets</p></li>
/// </ul>
pub fn set_app_network_access_type(mut self, input: ::std::option::Option<crate::types::AppNetworkAccessType>) -> Self {
self.inner = self.inner.set_app_network_access_type(input);
self
}
/// <p>Specifies the VPC used for non-EFS traffic. The default value is <code>PublicInternetOnly</code>.</p>
/// <ul>
/// <li>
/// <p><code>PublicInternetOnly</code> - Non-EFS traffic is through a VPC managed by Amazon SageMaker, which allows direct internet access</p></li>
/// <li>
/// <p><code>VpcOnly</code> - All traffic is through the specified VPC and subnets</p></li>
/// </ul>
pub fn get_app_network_access_type(&self) -> &::std::option::Option<crate::types::AppNetworkAccessType> {
self.inner.get_app_network_access_type()
}
/// <p>Use <code>KmsKeyId</code>.</p>
#[deprecated(note = "This property is deprecated, use KmsKeyId instead.")]
pub fn home_efs_file_system_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.home_efs_file_system_kms_key_id(input.into());
self
}
/// <p>Use <code>KmsKeyId</code>.</p>
#[deprecated(note = "This property is deprecated, use KmsKeyId instead.")]
pub fn set_home_efs_file_system_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_home_efs_file_system_kms_key_id(input);
self
}
/// <p>Use <code>KmsKeyId</code>.</p>
#[deprecated(note = "This property is deprecated, use KmsKeyId instead.")]
pub fn get_home_efs_file_system_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_home_efs_file_system_kms_key_id()
}
/// <p>SageMaker 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>
pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.kms_key_id(input.into());
self
}
/// <p>SageMaker 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>
pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_kms_key_id(input);
self
}
/// <p>SageMaker 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>
pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_kms_key_id()
}
/// <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>
pub fn app_security_group_management(mut self, input: crate::types::AppSecurityGroupManagement) -> Self {
self.inner = self.inner.app_security_group_management(input);
self
}
/// <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>
pub fn set_app_security_group_management(mut self, input: ::std::option::Option<crate::types::AppSecurityGroupManagement>) -> Self {
self.inner = self.inner.set_app_security_group_management(input);
self
}
/// <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>
pub fn get_app_security_group_management(&self) -> &::std::option::Option<crate::types::AppSecurityGroupManagement> {
self.inner.get_app_security_group_management()
}
/// <p>The default settings used to create a space.</p>
pub fn default_space_settings(mut self, input: crate::types::DefaultSpaceSettings) -> Self {
self.inner = self.inner.default_space_settings(input);
self
}
/// <p>The default settings used to create a space.</p>
pub fn set_default_space_settings(mut self, input: ::std::option::Option<crate::types::DefaultSpaceSettings>) -> Self {
self.inner = self.inner.set_default_space_settings(input);
self
}
/// <p>The default settings used to create a space.</p>
pub fn get_default_space_settings(&self) -> &::std::option::Option<crate::types::DefaultSpaceSettings> {
self.inner.get_default_space_settings()
}
}