ScalingPolicyProperty Struct
Rule that controls how a fleet is scaled.
Scaling policies are uniquely identified by the combination of name and fleet ID.
| Source | |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_gamelift as gamelift } from 'aws-cdk-lib';
const scalingPolicyProperty: gamelift.CfnFleet.ScalingPolicyProperty = {
name: 'name',
// the properties below are optional
comparisonOperator: 'comparisonOperator',
evaluationPeriods: 123,
location: 'location',
metricName: 'metricName',
policyType: 'policyType',
scalingAdjustment: 123,
scalingAdjustmentType: 'scalingAdjustmentType',
status: 'status',
targetConfiguration: {
targetValue: 123,
},
threshold: 123,
updateStatus: 'updateStatus',
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_gamelift as gamelift
scaling_policy_property = gamelift.CfnFleet.ScalingPolicyProperty(
name="name",
# the properties below are optional
comparison_operator="comparisonOperator",
evaluation_periods=123,
location="location",
metric_name="metricName",
policy_type="policyType",
scaling_adjustment=123,
scaling_adjustment_type="scalingAdjustmentType",
status="status",
target_configuration=gamelift.CfnFleet.TargetConfigurationProperty(
target_value=123
),
threshold=123,
update_status="updateStatus"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.gamelift.*;
ScalingPolicyProperty scalingPolicyProperty = ScalingPolicyProperty.builder()
.name("name")
// the properties below are optional
.comparisonOperator("comparisonOperator")
.evaluationPeriods(123)
.location("location")
.metricName("metricName")
.policyType("policyType")
.scalingAdjustment(123)
.scalingAdjustmentType("scalingAdjustmentType")
.status("status")
.targetConfiguration(TargetConfigurationProperty.builder()
.targetValue(123)
.build())
.threshold(123)
.updateStatus("updateStatus")
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.GameLift;
var scalingPolicyProperty = new ScalingPolicyProperty {
Name = "name",
// the properties below are optional
ComparisonOperator = "comparisonOperator",
EvaluationPeriods = 123,
Location = "location",
MetricName = "metricName",
PolicyType = "policyType",
ScalingAdjustment = 123,
ScalingAdjustmentType = "scalingAdjustmentType",
Status = "status",
TargetConfiguration = new TargetConfigurationProperty {
TargetValue = 123
},
Threshold = 123,
UpdateStatus = "updateStatus"
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
scalingPolicyProperty := &ScalingPolicyProperty{
Name: jsii.String("name"),
// the properties below are optional
ComparisonOperator: jsii.String("comparisonOperator"),
EvaluationPeriods: jsii.Number(123),
Location: jsii.String("location"),
MetricName: jsii.String("metricName"),
PolicyType: jsii.String("policyType"),
ScalingAdjustment: jsii.Number(123),
ScalingAdjustmentType: jsii.String("scalingAdjustmentType"),
Status: jsii.String("status"),
TargetConfiguration: &TargetConfigurationProperty{
TargetValue: jsii.Number(123),
},
Threshold: jsii.Number(123),
UpdateStatus: jsii.String("updateStatus"),
}
Properties
comparisonOperatoroptionalstringcomparison_operatoroptionalstrcomparisonOperatoroptionalStringComparisonOperatoroptionalstringComparisonOperatoroptional*string #evaluationPeriodsoptionalnumberevaluation_periodsoptionalint | floatevaluationPeriodsoptionalNumberEvaluationPeriodsoptionaldoubleEvaluationPeriodsoptional*float64 #locationoptionalstringlocationoptionalstrlocationoptionalStringLocationoptionalstringLocationoptional*string #metricNameoptionalstringmetric_nameoptionalstrmetricNameoptionalStringMetricNameoptionalstringMetricNameoptional*string #notes
For detailed descriptions of fleet metrics, see Monitor Amazon GameLift Servers with Amazon CloudWatch .
- ActivatingGameSessions -- Game sessions in the process of being created.
- ActiveGameSessions -- Game sessions that are currently running.
- ActiveInstances -- Fleet instances that are currently running at least one game session.
- AvailableGameSessions -- Additional game sessions that fleet could host simultaneously, given current capacity.
- AvailablePlayerSessions -- Empty player slots in currently active game sessions. This includes game sessions that are not currently accepting players. Reserved player slots are not included.
- CurrentPlayerSessions -- Player slots in active game sessions that are being used by a player or are reserved for a player.
- IdleInstances -- Active instances that are currently hosting zero game sessions.
- PercentAvailableGameSessions -- Unused percentage of the total number of game sessions that a fleet could host simultaneously, given current capacity. Use this metric for a target-based scaling policy.
- PercentIdleInstances -- Percentage of the total number of active instances that are hosting zero game sessions.
- QueueDepth -- Pending game session placement requests, in any queue, where the current fleet is the top-priority destination.
- WaitTime -- Current wait time for pending game session placement requests, in any queue, where the current fleet is the top-priority destination.
Policy names do not need to be unique.
policyTypeoptionalstringpolicy_typeoptionalstrpolicyTypeoptionalStringPolicyTypeoptionalstringPolicyTypeoptional*string #notes
For a target-based policy, set the parameter MetricName to 'PercentAvailableGameSessions' and specify a TargetConfiguration . For a rule-based policy set the following parameters: MetricName , ComparisonOperator , Threshold , EvaluationPeriods , ScalingAdjustmentType , and ScalingAdjustment .
scalingAdjustmentoptionalnumberscaling_adjustmentoptionalint | floatscalingAdjustmentoptionalNumberScalingAdjustmentoptionaldoubleScalingAdjustmentoptional*float64 #scalingAdjustmentTypeoptionalstringscaling_adjustment_typeoptionalstrscalingAdjustmentTypeoptionalStringScalingAdjustmentTypeoptionalstringScalingAdjustmentTypeoptional*string #notes
- ChangeInCapacity -- add (or subtract) the scaling adjustment value from the current instance count. Positive values scale up while negative values scale down.
- ExactCapacity -- set the instance count to the scaling adjustment value.
- PercentChangeInCapacity -- increase or reduce the current instance count by the scaling adjustment, read as a percentage. Positive values scale up while negative values scale down.
statusoptionalstringstatusoptionalstrstatusoptionalStringStatusoptionalstringStatusoptional*string #notes
The scaling policy can be in force only when in an ACTIVE status. Scaling policies can be suspended for individual fleets. If the policy is suspended for a fleet, the policy status does not change.
- ACTIVE -- The scaling policy can be used for auto-scaling a fleet.
- UPDATE_REQUESTED -- A request to update the scaling policy has been received.
- UPDATING -- A change is being made to the scaling policy.
- DELETE_REQUESTED -- A request to delete the scaling policy has been received.
- DELETING -- The scaling policy is being deleted.
- DELETED -- The scaling policy has been deleted.
- ERROR -- An error occurred in creating the policy. It should be removed and recreated.
targetConfigurationoptionalIResolvable | CfnFleet.target_configurationoptionaltyping.Union[IResolvable, TargetConfigurationProperty]targetConfigurationoptionalIResolvableTargetConfigurationoptionalIResolvableTargetConfigurationoptionalinterface{} #thresholdoptionalnumberthresholdoptionalint | floatthresholdoptionalNumberThresholdoptionaldoubleThresholdoptional*float64 #updateStatusoptionalstringupdate_statusoptionalstrupdateStatusoptionalStringUpdateStatusoptionalstringUpdateStatusoptional*string #The status PENDING_UPDATE indicates that an update was requested for the fleet but has not yet been completed for the location.