/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace AutoScaling { namespace Model { /** *

Describes a launch template and overrides.

The overrides are used to * override the instance type specified by the launch template with multiple * instance types that can be used to launch On-Demand Instances and Spot * Instances.

When you update the launch template or overrides, existing * Amazon EC2 instances continue to run. When scale out occurs, Amazon EC2 Auto * Scaling launches instances to match the new settings. When scale in occurs, * Amazon EC2 Auto Scaling terminates instances according to the group's * termination policies.

See Also:

AWS * API Reference

*/ class AWS_AUTOSCALING_API LaunchTemplate { public: LaunchTemplate(); LaunchTemplate(const Aws::Utils::Xml::XmlNode& xmlNode); LaunchTemplate& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

The launch template to use. You must specify either the launch template ID or * launch template name in the request.

*/ inline const LaunchTemplateSpecification& GetLaunchTemplateSpecification() const{ return m_launchTemplateSpecification; } /** *

The launch template to use. You must specify either the launch template ID or * launch template name in the request.

*/ inline bool LaunchTemplateSpecificationHasBeenSet() const { return m_launchTemplateSpecificationHasBeenSet; } /** *

The launch template to use. You must specify either the launch template ID or * launch template name in the request.

*/ inline void SetLaunchTemplateSpecification(const LaunchTemplateSpecification& value) { m_launchTemplateSpecificationHasBeenSet = true; m_launchTemplateSpecification = value; } /** *

The launch template to use. You must specify either the launch template ID or * launch template name in the request.

*/ inline void SetLaunchTemplateSpecification(LaunchTemplateSpecification&& value) { m_launchTemplateSpecificationHasBeenSet = true; m_launchTemplateSpecification = std::move(value); } /** *

The launch template to use. You must specify either the launch template ID or * launch template name in the request.

*/ inline LaunchTemplate& WithLaunchTemplateSpecification(const LaunchTemplateSpecification& value) { SetLaunchTemplateSpecification(value); return *this;} /** *

The launch template to use. You must specify either the launch template ID or * launch template name in the request.

*/ inline LaunchTemplate& WithLaunchTemplateSpecification(LaunchTemplateSpecification&& value) { SetLaunchTemplateSpecification(std::move(value)); return *this;} /** *

Any parameters that you specify override the same parameters in the launch * template. Currently, the only supported override is instance type. You can * specify between 1 and 20 instance types.

If not provided, Amazon EC2 Auto * Scaling will use the instance type specified in the launch template to launch * instances.

*/ inline const Aws::Vector& GetOverrides() const{ return m_overrides; } /** *

Any parameters that you specify override the same parameters in the launch * template. Currently, the only supported override is instance type. You can * specify between 1 and 20 instance types.

If not provided, Amazon EC2 Auto * Scaling will use the instance type specified in the launch template to launch * instances.

*/ inline bool OverridesHasBeenSet() const { return m_overridesHasBeenSet; } /** *

Any parameters that you specify override the same parameters in the launch * template. Currently, the only supported override is instance type. You can * specify between 1 and 20 instance types.

If not provided, Amazon EC2 Auto * Scaling will use the instance type specified in the launch template to launch * instances.

*/ inline void SetOverrides(const Aws::Vector& value) { m_overridesHasBeenSet = true; m_overrides = value; } /** *

Any parameters that you specify override the same parameters in the launch * template. Currently, the only supported override is instance type. You can * specify between 1 and 20 instance types.

If not provided, Amazon EC2 Auto * Scaling will use the instance type specified in the launch template to launch * instances.

*/ inline void SetOverrides(Aws::Vector&& value) { m_overridesHasBeenSet = true; m_overrides = std::move(value); } /** *

Any parameters that you specify override the same parameters in the launch * template. Currently, the only supported override is instance type. You can * specify between 1 and 20 instance types.

If not provided, Amazon EC2 Auto * Scaling will use the instance type specified in the launch template to launch * instances.

*/ inline LaunchTemplate& WithOverrides(const Aws::Vector& value) { SetOverrides(value); return *this;} /** *

Any parameters that you specify override the same parameters in the launch * template. Currently, the only supported override is instance type. You can * specify between 1 and 20 instance types.

If not provided, Amazon EC2 Auto * Scaling will use the instance type specified in the launch template to launch * instances.

*/ inline LaunchTemplate& WithOverrides(Aws::Vector&& value) { SetOverrides(std::move(value)); return *this;} /** *

Any parameters that you specify override the same parameters in the launch * template. Currently, the only supported override is instance type. You can * specify between 1 and 20 instance types.

If not provided, Amazon EC2 Auto * Scaling will use the instance type specified in the launch template to launch * instances.

*/ inline LaunchTemplate& AddOverrides(const LaunchTemplateOverrides& value) { m_overridesHasBeenSet = true; m_overrides.push_back(value); return *this; } /** *

Any parameters that you specify override the same parameters in the launch * template. Currently, the only supported override is instance type. You can * specify between 1 and 20 instance types.

If not provided, Amazon EC2 Auto * Scaling will use the instance type specified in the launch template to launch * instances.

*/ inline LaunchTemplate& AddOverrides(LaunchTemplateOverrides&& value) { m_overridesHasBeenSet = true; m_overrides.push_back(std::move(value)); return *this; } private: LaunchTemplateSpecification m_launchTemplateSpecification; bool m_launchTemplateSpecificationHasBeenSet; Aws::Vector m_overrides; bool m_overridesHasBeenSet; }; } // namespace Model } // namespace AutoScaling } // namespace Aws