aws_sdk_batch/types/
_eks_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Configuration for the Amazon EKS cluster that supports the Batch compute environment. The cluster must exist before the compute environment can be created.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct EksConfiguration {
7    /// <p>The Amazon Resource Name (ARN) of the Amazon EKS cluster. An example is <code>arn:<i>aws</i>:eks:<i>us-east-1</i>:<i>123456789012</i>:cluster/<i>ClusterForBatch</i> </code>.</p>
8    pub eks_cluster_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The namespace of the Amazon EKS cluster. Batch manages pods in this namespace. The value can't left empty or null. It must be fewer than 64 characters long, can't be set to <code>default</code>, can't start with "<code>kube-</code>," and must match this regular expression: <code>^\[a-z0-9\](\[-a-z0-9\]*\[a-z0-9\])?$</code>. For more information, see <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">Namespaces</a> in the Kubernetes documentation.</p>
10    pub kubernetes_namespace: ::std::option::Option<::std::string::String>,
11}
12impl EksConfiguration {
13    /// <p>The Amazon Resource Name (ARN) of the Amazon EKS cluster. An example is <code>arn:<i>aws</i>:eks:<i>us-east-1</i>:<i>123456789012</i>:cluster/<i>ClusterForBatch</i> </code>.</p>
14    pub fn eks_cluster_arn(&self) -> ::std::option::Option<&str> {
15        self.eks_cluster_arn.as_deref()
16    }
17    /// <p>The namespace of the Amazon EKS cluster. Batch manages pods in this namespace. The value can't left empty or null. It must be fewer than 64 characters long, can't be set to <code>default</code>, can't start with "<code>kube-</code>," and must match this regular expression: <code>^\[a-z0-9\](\[-a-z0-9\]*\[a-z0-9\])?$</code>. For more information, see <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">Namespaces</a> in the Kubernetes documentation.</p>
18    pub fn kubernetes_namespace(&self) -> ::std::option::Option<&str> {
19        self.kubernetes_namespace.as_deref()
20    }
21}
22impl EksConfiguration {
23    /// Creates a new builder-style object to manufacture [`EksConfiguration`](crate::types::EksConfiguration).
24    pub fn builder() -> crate::types::builders::EksConfigurationBuilder {
25        crate::types::builders::EksConfigurationBuilder::default()
26    }
27}
28
29/// A builder for [`EksConfiguration`](crate::types::EksConfiguration).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct EksConfigurationBuilder {
33    pub(crate) eks_cluster_arn: ::std::option::Option<::std::string::String>,
34    pub(crate) kubernetes_namespace: ::std::option::Option<::std::string::String>,
35}
36impl EksConfigurationBuilder {
37    /// <p>The Amazon Resource Name (ARN) of the Amazon EKS cluster. An example is <code>arn:<i>aws</i>:eks:<i>us-east-1</i>:<i>123456789012</i>:cluster/<i>ClusterForBatch</i> </code>.</p>
38    /// This field is required.
39    pub fn eks_cluster_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.eks_cluster_arn = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// <p>The Amazon Resource Name (ARN) of the Amazon EKS cluster. An example is <code>arn:<i>aws</i>:eks:<i>us-east-1</i>:<i>123456789012</i>:cluster/<i>ClusterForBatch</i> </code>.</p>
44    pub fn set_eks_cluster_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.eks_cluster_arn = input;
46        self
47    }
48    /// <p>The Amazon Resource Name (ARN) of the Amazon EKS cluster. An example is <code>arn:<i>aws</i>:eks:<i>us-east-1</i>:<i>123456789012</i>:cluster/<i>ClusterForBatch</i> </code>.</p>
49    pub fn get_eks_cluster_arn(&self) -> &::std::option::Option<::std::string::String> {
50        &self.eks_cluster_arn
51    }
52    /// <p>The namespace of the Amazon EKS cluster. Batch manages pods in this namespace. The value can't left empty or null. It must be fewer than 64 characters long, can't be set to <code>default</code>, can't start with "<code>kube-</code>," and must match this regular expression: <code>^\[a-z0-9\](\[-a-z0-9\]*\[a-z0-9\])?$</code>. For more information, see <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">Namespaces</a> in the Kubernetes documentation.</p>
53    /// This field is required.
54    pub fn kubernetes_namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.kubernetes_namespace = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The namespace of the Amazon EKS cluster. Batch manages pods in this namespace. The value can't left empty or null. It must be fewer than 64 characters long, can't be set to <code>default</code>, can't start with "<code>kube-</code>," and must match this regular expression: <code>^\[a-z0-9\](\[-a-z0-9\]*\[a-z0-9\])?$</code>. For more information, see <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">Namespaces</a> in the Kubernetes documentation.</p>
59    pub fn set_kubernetes_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.kubernetes_namespace = input;
61        self
62    }
63    /// <p>The namespace of the Amazon EKS cluster. Batch manages pods in this namespace. The value can't left empty or null. It must be fewer than 64 characters long, can't be set to <code>default</code>, can't start with "<code>kube-</code>," and must match this regular expression: <code>^\[a-z0-9\](\[-a-z0-9\]*\[a-z0-9\])?$</code>. For more information, see <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">Namespaces</a> in the Kubernetes documentation.</p>
64    pub fn get_kubernetes_namespace(&self) -> &::std::option::Option<::std::string::String> {
65        &self.kubernetes_namespace
66    }
67    /// Consumes the builder and constructs a [`EksConfiguration`](crate::types::EksConfiguration).
68    pub fn build(self) -> crate::types::EksConfiguration {
69        crate::types::EksConfiguration {
70            eks_cluster_arn: self.eks_cluster_arn,
71            kubernetes_namespace: self.kubernetes_namespace,
72        }
73    }
74}