/** * 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 an EC2 instance.

See Also:

AWS * API Reference

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

The ID of the instance.

*/ inline const Aws::String& GetInstanceId() const{ return m_instanceId; } /** *

The ID of the instance.

*/ inline bool InstanceIdHasBeenSet() const { return m_instanceIdHasBeenSet; } /** *

The ID of the instance.

*/ inline void SetInstanceId(const Aws::String& value) { m_instanceIdHasBeenSet = true; m_instanceId = value; } /** *

The ID of the instance.

*/ inline void SetInstanceId(Aws::String&& value) { m_instanceIdHasBeenSet = true; m_instanceId = std::move(value); } /** *

The ID of the instance.

*/ inline void SetInstanceId(const char* value) { m_instanceIdHasBeenSet = true; m_instanceId.assign(value); } /** *

The ID of the instance.

*/ inline Instance& WithInstanceId(const Aws::String& value) { SetInstanceId(value); return *this;} /** *

The ID of the instance.

*/ inline Instance& WithInstanceId(Aws::String&& value) { SetInstanceId(std::move(value)); return *this;} /** *

The ID of the instance.

*/ inline Instance& WithInstanceId(const char* value) { SetInstanceId(value); return *this;} /** *

The instance type of the EC2 instance.

*/ inline const Aws::String& GetInstanceType() const{ return m_instanceType; } /** *

The instance type of the EC2 instance.

*/ inline bool InstanceTypeHasBeenSet() const { return m_instanceTypeHasBeenSet; } /** *

The instance type of the EC2 instance.

*/ inline void SetInstanceType(const Aws::String& value) { m_instanceTypeHasBeenSet = true; m_instanceType = value; } /** *

The instance type of the EC2 instance.

*/ inline void SetInstanceType(Aws::String&& value) { m_instanceTypeHasBeenSet = true; m_instanceType = std::move(value); } /** *

The instance type of the EC2 instance.

*/ inline void SetInstanceType(const char* value) { m_instanceTypeHasBeenSet = true; m_instanceType.assign(value); } /** *

The instance type of the EC2 instance.

*/ inline Instance& WithInstanceType(const Aws::String& value) { SetInstanceType(value); return *this;} /** *

The instance type of the EC2 instance.

*/ inline Instance& WithInstanceType(Aws::String&& value) { SetInstanceType(std::move(value)); return *this;} /** *

The instance type of the EC2 instance.

*/ inline Instance& WithInstanceType(const char* value) { SetInstanceType(value); return *this;} /** *

The Availability Zone in which the instance is running.

*/ inline const Aws::String& GetAvailabilityZone() const{ return m_availabilityZone; } /** *

The Availability Zone in which the instance is running.

*/ inline bool AvailabilityZoneHasBeenSet() const { return m_availabilityZoneHasBeenSet; } /** *

The Availability Zone in which the instance is running.

*/ inline void SetAvailabilityZone(const Aws::String& value) { m_availabilityZoneHasBeenSet = true; m_availabilityZone = value; } /** *

The Availability Zone in which the instance is running.

*/ inline void SetAvailabilityZone(Aws::String&& value) { m_availabilityZoneHasBeenSet = true; m_availabilityZone = std::move(value); } /** *

The Availability Zone in which the instance is running.

*/ inline void SetAvailabilityZone(const char* value) { m_availabilityZoneHasBeenSet = true; m_availabilityZone.assign(value); } /** *

The Availability Zone in which the instance is running.

*/ inline Instance& WithAvailabilityZone(const Aws::String& value) { SetAvailabilityZone(value); return *this;} /** *

The Availability Zone in which the instance is running.

*/ inline Instance& WithAvailabilityZone(Aws::String&& value) { SetAvailabilityZone(std::move(value)); return *this;} /** *

The Availability Zone in which the instance is running.

*/ inline Instance& WithAvailabilityZone(const char* value) { SetAvailabilityZone(value); return *this;} /** *

A description of the current lifecycle state. The Quarantined * state is not used. For information about lifecycle states, see Instance * lifecycle in the Amazon EC2 Auto Scaling User Guide.

*/ inline const LifecycleState& GetLifecycleState() const{ return m_lifecycleState; } /** *

A description of the current lifecycle state. The Quarantined * state is not used. For information about lifecycle states, see Instance * lifecycle in the Amazon EC2 Auto Scaling User Guide.

*/ inline bool LifecycleStateHasBeenSet() const { return m_lifecycleStateHasBeenSet; } /** *

A description of the current lifecycle state. The Quarantined * state is not used. For information about lifecycle states, see Instance * lifecycle in the Amazon EC2 Auto Scaling User Guide.

*/ inline void SetLifecycleState(const LifecycleState& value) { m_lifecycleStateHasBeenSet = true; m_lifecycleState = value; } /** *

A description of the current lifecycle state. The Quarantined * state is not used. For information about lifecycle states, see Instance * lifecycle in the Amazon EC2 Auto Scaling User Guide.

*/ inline void SetLifecycleState(LifecycleState&& value) { m_lifecycleStateHasBeenSet = true; m_lifecycleState = std::move(value); } /** *

A description of the current lifecycle state. The Quarantined * state is not used. For information about lifecycle states, see Instance * lifecycle in the Amazon EC2 Auto Scaling User Guide.

*/ inline Instance& WithLifecycleState(const LifecycleState& value) { SetLifecycleState(value); return *this;} /** *

A description of the current lifecycle state. The Quarantined * state is not used. For information about lifecycle states, see Instance * lifecycle in the Amazon EC2 Auto Scaling User Guide.

*/ inline Instance& WithLifecycleState(LifecycleState&& value) { SetLifecycleState(std::move(value)); return *this;} /** *

The last reported health status of the instance. Healthy means * that the instance is healthy and should remain in service. * Unhealthy means that the instance is unhealthy and that Amazon EC2 * Auto Scaling should terminate and replace it.

*/ inline const Aws::String& GetHealthStatus() const{ return m_healthStatus; } /** *

The last reported health status of the instance. Healthy means * that the instance is healthy and should remain in service. * Unhealthy means that the instance is unhealthy and that Amazon EC2 * Auto Scaling should terminate and replace it.

*/ inline bool HealthStatusHasBeenSet() const { return m_healthStatusHasBeenSet; } /** *

The last reported health status of the instance. Healthy means * that the instance is healthy and should remain in service. * Unhealthy means that the instance is unhealthy and that Amazon EC2 * Auto Scaling should terminate and replace it.

*/ inline void SetHealthStatus(const Aws::String& value) { m_healthStatusHasBeenSet = true; m_healthStatus = value; } /** *

The last reported health status of the instance. Healthy means * that the instance is healthy and should remain in service. * Unhealthy means that the instance is unhealthy and that Amazon EC2 * Auto Scaling should terminate and replace it.

*/ inline void SetHealthStatus(Aws::String&& value) { m_healthStatusHasBeenSet = true; m_healthStatus = std::move(value); } /** *

The last reported health status of the instance. Healthy means * that the instance is healthy and should remain in service. * Unhealthy means that the instance is unhealthy and that Amazon EC2 * Auto Scaling should terminate and replace it.

*/ inline void SetHealthStatus(const char* value) { m_healthStatusHasBeenSet = true; m_healthStatus.assign(value); } /** *

The last reported health status of the instance. Healthy means * that the instance is healthy and should remain in service. * Unhealthy means that the instance is unhealthy and that Amazon EC2 * Auto Scaling should terminate and replace it.

*/ inline Instance& WithHealthStatus(const Aws::String& value) { SetHealthStatus(value); return *this;} /** *

The last reported health status of the instance. Healthy means * that the instance is healthy and should remain in service. * Unhealthy means that the instance is unhealthy and that Amazon EC2 * Auto Scaling should terminate and replace it.

*/ inline Instance& WithHealthStatus(Aws::String&& value) { SetHealthStatus(std::move(value)); return *this;} /** *

The last reported health status of the instance. Healthy means * that the instance is healthy and should remain in service. * Unhealthy means that the instance is unhealthy and that Amazon EC2 * Auto Scaling should terminate and replace it.

*/ inline Instance& WithHealthStatus(const char* value) { SetHealthStatus(value); return *this;} /** *

The launch configuration associated with the instance.

*/ inline const Aws::String& GetLaunchConfigurationName() const{ return m_launchConfigurationName; } /** *

The launch configuration associated with the instance.

*/ inline bool LaunchConfigurationNameHasBeenSet() const { return m_launchConfigurationNameHasBeenSet; } /** *

The launch configuration associated with the instance.

*/ inline void SetLaunchConfigurationName(const Aws::String& value) { m_launchConfigurationNameHasBeenSet = true; m_launchConfigurationName = value; } /** *

The launch configuration associated with the instance.

*/ inline void SetLaunchConfigurationName(Aws::String&& value) { m_launchConfigurationNameHasBeenSet = true; m_launchConfigurationName = std::move(value); } /** *

The launch configuration associated with the instance.

*/ inline void SetLaunchConfigurationName(const char* value) { m_launchConfigurationNameHasBeenSet = true; m_launchConfigurationName.assign(value); } /** *

The launch configuration associated with the instance.

*/ inline Instance& WithLaunchConfigurationName(const Aws::String& value) { SetLaunchConfigurationName(value); return *this;} /** *

The launch configuration associated with the instance.

*/ inline Instance& WithLaunchConfigurationName(Aws::String&& value) { SetLaunchConfigurationName(std::move(value)); return *this;} /** *

The launch configuration associated with the instance.

*/ inline Instance& WithLaunchConfigurationName(const char* value) { SetLaunchConfigurationName(value); return *this;} /** *

The launch template for the instance.

*/ inline const LaunchTemplateSpecification& GetLaunchTemplate() const{ return m_launchTemplate; } /** *

The launch template for the instance.

*/ inline bool LaunchTemplateHasBeenSet() const { return m_launchTemplateHasBeenSet; } /** *

The launch template for the instance.

*/ inline void SetLaunchTemplate(const LaunchTemplateSpecification& value) { m_launchTemplateHasBeenSet = true; m_launchTemplate = value; } /** *

The launch template for the instance.

*/ inline void SetLaunchTemplate(LaunchTemplateSpecification&& value) { m_launchTemplateHasBeenSet = true; m_launchTemplate = std::move(value); } /** *

The launch template for the instance.

*/ inline Instance& WithLaunchTemplate(const LaunchTemplateSpecification& value) { SetLaunchTemplate(value); return *this;} /** *

The launch template for the instance.

*/ inline Instance& WithLaunchTemplate(LaunchTemplateSpecification&& value) { SetLaunchTemplate(std::move(value)); return *this;} /** *

Indicates whether the instance is protected from termination by Amazon EC2 * Auto Scaling when scaling in.

*/ inline bool GetProtectedFromScaleIn() const{ return m_protectedFromScaleIn; } /** *

Indicates whether the instance is protected from termination by Amazon EC2 * Auto Scaling when scaling in.

*/ inline bool ProtectedFromScaleInHasBeenSet() const { return m_protectedFromScaleInHasBeenSet; } /** *

Indicates whether the instance is protected from termination by Amazon EC2 * Auto Scaling when scaling in.

*/ inline void SetProtectedFromScaleIn(bool value) { m_protectedFromScaleInHasBeenSet = true; m_protectedFromScaleIn = value; } /** *

Indicates whether the instance is protected from termination by Amazon EC2 * Auto Scaling when scaling in.

*/ inline Instance& WithProtectedFromScaleIn(bool value) { SetProtectedFromScaleIn(value); return *this;} /** *

The number of capacity units contributed by the instance based on its * instance type.

Valid Range: Minimum value of 1. Maximum value of 999.

*/ inline const Aws::String& GetWeightedCapacity() const{ return m_weightedCapacity; } /** *

The number of capacity units contributed by the instance based on its * instance type.

Valid Range: Minimum value of 1. Maximum value of 999.

*/ inline bool WeightedCapacityHasBeenSet() const { return m_weightedCapacityHasBeenSet; } /** *

The number of capacity units contributed by the instance based on its * instance type.

Valid Range: Minimum value of 1. Maximum value of 999.

*/ inline void SetWeightedCapacity(const Aws::String& value) { m_weightedCapacityHasBeenSet = true; m_weightedCapacity = value; } /** *

The number of capacity units contributed by the instance based on its * instance type.

Valid Range: Minimum value of 1. Maximum value of 999.

*/ inline void SetWeightedCapacity(Aws::String&& value) { m_weightedCapacityHasBeenSet = true; m_weightedCapacity = std::move(value); } /** *

The number of capacity units contributed by the instance based on its * instance type.

Valid Range: Minimum value of 1. Maximum value of 999.

*/ inline void SetWeightedCapacity(const char* value) { m_weightedCapacityHasBeenSet = true; m_weightedCapacity.assign(value); } /** *

The number of capacity units contributed by the instance based on its * instance type.

Valid Range: Minimum value of 1. Maximum value of 999.

*/ inline Instance& WithWeightedCapacity(const Aws::String& value) { SetWeightedCapacity(value); return *this;} /** *

The number of capacity units contributed by the instance based on its * instance type.

Valid Range: Minimum value of 1. Maximum value of 999.

*/ inline Instance& WithWeightedCapacity(Aws::String&& value) { SetWeightedCapacity(std::move(value)); return *this;} /** *

The number of capacity units contributed by the instance based on its * instance type.

Valid Range: Minimum value of 1. Maximum value of 999.

*/ inline Instance& WithWeightedCapacity(const char* value) { SetWeightedCapacity(value); return *this;} private: Aws::String m_instanceId; bool m_instanceIdHasBeenSet = false; Aws::String m_instanceType; bool m_instanceTypeHasBeenSet = false; Aws::String m_availabilityZone; bool m_availabilityZoneHasBeenSet = false; LifecycleState m_lifecycleState; bool m_lifecycleStateHasBeenSet = false; Aws::String m_healthStatus; bool m_healthStatusHasBeenSet = false; Aws::String m_launchConfigurationName; bool m_launchConfigurationNameHasBeenSet = false; LaunchTemplateSpecification m_launchTemplate; bool m_launchTemplateHasBeenSet = false; bool m_protectedFromScaleIn; bool m_protectedFromScaleInHasBeenSet = false; Aws::String m_weightedCapacity; bool m_weightedCapacityHasBeenSet = false; }; } // namespace Model } // namespace AutoScaling } // namespace Aws