aws_sdk_sagemaker/operation/create_cluster/
_create_cluster_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateClusterInput {
6    /// <p>The name for the new SageMaker HyperPod cluster.</p>
7    pub cluster_name: ::std::option::Option<::std::string::String>,
8    /// <p>The instance groups to be created in the SageMaker HyperPod cluster.</p>
9    pub instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>,
10    /// <p>Specifies the Amazon Virtual Private Cloud (VPC) that is associated with the Amazon SageMaker HyperPod cluster. You can control access to and from your resources by configuring your VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/infrastructure-give-access.html">Give SageMaker access to resources in your Amazon VPC</a>.</p><note>
11    /// <p>If you configure your VPC with IPv6 support and specify subnets with IPv6 addressing enabled in your VPC configuration, the cluster automatically uses IPv6 addressing for network communication.</p>
12    /// <p>For information about adding IPv6 support for your VPC, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-migrate-ipv6.html">IPv6 support for your VPC</a>.</p>
13    /// <p>For information about creating a new VPC for use with IPv6, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/create-vpc.html">Create a VPC</a>.</p>
14    /// </note>
15    pub vpc_config: ::std::option::Option<crate::types::VpcConfig>,
16    /// <p>Custom tags for managing the SageMaker HyperPod cluster as an Amazon Web Services resource. You can add tags to your cluster in the same way you add them in other Amazon Web Services services that support tagging. To learn more about tagging Amazon Web Services resources in general, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html">Tagging Amazon Web Services Resources User Guide</a>.</p>
17    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18    /// <p>The type of orchestrator to use for the SageMaker HyperPod cluster. Currently, the only supported value is <code>"eks"</code>, which is to use an Amazon Elastic Kubernetes Service (EKS) cluster as the orchestrator.</p>
19    pub orchestrator: ::std::option::Option<crate::types::ClusterOrchestrator>,
20    /// <p>The node recovery mode for the SageMaker HyperPod cluster. When set to <code>Automatic</code>, SageMaker HyperPod will automatically reboot or replace faulty nodes when issues are detected. When set to <code>None</code>, cluster administrators will need to manually manage any faulty cluster instances.</p>
21    pub node_recovery: ::std::option::Option<crate::types::ClusterNodeRecovery>,
22}
23impl CreateClusterInput {
24    /// <p>The name for the new SageMaker HyperPod cluster.</p>
25    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
26        self.cluster_name.as_deref()
27    }
28    /// <p>The instance groups to be created in the SageMaker HyperPod cluster.</p>
29    ///
30    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instance_groups.is_none()`.
31    pub fn instance_groups(&self) -> &[crate::types::ClusterInstanceGroupSpecification] {
32        self.instance_groups.as_deref().unwrap_or_default()
33    }
34    /// <p>Specifies the Amazon Virtual Private Cloud (VPC) that is associated with the Amazon SageMaker HyperPod cluster. You can control access to and from your resources by configuring your VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/infrastructure-give-access.html">Give SageMaker access to resources in your Amazon VPC</a>.</p><note>
35    /// <p>If you configure your VPC with IPv6 support and specify subnets with IPv6 addressing enabled in your VPC configuration, the cluster automatically uses IPv6 addressing for network communication.</p>
36    /// <p>For information about adding IPv6 support for your VPC, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-migrate-ipv6.html">IPv6 support for your VPC</a>.</p>
37    /// <p>For information about creating a new VPC for use with IPv6, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/create-vpc.html">Create a VPC</a>.</p>
38    /// </note>
39    pub fn vpc_config(&self) -> ::std::option::Option<&crate::types::VpcConfig> {
40        self.vpc_config.as_ref()
41    }
42    /// <p>Custom tags for managing the SageMaker HyperPod cluster as an Amazon Web Services resource. You can add tags to your cluster in the same way you add them in other Amazon Web Services services that support tagging. To learn more about tagging Amazon Web Services resources in general, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html">Tagging Amazon Web Services Resources User Guide</a>.</p>
43    ///
44    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
45    pub fn tags(&self) -> &[crate::types::Tag] {
46        self.tags.as_deref().unwrap_or_default()
47    }
48    /// <p>The type of orchestrator to use for the SageMaker HyperPod cluster. Currently, the only supported value is <code>"eks"</code>, which is to use an Amazon Elastic Kubernetes Service (EKS) cluster as the orchestrator.</p>
49    pub fn orchestrator(&self) -> ::std::option::Option<&crate::types::ClusterOrchestrator> {
50        self.orchestrator.as_ref()
51    }
52    /// <p>The node recovery mode for the SageMaker HyperPod cluster. When set to <code>Automatic</code>, SageMaker HyperPod will automatically reboot or replace faulty nodes when issues are detected. When set to <code>None</code>, cluster administrators will need to manually manage any faulty cluster instances.</p>
53    pub fn node_recovery(&self) -> ::std::option::Option<&crate::types::ClusterNodeRecovery> {
54        self.node_recovery.as_ref()
55    }
56}
57impl CreateClusterInput {
58    /// Creates a new builder-style object to manufacture [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
59    pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterInputBuilder {
60        crate::operation::create_cluster::builders::CreateClusterInputBuilder::default()
61    }
62}
63
64/// A builder for [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct CreateClusterInputBuilder {
68    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
69    pub(crate) instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>,
70    pub(crate) vpc_config: ::std::option::Option<crate::types::VpcConfig>,
71    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
72    pub(crate) orchestrator: ::std::option::Option<crate::types::ClusterOrchestrator>,
73    pub(crate) node_recovery: ::std::option::Option<crate::types::ClusterNodeRecovery>,
74}
75impl CreateClusterInputBuilder {
76    /// <p>The name for the new SageMaker HyperPod cluster.</p>
77    /// This field is required.
78    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79        self.cluster_name = ::std::option::Option::Some(input.into());
80        self
81    }
82    /// <p>The name for the new SageMaker HyperPod cluster.</p>
83    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84        self.cluster_name = input;
85        self
86    }
87    /// <p>The name for the new SageMaker HyperPod cluster.</p>
88    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
89        &self.cluster_name
90    }
91    /// Appends an item to `instance_groups`.
92    ///
93    /// To override the contents of this collection use [`set_instance_groups`](Self::set_instance_groups).
94    ///
95    /// <p>The instance groups to be created in the SageMaker HyperPod cluster.</p>
96    pub fn instance_groups(mut self, input: crate::types::ClusterInstanceGroupSpecification) -> Self {
97        let mut v = self.instance_groups.unwrap_or_default();
98        v.push(input);
99        self.instance_groups = ::std::option::Option::Some(v);
100        self
101    }
102    /// <p>The instance groups to be created in the SageMaker HyperPod cluster.</p>
103    pub fn set_instance_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>) -> Self {
104        self.instance_groups = input;
105        self
106    }
107    /// <p>The instance groups to be created in the SageMaker HyperPod cluster.</p>
108    pub fn get_instance_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>> {
109        &self.instance_groups
110    }
111    /// <p>Specifies the Amazon Virtual Private Cloud (VPC) that is associated with the Amazon SageMaker HyperPod cluster. You can control access to and from your resources by configuring your VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/infrastructure-give-access.html">Give SageMaker access to resources in your Amazon VPC</a>.</p><note>
112    /// <p>If you configure your VPC with IPv6 support and specify subnets with IPv6 addressing enabled in your VPC configuration, the cluster automatically uses IPv6 addressing for network communication.</p>
113    /// <p>For information about adding IPv6 support for your VPC, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-migrate-ipv6.html">IPv6 support for your VPC</a>.</p>
114    /// <p>For information about creating a new VPC for use with IPv6, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/create-vpc.html">Create a VPC</a>.</p>
115    /// </note>
116    pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
117        self.vpc_config = ::std::option::Option::Some(input);
118        self
119    }
120    /// <p>Specifies the Amazon Virtual Private Cloud (VPC) that is associated with the Amazon SageMaker HyperPod cluster. You can control access to and from your resources by configuring your VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/infrastructure-give-access.html">Give SageMaker access to resources in your Amazon VPC</a>.</p><note>
121    /// <p>If you configure your VPC with IPv6 support and specify subnets with IPv6 addressing enabled in your VPC configuration, the cluster automatically uses IPv6 addressing for network communication.</p>
122    /// <p>For information about adding IPv6 support for your VPC, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-migrate-ipv6.html">IPv6 support for your VPC</a>.</p>
123    /// <p>For information about creating a new VPC for use with IPv6, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/create-vpc.html">Create a VPC</a>.</p>
124    /// </note>
125    pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
126        self.vpc_config = input;
127        self
128    }
129    /// <p>Specifies the Amazon Virtual Private Cloud (VPC) that is associated with the Amazon SageMaker HyperPod cluster. You can control access to and from your resources by configuring your VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/infrastructure-give-access.html">Give SageMaker access to resources in your Amazon VPC</a>.</p><note>
130    /// <p>If you configure your VPC with IPv6 support and specify subnets with IPv6 addressing enabled in your VPC configuration, the cluster automatically uses IPv6 addressing for network communication.</p>
131    /// <p>For information about adding IPv6 support for your VPC, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-migrate-ipv6.html">IPv6 support for your VPC</a>.</p>
132    /// <p>For information about creating a new VPC for use with IPv6, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/create-vpc.html">Create a VPC</a>.</p>
133    /// </note>
134    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
135        &self.vpc_config
136    }
137    /// Appends an item to `tags`.
138    ///
139    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
140    ///
141    /// <p>Custom tags for managing the SageMaker HyperPod cluster as an Amazon Web Services resource. You can add tags to your cluster in the same way you add them in other Amazon Web Services services that support tagging. To learn more about tagging Amazon Web Services resources in general, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html">Tagging Amazon Web Services Resources User Guide</a>.</p>
142    pub fn tags(mut self, input: crate::types::Tag) -> Self {
143        let mut v = self.tags.unwrap_or_default();
144        v.push(input);
145        self.tags = ::std::option::Option::Some(v);
146        self
147    }
148    /// <p>Custom tags for managing the SageMaker HyperPod cluster as an Amazon Web Services resource. You can add tags to your cluster in the same way you add them in other Amazon Web Services services that support tagging. To learn more about tagging Amazon Web Services resources in general, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html">Tagging Amazon Web Services Resources User Guide</a>.</p>
149    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
150        self.tags = input;
151        self
152    }
153    /// <p>Custom tags for managing the SageMaker HyperPod cluster as an Amazon Web Services resource. You can add tags to your cluster in the same way you add them in other Amazon Web Services services that support tagging. To learn more about tagging Amazon Web Services resources in general, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html">Tagging Amazon Web Services Resources User Guide</a>.</p>
154    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
155        &self.tags
156    }
157    /// <p>The type of orchestrator to use for the SageMaker HyperPod cluster. Currently, the only supported value is <code>"eks"</code>, which is to use an Amazon Elastic Kubernetes Service (EKS) cluster as the orchestrator.</p>
158    pub fn orchestrator(mut self, input: crate::types::ClusterOrchestrator) -> Self {
159        self.orchestrator = ::std::option::Option::Some(input);
160        self
161    }
162    /// <p>The type of orchestrator to use for the SageMaker HyperPod cluster. Currently, the only supported value is <code>"eks"</code>, which is to use an Amazon Elastic Kubernetes Service (EKS) cluster as the orchestrator.</p>
163    pub fn set_orchestrator(mut self, input: ::std::option::Option<crate::types::ClusterOrchestrator>) -> Self {
164        self.orchestrator = input;
165        self
166    }
167    /// <p>The type of orchestrator to use for the SageMaker HyperPod cluster. Currently, the only supported value is <code>"eks"</code>, which is to use an Amazon Elastic Kubernetes Service (EKS) cluster as the orchestrator.</p>
168    pub fn get_orchestrator(&self) -> &::std::option::Option<crate::types::ClusterOrchestrator> {
169        &self.orchestrator
170    }
171    /// <p>The node recovery mode for the SageMaker HyperPod cluster. When set to <code>Automatic</code>, SageMaker HyperPod will automatically reboot or replace faulty nodes when issues are detected. When set to <code>None</code>, cluster administrators will need to manually manage any faulty cluster instances.</p>
172    pub fn node_recovery(mut self, input: crate::types::ClusterNodeRecovery) -> Self {
173        self.node_recovery = ::std::option::Option::Some(input);
174        self
175    }
176    /// <p>The node recovery mode for the SageMaker HyperPod cluster. When set to <code>Automatic</code>, SageMaker HyperPod will automatically reboot or replace faulty nodes when issues are detected. When set to <code>None</code>, cluster administrators will need to manually manage any faulty cluster instances.</p>
177    pub fn set_node_recovery(mut self, input: ::std::option::Option<crate::types::ClusterNodeRecovery>) -> Self {
178        self.node_recovery = input;
179        self
180    }
181    /// <p>The node recovery mode for the SageMaker HyperPod cluster. When set to <code>Automatic</code>, SageMaker HyperPod will automatically reboot or replace faulty nodes when issues are detected. When set to <code>None</code>, cluster administrators will need to manually manage any faulty cluster instances.</p>
182    pub fn get_node_recovery(&self) -> &::std::option::Option<crate::types::ClusterNodeRecovery> {
183        &self.node_recovery
184    }
185    /// Consumes the builder and constructs a [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
186    pub fn build(
187        self,
188    ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
189        ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterInput {
190            cluster_name: self.cluster_name,
191            instance_groups: self.instance_groups,
192            vpc_config: self.vpc_config,
193            tags: self.tags,
194            orchestrator: self.orchestrator,
195            node_recovery: self.node_recovery,
196        })
197    }
198}