aws-sdk-batch 1.120.0

AWS SDK for AWS Batch
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>An object that represents the secret to expose to your container. Secrets can be exposed to a container in the following ways:</p>
/// <ul>
/// <li>
/// <p>To inject sensitive data into your containers as environment variables, use the <code>secrets</code> container definition parameter.</p></li>
/// <li>
/// <p>To reference sensitive information in the log configuration of a container, use the <code>secretOptions</code> container definition parameter.</p></li>
/// </ul>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/specifying-sensitive-data.html">Specifying sensitive data</a> in the <i>Batch User Guide</i>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Secret {
    /// <p>The name of the secret.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The secret to expose to the container. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store.</p><note>
    /// <p>If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Region as the job you're launching, then you can use either the full Amazon Resource Name (ARN) or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.</p>
    /// </note>
    pub value_from: ::std::option::Option<::std::string::String>,
}
impl Secret {
    /// <p>The name of the secret.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The secret to expose to the container. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store.</p><note>
    /// <p>If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Region as the job you're launching, then you can use either the full Amazon Resource Name (ARN) or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.</p>
    /// </note>
    pub fn value_from(&self) -> ::std::option::Option<&str> {
        self.value_from.as_deref()
    }
}
impl Secret {
    /// Creates a new builder-style object to manufacture [`Secret`](crate::types::Secret).
    pub fn builder() -> crate::types::builders::SecretBuilder {
        crate::types::builders::SecretBuilder::default()
    }
}

/// A builder for [`Secret`](crate::types::Secret).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SecretBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) value_from: ::std::option::Option<::std::string::String>,
}
impl SecretBuilder {
    /// <p>The name of the secret.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the secret.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the secret.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The secret to expose to the container. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store.</p><note>
    /// <p>If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Region as the job you're launching, then you can use either the full Amazon Resource Name (ARN) or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.</p>
    /// </note>
    /// This field is required.
    pub fn value_from(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.value_from = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The secret to expose to the container. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store.</p><note>
    /// <p>If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Region as the job you're launching, then you can use either the full Amazon Resource Name (ARN) or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.</p>
    /// </note>
    pub fn set_value_from(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.value_from = input;
        self
    }
    /// <p>The secret to expose to the container. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store.</p><note>
    /// <p>If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Region as the job you're launching, then you can use either the full Amazon Resource Name (ARN) or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.</p>
    /// </note>
    pub fn get_value_from(&self) -> &::std::option::Option<::std::string::String> {
        &self.value_from
    }
    /// Consumes the builder and constructs a [`Secret`](crate::types::Secret).
    pub fn build(self) -> crate::types::Secret {
        crate::types::Secret {
            name: self.name,
            value_from: self.value_from,
        }
    }
}