/AWS1/IF_GML=>CREATEFLEET()¶
About CreateFleet¶
This API works with the following fleet types: EC2, Anywhere, Container
Creates a fleet of compute resources to host your game servers. Use this operation to set up a fleet for the following compute types:
Managed EC2 fleet
An EC2 fleet is a set of Amazon Elastic Compute Cloud (Amazon EC2) instances. Your game server build is
deployed to each fleet instance. Amazon GameLift Servers manages the fleet's instances and controls the
lifecycle of game server processes, which host game sessions for players. EC2 fleets can
have instances in multiple locations. Each instance in the fleet is designated a
Compute.
To create an EC2 fleet, provide these required parameters:
-
Either
BuildIdorScriptId -
ComputeTypeset toEC2(the default value) -
EC2InboundPermissions -
EC2InstanceType -
FleetType -
Name -
RuntimeConfigurationwith at least oneServerProcessesconfiguration
If successful, this operation creates a new fleet resource and places it in
NEW status while Amazon GameLift Servers initiates the fleet creation workflow. To debug your fleet, fetch logs, view performance
metrics or other actions on the fleet, create a development fleet with port 22/3389
open. As a best practice, we recommend opening ports for remote access only when you
need them and closing them when you're finished.
When the fleet status is ACTIVE, you can adjust capacity settings and turn autoscaling on/off for each location.
A managed fleet's runtime environment depends on the Amazon Machine Image (AMI) version it uses. When a new fleet is created, Amazon GameLift Servers assigns the latest available AMI version to the fleet, and all compute instances in that fleet are deployed with that version. To update the AMI version, you must create a new fleet. As a best practice, we recommend replacing your managed fleets every 30 days to maintain a secure and up-to-date runtime environment for your hosted game servers. For guidance, see Security best practices for Amazon GameLift Servers.
Anywhere fleet
An Anywhere fleet represents compute resources that are not owned or managed by Amazon GameLift Servers. You might create an Anywhere fleet with your local machine for testing, or use one to host game servers with on-premises hardware or other game hosting solutions.
To create an Anywhere fleet, provide these required parameters:
-
ComputeTypeset toANYWHERE -
Locationsspecifying a custom location -
Name
If successful, this operation creates a new fleet resource and places it in
ACTIVE status. You can register computes with a fleet in
ACTIVE status.
Learn more
Method Signature¶
METHODS /AWS1/IF_GML~CREATEFLEET
IMPORTING
!IV_NAME TYPE /AWS1/GMLNONZEROANDMAXSTRING OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/GMLNONZEROANDMAXSTRING OPTIONAL
!IV_BUILDID TYPE /AWS1/GMLBUILDIDORARN OPTIONAL
!IV_SCRIPTID TYPE /AWS1/GMLSCRIPTIDORARN OPTIONAL
!IV_SERVERLAUNCHPATH TYPE /AWS1/GMLLAUNCHPATHSTRINGMODEL OPTIONAL
!IV_SERVERLAUNCHPARAMETERS TYPE /AWS1/GMLLAUNCHPARAMSSTRMODEL OPTIONAL
!IT_LOGPATHS TYPE /AWS1/CL_GMLSTRINGLIST_W=>TT_STRINGLIST OPTIONAL
!IV_EC2INSTANCETYPE TYPE /AWS1/GMLEC2INSTANCETYPE OPTIONAL
!IT_EC2INBOUNDPERMISSIONS TYPE /AWS1/CL_GMLIPPERMISSION=>TT_IPPERMISSIONSLIST OPTIONAL
!IV_NEWGAMESESSPROTECTIONPLY TYPE /AWS1/GMLPROTECTIONPOLICY OPTIONAL
!IO_RUNTIMECONFIGURATION TYPE REF TO /AWS1/CL_GMLRUNTIMECONF OPTIONAL
!IO_RESOURCECREATIONLIMITPLY TYPE REF TO /AWS1/CL_GMLRESRCCREATIONLMT00 OPTIONAL
!IT_METRICGROUPS TYPE /AWS1/CL_GMLMETRICGROUPLIST_W=>TT_METRICGROUPLIST OPTIONAL
!IV_PEERVPCAWSACCOUNTID TYPE /AWS1/GMLNONZEROANDMAXSTRING OPTIONAL
!IV_PEERVPCID TYPE /AWS1/GMLNONZEROANDMAXSTRING OPTIONAL
!IV_FLEETTYPE TYPE /AWS1/GMLFLEETTYPE OPTIONAL
!IV_INSTANCEROLEARN TYPE /AWS1/GMLNONEMPTYSTRING OPTIONAL
!IO_CERTIFICATECONFIGURATION TYPE REF TO /AWS1/CL_GMLCERTIFICATECONF OPTIONAL
!IT_LOCATIONS TYPE /AWS1/CL_GMLLOCATIONCONF=>TT_LOCATIONCONFIGURATIONLIST OPTIONAL
!IT_TAGS TYPE /AWS1/CL_GMLTAG=>TT_TAGLIST OPTIONAL
!IV_COMPUTETYPE TYPE /AWS1/GMLCOMPUTETYPE OPTIONAL
!IO_ANYWHERECONFIGURATION TYPE REF TO /AWS1/CL_GMLANYWHERECONF OPTIONAL
!IV_INSTANCEROLECREDSPROVIDER TYPE /AWS1/GMLINSTANCEROLECREDSPVDR OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_gmlcreatefleetoutput
RAISING
/AWS1/CX_GMLCONFLICTEXCEPTION
/AWS1/CX_GMLINTERNALSERVICEEX
/AWS1/CX_GMLINVALIDREQUESTEX
/AWS1/CX_GMLLIMITEXCEEDEDEX
/AWS1/CX_GMLNOTFOUNDEXCEPTION
/AWS1/CX_GMLNOTREADYEXCEPTION
/AWS1/CX_GMLTAGGINGFAILEDEX
/AWS1/CX_GMLUNAUTHORIZEDEX
/AWS1/CX_GMLUNSUPPEDREGIONEX
/AWS1/CX_GMLCLIENTEXC
/AWS1/CX_GMLSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_name TYPE /AWS1/GMLNONZEROANDMAXSTRING /AWS1/GMLNONZEROANDMAXSTRING¶
A descriptive label that is associated with a fleet. Fleet names do not need to be unique.
Optional arguments:¶
iv_description TYPE /AWS1/GMLNONZEROANDMAXSTRING /AWS1/GMLNONZEROANDMAXSTRING¶
A description for the fleet.
iv_buildid TYPE /AWS1/GMLBUILDIDORARN /AWS1/GMLBUILDIDORARN¶
The unique identifier for a custom game server build to be deployed to a fleet with compute type
EC2. You can use either the build ID or ARN. The build must be uploaded to Amazon GameLift Servers and inREADYstatus. This fleet property can't be changed after the fleet is created.
iv_scriptid TYPE /AWS1/GMLSCRIPTIDORARN /AWS1/GMLSCRIPTIDORARN¶
The unique identifier for a Realtime configuration script to be deployed to a fleet with compute type
EC2. You can use either the script ID or ARN. Scripts must be uploaded to Amazon GameLift Servers prior to creating the fleet. This fleet property can't be changed after the fleet is created.
iv_serverlaunchpath TYPE /AWS1/GMLLAUNCHPATHSTRINGMODEL /AWS1/GMLLAUNCHPATHSTRINGMODEL¶
This parameter is no longer used. Specify a server launch path using the
RuntimeConfigurationparameter. Requests that use this parameter instead continue to be valid.
iv_serverlaunchparameters TYPE /AWS1/GMLLAUNCHPARAMSSTRMODEL /AWS1/GMLLAUNCHPARAMSSTRMODEL¶
This parameter is no longer used. Specify server launch parameters using the
RuntimeConfigurationparameter. Requests that use this parameter instead continue to be valid.
it_logpaths TYPE /AWS1/CL_GMLSTRINGLIST_W=>TT_STRINGLIST TT_STRINGLIST¶
This parameter is no longer used. To specify where Amazon GameLift Servers should store log files once a server process shuts down, use the Amazon GameLift Servers server API
ProcessReady()and specify one or more directory paths inlogParameters. For more information, see Initialize the server process in the Amazon GameLift Servers Developer Guide.
iv_ec2instancetype TYPE /AWS1/GMLEC2INSTANCETYPE /AWS1/GMLEC2INSTANCETYPE¶
The Amazon GameLift Servers-supported Amazon EC2 instance type to use with managed EC2 fleets. Instance type determines the computing resources that will be used to host your game servers, including CPU, memory, storage, and networking capacity. See Amazon Elastic Compute Cloud Instance Types for detailed descriptions of Amazon EC2 instance types.
it_ec2inboundpermissions TYPE /AWS1/CL_GMLIPPERMISSION=>TT_IPPERMISSIONSLIST TT_IPPERMISSIONSLIST¶
The IP address ranges and port settings that allow inbound traffic to access game server processes and other processes on this fleet. Set this parameter for managed EC2 fleets. You can leave this parameter empty when creating the fleet, but you must call https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateFleetPortSettings to set it before players can connect to game sessions. As a best practice, we recommend opening ports for remote access only when you need them and closing them when you're finished. For Amazon GameLift Servers Realtime fleets, Amazon GameLift Servers automatically sets TCP and UDP ranges.
iv_newgamesessprotectionply TYPE /AWS1/GMLPROTECTIONPOLICY /AWS1/GMLPROTECTIONPOLICY¶
The status of termination protection for active game sessions on the fleet. By default, this property is set to
NoProtection. You can also set game session protection for an individual game session by calling UpdateGameSession.
NoProtection - Game sessions can be terminated during active gameplay as a result of a scale-down event.
FullProtection - Game sessions in
ACTIVEstatus cannot be terminated during a scale-down event.
io_runtimeconfiguration TYPE REF TO /AWS1/CL_GMLRUNTIMECONF /AWS1/CL_GMLRUNTIMECONF¶
Instructions for how to launch and run server processes on the fleet. Set runtime configuration for managed EC2 fleets. For an Anywhere fleets, set this parameter only if the fleet is running the Amazon GameLift Servers Agent. The runtime configuration defines one or more server process configurations. Each server process identifies a game executable or Realtime script file and the number of processes to run concurrently.
This parameter replaces the parameters
ServerLaunchPathandServerLaunchParameters, which are still supported for backward compatibility.
io_resourcecreationlimitply TYPE REF TO /AWS1/CL_GMLRESRCCREATIONLMT00 /AWS1/CL_GMLRESRCCREATIONLMT00¶
A policy that limits the number of game sessions that an individual player can create on instances in this fleet within a specified span of time.
it_metricgroups TYPE /AWS1/CL_GMLMETRICGROUPLIST_W=>TT_METRICGROUPLIST TT_METRICGROUPLIST¶
The name of an Amazon Web Services CloudWatch metric group to add this fleet to. A metric group is used to aggregate the metrics for multiple fleets. You can specify an existing metric group name or set a new name to create a new metric group. A fleet can be included in only one metric group at a time.
iv_peervpcawsaccountid TYPE /AWS1/GMLNONZEROANDMAXSTRING /AWS1/GMLNONZEROANDMAXSTRING¶
Used when peering your Amazon GameLift Servers fleet with a VPC, the unique identifier for the Amazon Web Services account that owns the VPC. You can find your account ID in the Amazon Web Services Management Console under account settings.
iv_peervpcid TYPE /AWS1/GMLNONZEROANDMAXSTRING /AWS1/GMLNONZEROANDMAXSTRING¶
A unique identifier for a VPC with resources to be accessed by your Amazon GameLift Servers fleet. The VPC must be in the same Region as your fleet. To look up a VPC ID, use the VPC Dashboard in the Amazon Web Services Management Console. Learn more about VPC peering in VPC Peering with Amazon GameLift Servers Fleets.
iv_fleettype TYPE /AWS1/GMLFLEETTYPE /AWS1/GMLFLEETTYPE¶
Indicates whether to use On-Demand or Spot instances for this fleet. By default, this property is set to
ON_DEMAND. Learn more about when to use On-Demand versus Spot Instances. This fleet property can't be changed after the fleet is created.
iv_instancerolearn TYPE /AWS1/GMLNONEMPTYSTRING /AWS1/GMLNONEMPTYSTRING¶
A unique identifier for an IAM role that manages access to your Amazon Web Services services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). Create a role or look up a role's ARN by using the IAM dashboard in the Amazon Web Services Management Console. Learn more about using on-box credentials for your game servers at Access external resources from a game server. This fleet property can't be changed after the fleet is created.
io_certificateconfiguration TYPE REF TO /AWS1/CL_GMLCERTIFICATECONF /AWS1/CL_GMLCERTIFICATECONF¶
Prompts Amazon GameLift Servers to generate a TLS/SSL certificate for the fleet. Amazon GameLift Servers uses the certificates to encrypt traffic between game clients and the game servers running on Amazon GameLift Servers. By default, the
CertificateConfigurationisDISABLED. You can't change this property after you create the fleet.Certificate Manager (ACM) certificates expire after 13 months. Certificate expiration can cause fleets to fail, preventing players from connecting to instances in the fleet. We recommend you replace fleets before 13 months, consider using fleet aliases for a smooth transition.
ACM isn't available in all Amazon Web Services regions. A fleet creation request with certificate generation enabled in an unsupported Region, fails with a 4xx error. For more information about the supported Regions, see Supported Regions in the Certificate Manager User Guide.
it_locations TYPE /AWS1/CL_GMLLOCATIONCONF=>TT_LOCATIONCONFIGURATIONLIST TT_LOCATIONCONFIGURATIONLIST¶
A set of remote locations to deploy additional instances to and manage as a multi-location fleet. Use this parameter when creating a fleet in Amazon Web Services Regions that support multiple locations. You can add any Amazon Web Services Region or Local Zone that's supported by Amazon GameLift Servers. Provide a list of one or more Amazon Web Services Region codes, such as
us-west-2, or Local Zone names. When using this parameter, Amazon GameLift Servers requires you to include your home location in the request. For a list of supported Regions and Local Zones, see Amazon GameLift Servers service locations for managed hosting.
it_tags TYPE /AWS1/CL_GMLTAG=>TT_TAGLIST TT_TAGLIST¶
A list of labels to assign to the new fleet resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services General Reference.
iv_computetype TYPE /AWS1/GMLCOMPUTETYPE /AWS1/GMLCOMPUTETYPE¶
The type of compute resource used to host your game servers.
EC2– The game server build is deployed to Amazon EC2 instances for cloud hosting. This is the default setting.
ANYWHERE– Game servers and supporting software are deployed to compute resources that you provide and manage. With this compute type, you can also set theAnywhereConfigurationparameter.
io_anywhereconfiguration TYPE REF TO /AWS1/CL_GMLANYWHERECONF /AWS1/CL_GMLANYWHERECONF¶
Amazon GameLift Servers Anywhere configuration options.
iv_instancerolecredsprovider TYPE /AWS1/GMLINSTANCEROLECREDSPVDR /AWS1/GMLINSTANCEROLECREDSPVDR¶
Prompts Amazon GameLift Servers to generate a shared credentials file for the IAM role that's defined in
InstanceRoleArn. The shared credentials file is stored on each fleet instance and refreshed as needed. Use shared credentials for applications that are deployed along with the game server executable, if the game server is integrated with server SDK version 5.x. For more information about using shared credentials, see Communicate with other Amazon Web Services resources from your fleets.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_gmlcreatefleetoutput /AWS1/CL_GMLCREATEFLEETOUTPUT¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->createfleet(
io_anywhereconfiguration = new /aws1/cl_gmlanywhereconf( |string| )
io_certificateconfiguration = new /aws1/cl_gmlcertificateconf( |string| )
io_resourcecreationlimitply = new /aws1/cl_gmlresrccreationlmt00(
iv_newgamesessionspercreator = 123
iv_policyperiodinminutes = 123
)
io_runtimeconfiguration = new /aws1/cl_gmlruntimeconf(
it_serverprocesses = VALUE /aws1/cl_gmlserverprocess=>tt_serverprocesslist(
(
new /aws1/cl_gmlserverprocess(
iv_concurrentexecutions = 123
iv_launchpath = |string|
iv_parameters = |string|
)
)
)
iv_gamesessacttimeoutseconds = 123
iv_maxconcurrentgamesessacts = 123
)
it_ec2inboundpermissions = VALUE /aws1/cl_gmlippermission=>tt_ippermissionslist(
(
new /aws1/cl_gmlippermission(
iv_fromport = 123
iv_iprange = |string|
iv_protocol = |string|
iv_toport = 123
)
)
)
it_locations = VALUE /aws1/cl_gmllocationconf=>tt_locationconfigurationlist(
( new /aws1/cl_gmllocationconf( |string| ) )
)
it_logpaths = VALUE /aws1/cl_gmlstringlist_w=>tt_stringlist(
( new /aws1/cl_gmlstringlist_w( |string| ) )
)
it_metricgroups = VALUE /aws1/cl_gmlmetricgrouplist_w=>tt_metricgrouplist(
( new /aws1/cl_gmlmetricgrouplist_w( |string| ) )
)
it_tags = VALUE /aws1/cl_gmltag=>tt_taglist(
(
new /aws1/cl_gmltag(
iv_key = |string|
iv_value = |string|
)
)
)
iv_buildid = |string|
iv_computetype = |string|
iv_description = |string|
iv_ec2instancetype = |string|
iv_fleettype = |string|
iv_instancerolearn = |string|
iv_instancerolecredsprovider = |string|
iv_name = |string|
iv_newgamesessprotectionply = |string|
iv_peervpcawsaccountid = |string|
iv_peervpcid = |string|
iv_scriptid = |string|
iv_serverlaunchparameters = |string|
iv_serverlaunchpath = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lo_fleetattributes = lo_result->get_fleetattributes( ).
IF lo_fleetattributes IS NOT INITIAL.
lv_fleetid = lo_fleetattributes->get_fleetid( ).
lv_fleetarn = lo_fleetattributes->get_fleetarn( ).
lv_fleettype = lo_fleetattributes->get_fleettype( ).
lv_ec2instancetype = lo_fleetattributes->get_instancetype( ).
lv_nonzeroandmaxstring = lo_fleetattributes->get_description( ).
lv_nonzeroandmaxstring = lo_fleetattributes->get_name( ).
lv_timestamp = lo_fleetattributes->get_creationtime( ).
lv_timestamp = lo_fleetattributes->get_terminationtime( ).
lv_fleetstatus = lo_fleetattributes->get_status( ).
lv_buildid = lo_fleetattributes->get_buildid( ).
lv_buildarn = lo_fleetattributes->get_buildarn( ).
lv_scriptid = lo_fleetattributes->get_scriptid( ).
lv_scriptarn = lo_fleetattributes->get_scriptarn( ).
lv_launchpathstringmodel = lo_fleetattributes->get_serverlaunchpath( ).
lv_launchparametersstringm = lo_fleetattributes->get_serverlaunchparameters( ).
LOOP AT lo_fleetattributes->get_logpaths( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_nonzeroandmaxstring = lo_row_1->get_value( ).
ENDIF.
ENDLOOP.
lv_protectionpolicy = lo_fleetattributes->get_newgamesessprotectionply( ).
lv_operatingsystem = lo_fleetattributes->get_operatingsystem( ).
lo_resourcecreationlimitpo = lo_fleetattributes->get_resourcecreationlimitply( ).
IF lo_resourcecreationlimitpo IS NOT INITIAL.
lv_wholenumber = lo_resourcecreationlimitpo->get_newgamesessspercreator( ).
lv_wholenumber = lo_resourcecreationlimitpo->get_policyperiodinminutes( ).
ENDIF.
LOOP AT lo_fleetattributes->get_metricgroups( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_metricgroup = lo_row_3->get_value( ).
ENDIF.
ENDLOOP.
LOOP AT lo_fleetattributes->get_stoppedactions( ) into lo_row_4.
lo_row_5 = lo_row_4.
IF lo_row_5 IS NOT INITIAL.
lv_fleetaction = lo_row_5->get_value( ).
ENDIF.
ENDLOOP.
lv_nonemptystring = lo_fleetattributes->get_instancerolearn( ).
lo_certificateconfiguratio = lo_fleetattributes->get_certificateconfiguration( ).
IF lo_certificateconfiguratio IS NOT INITIAL.
lv_certificatetype = lo_certificateconfiguratio->get_certificatetype( ).
ENDIF.
lv_computetype = lo_fleetattributes->get_computetype( ).
lo_anywhereconfiguration = lo_fleetattributes->get_anywhereconfiguration( ).
IF lo_anywhereconfiguration IS NOT INITIAL.
lv_nonnegativelimitedlengt = lo_anywhereconfiguration->get_cost( ).
ENDIF.
lv_instancerolecredentials = lo_fleetattributes->get_instancerolecredspvdr( ).
ENDIF.
LOOP AT lo_result->get_locationstates( ) into lo_row_6.
lo_row_7 = lo_row_6.
IF lo_row_7 IS NOT INITIAL.
lv_locationstringmodel = lo_row_7->get_location( ).
lv_fleetstatus = lo_row_7->get_status( ).
ENDIF.
ENDLOOP.
ENDIF.