// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents a virtual computing instance that runs game server processes and hosts game sessions. In Amazon GameLift Servers, one or more instances make up a managed EC2 fleet.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Instance {
/// <p>A unique identifier for the fleet that the instance belongs to.</p>
pub fleet_id: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a Amazon GameLift Servers fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is <code>arn:aws:gamelift:<region>
/// ::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
/// </region></code>.</p>
pub fleet_arn: ::std::option::Option<::std::string::String>,
/// <p>A unique identifier for the instance.</p>
pub instance_id: ::std::option::Option<::std::string::String>,
/// <p>IP address that is assigned to the instance.</p>
pub ip_address: ::std::option::Option<::std::string::String>,
/// <p>The DNS identifier assigned to the instance that is running the game session. Values have the following format:</p>
/// <ul>
/// <li>
/// <p>TLS-enabled fleets: <code><unique identifier>
/// .
/// <region identifier>
/// .amazongamelift.com
/// </region>
/// </unique></code>.</p></li>
/// <li>
/// <p>Non-TLS-enabled fleets: <code>ec2-<unique identifier>
/// .compute.amazonaws.com
/// </unique></code>. (See <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses">Amazon EC2 Instance IP Addressing</a>.)</p></li>
/// </ul>
/// <p>When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.</p>
pub dns_name: ::std::option::Option<::std::string::String>,
/// <p>Operating system that is running on this EC2 instance.</p><note>
/// <p>Amazon Linux 2 (AL2) will reach end of support on 6/30/2026. See more details in the <a href="http://aws.amazon.com/aws.amazon.com/amazon-linux-2/faqs/">Amazon Linux 2 FAQs</a>. For game servers that are hosted on AL2 and use server SDK version 4.x for Amazon GameLift Servers, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk5-migration.html"> Migrate to server SDK version 5.</a></p>
/// </note>
pub operating_system: ::std::option::Option<crate::types::OperatingSystem>,
/// <p>EC2 instance type that defines the computing resources of this instance.</p>
pub r#type: ::std::option::Option<crate::types::Ec2InstanceType>,
/// <p>Current status of the instance. Possible statuses include the following:</p>
/// <ul>
/// <li>
/// <p><b>PENDING</b> -- The instance is in the process of being created and launching server processes as defined in the fleet's run-time configuration.</p></li>
/// <li>
/// <p><b>ACTIVE</b> -- The instance has been successfully created and at least one server process has successfully launched and reported back to Amazon GameLift Servers that it is ready to host a game session. The instance is now considered ready to host game sessions.</p></li>
/// <li>
/// <p><b>TERMINATING</b> -- The instance is in the process of shutting down. This may happen to reduce capacity during a scaling down event or to recycle resources in the event of a problem.</p></li>
/// </ul>
pub status: ::std::option::Option<crate::types::InstanceStatus>,
/// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The fleet location of the instance, expressed as an Amazon Web Services Region code, such as <code>us-west-2</code>.</p>
pub location: ::std::option::Option<::std::string::String>,
}
impl Instance {
/// <p>A unique identifier for the fleet that the instance belongs to.</p>
pub fn fleet_id(&self) -> ::std::option::Option<&str> {
self.fleet_id.as_deref()
}
/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a Amazon GameLift Servers fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is <code>arn:aws:gamelift:<region>
/// ::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
/// </region></code>.</p>
pub fn fleet_arn(&self) -> ::std::option::Option<&str> {
self.fleet_arn.as_deref()
}
/// <p>A unique identifier for the instance.</p>
pub fn instance_id(&self) -> ::std::option::Option<&str> {
self.instance_id.as_deref()
}
/// <p>IP address that is assigned to the instance.</p>
pub fn ip_address(&self) -> ::std::option::Option<&str> {
self.ip_address.as_deref()
}
/// <p>The DNS identifier assigned to the instance that is running the game session. Values have the following format:</p>
/// <ul>
/// <li>
/// <p>TLS-enabled fleets: <code><unique identifier>
/// .
/// <region identifier>
/// .amazongamelift.com
/// </region>
/// </unique></code>.</p></li>
/// <li>
/// <p>Non-TLS-enabled fleets: <code>ec2-<unique identifier>
/// .compute.amazonaws.com
/// </unique></code>. (See <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses">Amazon EC2 Instance IP Addressing</a>.)</p></li>
/// </ul>
/// <p>When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.</p>
pub fn dns_name(&self) -> ::std::option::Option<&str> {
self.dns_name.as_deref()
}
/// <p>Operating system that is running on this EC2 instance.</p><note>
/// <p>Amazon Linux 2 (AL2) will reach end of support on 6/30/2026. See more details in the <a href="http://aws.amazon.com/aws.amazon.com/amazon-linux-2/faqs/">Amazon Linux 2 FAQs</a>. For game servers that are hosted on AL2 and use server SDK version 4.x for Amazon GameLift Servers, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk5-migration.html"> Migrate to server SDK version 5.</a></p>
/// </note>
pub fn operating_system(&self) -> ::std::option::Option<&crate::types::OperatingSystem> {
self.operating_system.as_ref()
}
/// <p>EC2 instance type that defines the computing resources of this instance.</p>
pub fn r#type(&self) -> ::std::option::Option<&crate::types::Ec2InstanceType> {
self.r#type.as_ref()
}
/// <p>Current status of the instance. Possible statuses include the following:</p>
/// <ul>
/// <li>
/// <p><b>PENDING</b> -- The instance is in the process of being created and launching server processes as defined in the fleet's run-time configuration.</p></li>
/// <li>
/// <p><b>ACTIVE</b> -- The instance has been successfully created and at least one server process has successfully launched and reported back to Amazon GameLift Servers that it is ready to host a game session. The instance is now considered ready to host game sessions.</p></li>
/// <li>
/// <p><b>TERMINATING</b> -- The instance is in the process of shutting down. This may happen to reduce capacity during a scaling down event or to recycle resources in the event of a problem.</p></li>
/// </ul>
pub fn status(&self) -> ::std::option::Option<&crate::types::InstanceStatus> {
self.status.as_ref()
}
/// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.creation_time.as_ref()
}
/// <p>The fleet location of the instance, expressed as an Amazon Web Services Region code, such as <code>us-west-2</code>.</p>
pub fn location(&self) -> ::std::option::Option<&str> {
self.location.as_deref()
}
}
impl ::std::fmt::Debug for Instance {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("Instance");
formatter.field("fleet_id", &self.fleet_id);
formatter.field("fleet_arn", &self.fleet_arn);
formatter.field("instance_id", &self.instance_id);
formatter.field("ip_address", &"*** Sensitive Data Redacted ***");
formatter.field("dns_name", &self.dns_name);
formatter.field("operating_system", &self.operating_system);
formatter.field("r#type", &self.r#type);
formatter.field("status", &self.status);
formatter.field("creation_time", &self.creation_time);
formatter.field("location", &self.location);
formatter.finish()
}
}
impl Instance {
/// Creates a new builder-style object to manufacture [`Instance`](crate::types::Instance).
pub fn builder() -> crate::types::builders::InstanceBuilder {
crate::types::builders::InstanceBuilder::default()
}
}
/// A builder for [`Instance`](crate::types::Instance).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct InstanceBuilder {
pub(crate) fleet_id: ::std::option::Option<::std::string::String>,
pub(crate) fleet_arn: ::std::option::Option<::std::string::String>,
pub(crate) instance_id: ::std::option::Option<::std::string::String>,
pub(crate) ip_address: ::std::option::Option<::std::string::String>,
pub(crate) dns_name: ::std::option::Option<::std::string::String>,
pub(crate) operating_system: ::std::option::Option<crate::types::OperatingSystem>,
pub(crate) r#type: ::std::option::Option<crate::types::Ec2InstanceType>,
pub(crate) status: ::std::option::Option<crate::types::InstanceStatus>,
pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) location: ::std::option::Option<::std::string::String>,
}
impl InstanceBuilder {
/// <p>A unique identifier for the fleet that the instance belongs to.</p>
pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.fleet_id = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique identifier for the fleet that the instance belongs to.</p>
pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.fleet_id = input;
self
}
/// <p>A unique identifier for the fleet that the instance belongs to.</p>
pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
&self.fleet_id
}
/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a Amazon GameLift Servers fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is <code>arn:aws:gamelift:<region>
/// ::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
/// </region></code>.</p>
pub fn fleet_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.fleet_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a Amazon GameLift Servers fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is <code>arn:aws:gamelift:<region>
/// ::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
/// </region></code>.</p>
pub fn set_fleet_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.fleet_arn = input;
self
}
/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a Amazon GameLift Servers fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is <code>arn:aws:gamelift:<region>
/// ::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
/// </region></code>.</p>
pub fn get_fleet_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.fleet_arn
}
/// <p>A unique identifier for the instance.</p>
pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_id = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique identifier for the instance.</p>
pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_id = input;
self
}
/// <p>A unique identifier for the instance.</p>
pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_id
}
/// <p>IP address that is assigned to the instance.</p>
pub fn ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.ip_address = ::std::option::Option::Some(input.into());
self
}
/// <p>IP address that is assigned to the instance.</p>
pub fn set_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.ip_address = input;
self
}
/// <p>IP address that is assigned to the instance.</p>
pub fn get_ip_address(&self) -> &::std::option::Option<::std::string::String> {
&self.ip_address
}
/// <p>The DNS identifier assigned to the instance that is running the game session. Values have the following format:</p>
/// <ul>
/// <li>
/// <p>TLS-enabled fleets: <code><unique identifier>
/// .
/// <region identifier>
/// .amazongamelift.com
/// </region>
/// </unique></code>.</p></li>
/// <li>
/// <p>Non-TLS-enabled fleets: <code>ec2-<unique identifier>
/// .compute.amazonaws.com
/// </unique></code>. (See <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses">Amazon EC2 Instance IP Addressing</a>.)</p></li>
/// </ul>
/// <p>When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.</p>
pub fn dns_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.dns_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The DNS identifier assigned to the instance that is running the game session. Values have the following format:</p>
/// <ul>
/// <li>
/// <p>TLS-enabled fleets: <code><unique identifier>
/// .
/// <region identifier>
/// .amazongamelift.com
/// </region>
/// </unique></code>.</p></li>
/// <li>
/// <p>Non-TLS-enabled fleets: <code>ec2-<unique identifier>
/// .compute.amazonaws.com
/// </unique></code>. (See <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses">Amazon EC2 Instance IP Addressing</a>.)</p></li>
/// </ul>
/// <p>When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.</p>
pub fn set_dns_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.dns_name = input;
self
}
/// <p>The DNS identifier assigned to the instance that is running the game session. Values have the following format:</p>
/// <ul>
/// <li>
/// <p>TLS-enabled fleets: <code><unique identifier>
/// .
/// <region identifier>
/// .amazongamelift.com
/// </region>
/// </unique></code>.</p></li>
/// <li>
/// <p>Non-TLS-enabled fleets: <code>ec2-<unique identifier>
/// .compute.amazonaws.com
/// </unique></code>. (See <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses">Amazon EC2 Instance IP Addressing</a>.)</p></li>
/// </ul>
/// <p>When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.</p>
pub fn get_dns_name(&self) -> &::std::option::Option<::std::string::String> {
&self.dns_name
}
/// <p>Operating system that is running on this EC2 instance.</p><note>
/// <p>Amazon Linux 2 (AL2) will reach end of support on 6/30/2026. See more details in the <a href="http://aws.amazon.com/aws.amazon.com/amazon-linux-2/faqs/">Amazon Linux 2 FAQs</a>. For game servers that are hosted on AL2 and use server SDK version 4.x for Amazon GameLift Servers, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk5-migration.html"> Migrate to server SDK version 5.</a></p>
/// </note>
pub fn operating_system(mut self, input: crate::types::OperatingSystem) -> Self {
self.operating_system = ::std::option::Option::Some(input);
self
}
/// <p>Operating system that is running on this EC2 instance.</p><note>
/// <p>Amazon Linux 2 (AL2) will reach end of support on 6/30/2026. See more details in the <a href="http://aws.amazon.com/aws.amazon.com/amazon-linux-2/faqs/">Amazon Linux 2 FAQs</a>. For game servers that are hosted on AL2 and use server SDK version 4.x for Amazon GameLift Servers, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk5-migration.html"> Migrate to server SDK version 5.</a></p>
/// </note>
pub fn set_operating_system(mut self, input: ::std::option::Option<crate::types::OperatingSystem>) -> Self {
self.operating_system = input;
self
}
/// <p>Operating system that is running on this EC2 instance.</p><note>
/// <p>Amazon Linux 2 (AL2) will reach end of support on 6/30/2026. See more details in the <a href="http://aws.amazon.com/aws.amazon.com/amazon-linux-2/faqs/">Amazon Linux 2 FAQs</a>. For game servers that are hosted on AL2 and use server SDK version 4.x for Amazon GameLift Servers, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk5-migration.html"> Migrate to server SDK version 5.</a></p>
/// </note>
pub fn get_operating_system(&self) -> &::std::option::Option<crate::types::OperatingSystem> {
&self.operating_system
}
/// <p>EC2 instance type that defines the computing resources of this instance.</p>
pub fn r#type(mut self, input: crate::types::Ec2InstanceType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>EC2 instance type that defines the computing resources of this instance.</p>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::Ec2InstanceType>) -> Self {
self.r#type = input;
self
}
/// <p>EC2 instance type that defines the computing resources of this instance.</p>
pub fn get_type(&self) -> &::std::option::Option<crate::types::Ec2InstanceType> {
&self.r#type
}
/// <p>Current status of the instance. Possible statuses include the following:</p>
/// <ul>
/// <li>
/// <p><b>PENDING</b> -- The instance is in the process of being created and launching server processes as defined in the fleet's run-time configuration.</p></li>
/// <li>
/// <p><b>ACTIVE</b> -- The instance has been successfully created and at least one server process has successfully launched and reported back to Amazon GameLift Servers that it is ready to host a game session. The instance is now considered ready to host game sessions.</p></li>
/// <li>
/// <p><b>TERMINATING</b> -- The instance is in the process of shutting down. This may happen to reduce capacity during a scaling down event or to recycle resources in the event of a problem.</p></li>
/// </ul>
pub fn status(mut self, input: crate::types::InstanceStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>Current status of the instance. Possible statuses include the following:</p>
/// <ul>
/// <li>
/// <p><b>PENDING</b> -- The instance is in the process of being created and launching server processes as defined in the fleet's run-time configuration.</p></li>
/// <li>
/// <p><b>ACTIVE</b> -- The instance has been successfully created and at least one server process has successfully launched and reported back to Amazon GameLift Servers that it is ready to host a game session. The instance is now considered ready to host game sessions.</p></li>
/// <li>
/// <p><b>TERMINATING</b> -- The instance is in the process of shutting down. This may happen to reduce capacity during a scaling down event or to recycle resources in the event of a problem.</p></li>
/// </ul>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::InstanceStatus>) -> Self {
self.status = input;
self
}
/// <p>Current status of the instance. Possible statuses include the following:</p>
/// <ul>
/// <li>
/// <p><b>PENDING</b> -- The instance is in the process of being created and launching server processes as defined in the fleet's run-time configuration.</p></li>
/// <li>
/// <p><b>ACTIVE</b> -- The instance has been successfully created and at least one server process has successfully launched and reported back to Amazon GameLift Servers that it is ready to host a game session. The instance is now considered ready to host game sessions.</p></li>
/// <li>
/// <p><b>TERMINATING</b> -- The instance is in the process of shutting down. This may happen to reduce capacity during a scaling down event or to recycle resources in the event of a problem.</p></li>
/// </ul>
pub fn get_status(&self) -> &::std::option::Option<crate::types::InstanceStatus> {
&self.status
}
/// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.creation_time = ::std::option::Option::Some(input);
self
}
/// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.creation_time = input;
self
}
/// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.creation_time
}
/// <p>The fleet location of the instance, expressed as an Amazon Web Services Region code, such as <code>us-west-2</code>.</p>
pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.location = ::std::option::Option::Some(input.into());
self
}
/// <p>The fleet location of the instance, expressed as an Amazon Web Services Region code, such as <code>us-west-2</code>.</p>
pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.location = input;
self
}
/// <p>The fleet location of the instance, expressed as an Amazon Web Services Region code, such as <code>us-west-2</code>.</p>
pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
&self.location
}
/// Consumes the builder and constructs a [`Instance`](crate::types::Instance).
pub fn build(self) -> crate::types::Instance {
crate::types::Instance {
fleet_id: self.fleet_id,
fleet_arn: self.fleet_arn,
instance_id: self.instance_id,
ip_address: self.ip_address,
dns_name: self.dns_name,
operating_system: self.operating_system,
r#type: self.r#type,
status: self.status,
creation_time: self.creation_time,
location: self.location,
}
}
}
impl ::std::fmt::Debug for InstanceBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("InstanceBuilder");
formatter.field("fleet_id", &self.fleet_id);
formatter.field("fleet_arn", &self.fleet_arn);
formatter.field("instance_id", &self.instance_id);
formatter.field("ip_address", &"*** Sensitive Data Redacted ***");
formatter.field("dns_name", &self.dns_name);
formatter.field("operating_system", &self.operating_system);
formatter.field("r#type", &self.r#type);
formatter.field("status", &self.status);
formatter.field("creation_time", &self.creation_time);
formatter.field("location", &self.location);
formatter.finish()
}
}