aws-sdk-appconfig 1.103.0

AWS SDK for Amazon AppConfig
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateDeploymentStrategyInput {
    /// <p>A name for the deployment strategy.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A description of the deployment strategy.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>Total amount of time for a deployment to last.</p>
    pub deployment_duration_in_minutes: ::std::option::Option<i32>,
    /// <p>Specifies the amount of time AppConfig monitors for Amazon CloudWatch alarms after the configuration has been deployed to 100% of its targets, before considering the deployment to be complete. If an alarm is triggered during this time, AppConfig rolls back the deployment. You must configure permissions for AppConfig to roll back based on CloudWatch alarms. For more information, see <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/getting-started-with-appconfig-cloudwatch-alarms-permissions.html">Configuring permissions for rollback based on Amazon CloudWatch alarms</a> in the <i>AppConfig User Guide</i>.</p>
    pub final_bake_time_in_minutes: ::std::option::Option<i32>,
    /// <p>The percentage of targets to receive a deployed configuration during each interval.</p>
    pub growth_factor: ::std::option::Option<f32>,
    /// <p>The algorithm used to define how percentage grows over time. AppConfig supports the following growth types:</p>
    /// <p><b>Linear</b>: For this type, AppConfig processes the deployment by dividing the total number of targets by the value specified for <code>Step percentage</code>. For example, a linear deployment that uses a <code>Step percentage</code> of 10 deploys the configuration to 10 percent of the hosts. After those deployments are complete, the system deploys the configuration to the next 10 percent. This continues until 100% of the targets have successfully received the configuration.</p>
    /// <p><b>Exponential</b>: For this type, AppConfig processes the deployment exponentially using the following formula: <code>G*(2^N)</code>. In this formula, <code>G</code> is the growth factor specified by the user and <code>N</code> is the number of steps until the configuration is deployed to all targets. For example, if you specify a growth factor of 2, then the system rolls out the configuration as follows:</p>
    /// <p><code>2*(2^0)</code></p>
    /// <p><code>2*(2^1)</code></p>
    /// <p><code>2*(2^2)</code></p>
    /// <p>Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the targets, and continues until the configuration has been deployed to all targets.</p>
    pub growth_type: ::std::option::Option<crate::types::GrowthType>,
    /// <p>Save the deployment strategy to a Systems Manager (SSM) document.</p>
    pub replicate_to: ::std::option::Option<crate::types::ReplicateTo>,
    /// <p>Metadata to assign to the deployment strategy. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateDeploymentStrategyInput {
    /// <p>A name for the deployment strategy.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A description of the deployment strategy.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>Total amount of time for a deployment to last.</p>
    pub fn deployment_duration_in_minutes(&self) -> ::std::option::Option<i32> {
        self.deployment_duration_in_minutes
    }
    /// <p>Specifies the amount of time AppConfig monitors for Amazon CloudWatch alarms after the configuration has been deployed to 100% of its targets, before considering the deployment to be complete. If an alarm is triggered during this time, AppConfig rolls back the deployment. You must configure permissions for AppConfig to roll back based on CloudWatch alarms. For more information, see <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/getting-started-with-appconfig-cloudwatch-alarms-permissions.html">Configuring permissions for rollback based on Amazon CloudWatch alarms</a> in the <i>AppConfig User Guide</i>.</p>
    pub fn final_bake_time_in_minutes(&self) -> ::std::option::Option<i32> {
        self.final_bake_time_in_minutes
    }
    /// <p>The percentage of targets to receive a deployed configuration during each interval.</p>
    pub fn growth_factor(&self) -> ::std::option::Option<f32> {
        self.growth_factor
    }
    /// <p>The algorithm used to define how percentage grows over time. AppConfig supports the following growth types:</p>
    /// <p><b>Linear</b>: For this type, AppConfig processes the deployment by dividing the total number of targets by the value specified for <code>Step percentage</code>. For example, a linear deployment that uses a <code>Step percentage</code> of 10 deploys the configuration to 10 percent of the hosts. After those deployments are complete, the system deploys the configuration to the next 10 percent. This continues until 100% of the targets have successfully received the configuration.</p>
    /// <p><b>Exponential</b>: For this type, AppConfig processes the deployment exponentially using the following formula: <code>G*(2^N)</code>. In this formula, <code>G</code> is the growth factor specified by the user and <code>N</code> is the number of steps until the configuration is deployed to all targets. For example, if you specify a growth factor of 2, then the system rolls out the configuration as follows:</p>
    /// <p><code>2*(2^0)</code></p>
    /// <p><code>2*(2^1)</code></p>
    /// <p><code>2*(2^2)</code></p>
    /// <p>Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the targets, and continues until the configuration has been deployed to all targets.</p>
    pub fn growth_type(&self) -> ::std::option::Option<&crate::types::GrowthType> {
        self.growth_type.as_ref()
    }
    /// <p>Save the deployment strategy to a Systems Manager (SSM) document.</p>
    pub fn replicate_to(&self) -> ::std::option::Option<&crate::types::ReplicateTo> {
        self.replicate_to.as_ref()
    }
    /// <p>Metadata to assign to the deployment strategy. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl CreateDeploymentStrategyInput {
    /// Creates a new builder-style object to manufacture [`CreateDeploymentStrategyInput`](crate::operation::create_deployment_strategy::CreateDeploymentStrategyInput).
    pub fn builder() -> crate::operation::create_deployment_strategy::builders::CreateDeploymentStrategyInputBuilder {
        crate::operation::create_deployment_strategy::builders::CreateDeploymentStrategyInputBuilder::default()
    }
}

/// A builder for [`CreateDeploymentStrategyInput`](crate::operation::create_deployment_strategy::CreateDeploymentStrategyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateDeploymentStrategyInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) deployment_duration_in_minutes: ::std::option::Option<i32>,
    pub(crate) final_bake_time_in_minutes: ::std::option::Option<i32>,
    pub(crate) growth_factor: ::std::option::Option<f32>,
    pub(crate) growth_type: ::std::option::Option<crate::types::GrowthType>,
    pub(crate) replicate_to: ::std::option::Option<crate::types::ReplicateTo>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateDeploymentStrategyInputBuilder {
    /// <p>A name for the deployment strategy.</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>A name for the deployment strategy.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>A name for the deployment strategy.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A description of the deployment strategy.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the deployment strategy.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the deployment strategy.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>Total amount of time for a deployment to last.</p>
    /// This field is required.
    pub fn deployment_duration_in_minutes(mut self, input: i32) -> Self {
        self.deployment_duration_in_minutes = ::std::option::Option::Some(input);
        self
    }
    /// <p>Total amount of time for a deployment to last.</p>
    pub fn set_deployment_duration_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
        self.deployment_duration_in_minutes = input;
        self
    }
    /// <p>Total amount of time for a deployment to last.</p>
    pub fn get_deployment_duration_in_minutes(&self) -> &::std::option::Option<i32> {
        &self.deployment_duration_in_minutes
    }
    /// <p>Specifies the amount of time AppConfig monitors for Amazon CloudWatch alarms after the configuration has been deployed to 100% of its targets, before considering the deployment to be complete. If an alarm is triggered during this time, AppConfig rolls back the deployment. You must configure permissions for AppConfig to roll back based on CloudWatch alarms. For more information, see <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/getting-started-with-appconfig-cloudwatch-alarms-permissions.html">Configuring permissions for rollback based on Amazon CloudWatch alarms</a> in the <i>AppConfig User Guide</i>.</p>
    pub fn final_bake_time_in_minutes(mut self, input: i32) -> Self {
        self.final_bake_time_in_minutes = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the amount of time AppConfig monitors for Amazon CloudWatch alarms after the configuration has been deployed to 100% of its targets, before considering the deployment to be complete. If an alarm is triggered during this time, AppConfig rolls back the deployment. You must configure permissions for AppConfig to roll back based on CloudWatch alarms. For more information, see <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/getting-started-with-appconfig-cloudwatch-alarms-permissions.html">Configuring permissions for rollback based on Amazon CloudWatch alarms</a> in the <i>AppConfig User Guide</i>.</p>
    pub fn set_final_bake_time_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
        self.final_bake_time_in_minutes = input;
        self
    }
    /// <p>Specifies the amount of time AppConfig monitors for Amazon CloudWatch alarms after the configuration has been deployed to 100% of its targets, before considering the deployment to be complete. If an alarm is triggered during this time, AppConfig rolls back the deployment. You must configure permissions for AppConfig to roll back based on CloudWatch alarms. For more information, see <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/getting-started-with-appconfig-cloudwatch-alarms-permissions.html">Configuring permissions for rollback based on Amazon CloudWatch alarms</a> in the <i>AppConfig User Guide</i>.</p>
    pub fn get_final_bake_time_in_minutes(&self) -> &::std::option::Option<i32> {
        &self.final_bake_time_in_minutes
    }
    /// <p>The percentage of targets to receive a deployed configuration during each interval.</p>
    /// This field is required.
    pub fn growth_factor(mut self, input: f32) -> Self {
        self.growth_factor = ::std::option::Option::Some(input);
        self
    }
    /// <p>The percentage of targets to receive a deployed configuration during each interval.</p>
    pub fn set_growth_factor(mut self, input: ::std::option::Option<f32>) -> Self {
        self.growth_factor = input;
        self
    }
    /// <p>The percentage of targets to receive a deployed configuration during each interval.</p>
    pub fn get_growth_factor(&self) -> &::std::option::Option<f32> {
        &self.growth_factor
    }
    /// <p>The algorithm used to define how percentage grows over time. AppConfig supports the following growth types:</p>
    /// <p><b>Linear</b>: For this type, AppConfig processes the deployment by dividing the total number of targets by the value specified for <code>Step percentage</code>. For example, a linear deployment that uses a <code>Step percentage</code> of 10 deploys the configuration to 10 percent of the hosts. After those deployments are complete, the system deploys the configuration to the next 10 percent. This continues until 100% of the targets have successfully received the configuration.</p>
    /// <p><b>Exponential</b>: For this type, AppConfig processes the deployment exponentially using the following formula: <code>G*(2^N)</code>. In this formula, <code>G</code> is the growth factor specified by the user and <code>N</code> is the number of steps until the configuration is deployed to all targets. For example, if you specify a growth factor of 2, then the system rolls out the configuration as follows:</p>
    /// <p><code>2*(2^0)</code></p>
    /// <p><code>2*(2^1)</code></p>
    /// <p><code>2*(2^2)</code></p>
    /// <p>Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the targets, and continues until the configuration has been deployed to all targets.</p>
    pub fn growth_type(mut self, input: crate::types::GrowthType) -> Self {
        self.growth_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The algorithm used to define how percentage grows over time. AppConfig supports the following growth types:</p>
    /// <p><b>Linear</b>: For this type, AppConfig processes the deployment by dividing the total number of targets by the value specified for <code>Step percentage</code>. For example, a linear deployment that uses a <code>Step percentage</code> of 10 deploys the configuration to 10 percent of the hosts. After those deployments are complete, the system deploys the configuration to the next 10 percent. This continues until 100% of the targets have successfully received the configuration.</p>
    /// <p><b>Exponential</b>: For this type, AppConfig processes the deployment exponentially using the following formula: <code>G*(2^N)</code>. In this formula, <code>G</code> is the growth factor specified by the user and <code>N</code> is the number of steps until the configuration is deployed to all targets. For example, if you specify a growth factor of 2, then the system rolls out the configuration as follows:</p>
    /// <p><code>2*(2^0)</code></p>
    /// <p><code>2*(2^1)</code></p>
    /// <p><code>2*(2^2)</code></p>
    /// <p>Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the targets, and continues until the configuration has been deployed to all targets.</p>
    pub fn set_growth_type(mut self, input: ::std::option::Option<crate::types::GrowthType>) -> Self {
        self.growth_type = input;
        self
    }
    /// <p>The algorithm used to define how percentage grows over time. AppConfig supports the following growth types:</p>
    /// <p><b>Linear</b>: For this type, AppConfig processes the deployment by dividing the total number of targets by the value specified for <code>Step percentage</code>. For example, a linear deployment that uses a <code>Step percentage</code> of 10 deploys the configuration to 10 percent of the hosts. After those deployments are complete, the system deploys the configuration to the next 10 percent. This continues until 100% of the targets have successfully received the configuration.</p>
    /// <p><b>Exponential</b>: For this type, AppConfig processes the deployment exponentially using the following formula: <code>G*(2^N)</code>. In this formula, <code>G</code> is the growth factor specified by the user and <code>N</code> is the number of steps until the configuration is deployed to all targets. For example, if you specify a growth factor of 2, then the system rolls out the configuration as follows:</p>
    /// <p><code>2*(2^0)</code></p>
    /// <p><code>2*(2^1)</code></p>
    /// <p><code>2*(2^2)</code></p>
    /// <p>Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the targets, and continues until the configuration has been deployed to all targets.</p>
    pub fn get_growth_type(&self) -> &::std::option::Option<crate::types::GrowthType> {
        &self.growth_type
    }
    /// <p>Save the deployment strategy to a Systems Manager (SSM) document.</p>
    pub fn replicate_to(mut self, input: crate::types::ReplicateTo) -> Self {
        self.replicate_to = ::std::option::Option::Some(input);
        self
    }
    /// <p>Save the deployment strategy to a Systems Manager (SSM) document.</p>
    pub fn set_replicate_to(mut self, input: ::std::option::Option<crate::types::ReplicateTo>) -> Self {
        self.replicate_to = input;
        self
    }
    /// <p>Save the deployment strategy to a Systems Manager (SSM) document.</p>
    pub fn get_replicate_to(&self) -> &::std::option::Option<crate::types::ReplicateTo> {
        &self.replicate_to
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Metadata to assign to the deployment strategy. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Metadata to assign to the deployment strategy. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Metadata to assign to the deployment strategy. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateDeploymentStrategyInput`](crate::operation::create_deployment_strategy::CreateDeploymentStrategyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_deployment_strategy::CreateDeploymentStrategyInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::create_deployment_strategy::CreateDeploymentStrategyInput {
            name: self.name,
            description: self.description,
            deployment_duration_in_minutes: self.deployment_duration_in_minutes,
            final_bake_time_in_minutes: self.final_bake_time_in_minutes,
            growth_factor: self.growth_factor,
            growth_type: self.growth_type,
            replicate_to: self.replicate_to,
            tags: self.tags,
        })
    }
}