/
getFleet.go
173 lines (145 loc) · 10.8 KB
/
getFleet.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package gamelift
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The AWS::GameLift::Fleet resource creates an Amazon GameLift (GameLift) fleet to host game servers. A fleet is a set of EC2 or Anywhere instances, each of which can host multiple game sessions.
func LookupFleet(ctx *pulumi.Context, args *LookupFleetArgs, opts ...pulumi.InvokeOption) (*LookupFleetResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupFleetResult
err := ctx.Invoke("aws-native:gamelift:getFleet", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupFleetArgs struct {
// Unique fleet ID
FleetId string `pulumi:"fleetId"`
}
type LookupFleetResult struct {
// Configuration for Anywhere fleet.
AnywhereConfiguration *FleetAnywhereConfiguration `pulumi:"anywhereConfiguration"`
// A human-readable description of a fleet.
Description *string `pulumi:"description"`
// [DEPRECATED] The number of EC2 instances that you want this fleet to host. When creating a new fleet, GameLift automatically sets this value to "1" and initiates a single instance. Once the fleet is active, update this value to trigger GameLift to add or remove instances from the fleet.
DesiredEc2Instances *int `pulumi:"desiredEc2Instances"`
// A range of IP addresses and port settings that allow inbound traffic to connect to server processes on an Amazon GameLift server.
Ec2InboundPermissions []FleetIpPermission `pulumi:"ec2InboundPermissions"`
// Unique fleet ID
FleetId *string `pulumi:"fleetId"`
Locations []FleetLocationConfiguration `pulumi:"locations"`
// [DEPRECATED] The maximum value that is allowed for the fleet's instance count. When creating a new fleet, GameLift automatically sets this value to "1". Once the fleet is active, you can change this value.
MaxSize *int `pulumi:"maxSize"`
// The name of an Amazon CloudWatch metric group. A metric group aggregates the metrics for all fleets in the group. Specify a string containing the metric group name. You can use an existing name or use a new name to create a new metric group. Currently, this parameter can have only one string.
MetricGroups []string `pulumi:"metricGroups"`
// [DEPRECATED] The minimum value allowed for the fleet's instance count. When creating a new fleet, GameLift automatically sets this value to "0". After the fleet is active, you can change this value.
MinSize *int `pulumi:"minSize"`
// A descriptive label that is associated with a fleet. Fleet names do not need to be unique.
Name *string `pulumi:"name"`
// A game session protection policy to apply to all game sessions hosted on instances in this fleet. When protected, active game sessions cannot be terminated during a scale-down event. If this parameter is not set, instances in this fleet default to no protection. You can change a fleet's protection policy to affect future game sessions on the fleet. You can also set protection for individual game sessions.
NewGameSessionProtectionPolicy *FleetNewGameSessionProtectionPolicy `pulumi:"newGameSessionProtectionPolicy"`
// A policy that limits the number of game sessions an individual player can create over a span of time for this fleet.
ResourceCreationLimitPolicy *FleetResourceCreationLimitPolicy `pulumi:"resourceCreationLimitPolicy"`
// Instructions for launching server processes on each instance in the fleet. Server processes run either a custom game build executable or a Realtime script. The runtime configuration defines the server executables or launch script file, launch parameters, and the number of processes to run concurrently on each instance. When creating a fleet, the runtime configuration must have at least one server process configuration; otherwise the request fails with an invalid request exception.
//
// This parameter is required unless the parameters ServerLaunchPath and ServerLaunchParameters are defined. Runtime configuration has replaced these parameters, but fleets that use them will continue to work.
RuntimeConfiguration *FleetRuntimeConfiguration `pulumi:"runtimeConfiguration"`
// A list of rules that control how a fleet is scaled.
ScalingPolicies []FleetScalingPolicy `pulumi:"scalingPolicies"`
}
func LookupFleetOutput(ctx *pulumi.Context, args LookupFleetOutputArgs, opts ...pulumi.InvokeOption) LookupFleetResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupFleetResult, error) {
args := v.(LookupFleetArgs)
r, err := LookupFleet(ctx, &args, opts...)
var s LookupFleetResult
if r != nil {
s = *r
}
return s, err
}).(LookupFleetResultOutput)
}
type LookupFleetOutputArgs struct {
// Unique fleet ID
FleetId pulumi.StringInput `pulumi:"fleetId"`
}
func (LookupFleetOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupFleetArgs)(nil)).Elem()
}
type LookupFleetResultOutput struct{ *pulumi.OutputState }
func (LookupFleetResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupFleetResult)(nil)).Elem()
}
func (o LookupFleetResultOutput) ToLookupFleetResultOutput() LookupFleetResultOutput {
return o
}
func (o LookupFleetResultOutput) ToLookupFleetResultOutputWithContext(ctx context.Context) LookupFleetResultOutput {
return o
}
// Configuration for Anywhere fleet.
func (o LookupFleetResultOutput) AnywhereConfiguration() FleetAnywhereConfigurationPtrOutput {
return o.ApplyT(func(v LookupFleetResult) *FleetAnywhereConfiguration { return v.AnywhereConfiguration }).(FleetAnywhereConfigurationPtrOutput)
}
// A human-readable description of a fleet.
func (o LookupFleetResultOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupFleetResult) *string { return v.Description }).(pulumi.StringPtrOutput)
}
// [DEPRECATED] The number of EC2 instances that you want this fleet to host. When creating a new fleet, GameLift automatically sets this value to "1" and initiates a single instance. Once the fleet is active, update this value to trigger GameLift to add or remove instances from the fleet.
func (o LookupFleetResultOutput) DesiredEc2Instances() pulumi.IntPtrOutput {
return o.ApplyT(func(v LookupFleetResult) *int { return v.DesiredEc2Instances }).(pulumi.IntPtrOutput)
}
// A range of IP addresses and port settings that allow inbound traffic to connect to server processes on an Amazon GameLift server.
func (o LookupFleetResultOutput) Ec2InboundPermissions() FleetIpPermissionArrayOutput {
return o.ApplyT(func(v LookupFleetResult) []FleetIpPermission { return v.Ec2InboundPermissions }).(FleetIpPermissionArrayOutput)
}
// Unique fleet ID
func (o LookupFleetResultOutput) FleetId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupFleetResult) *string { return v.FleetId }).(pulumi.StringPtrOutput)
}
func (o LookupFleetResultOutput) Locations() FleetLocationConfigurationArrayOutput {
return o.ApplyT(func(v LookupFleetResult) []FleetLocationConfiguration { return v.Locations }).(FleetLocationConfigurationArrayOutput)
}
// [DEPRECATED] The maximum value that is allowed for the fleet's instance count. When creating a new fleet, GameLift automatically sets this value to "1". Once the fleet is active, you can change this value.
func (o LookupFleetResultOutput) MaxSize() pulumi.IntPtrOutput {
return o.ApplyT(func(v LookupFleetResult) *int { return v.MaxSize }).(pulumi.IntPtrOutput)
}
// The name of an Amazon CloudWatch metric group. A metric group aggregates the metrics for all fleets in the group. Specify a string containing the metric group name. You can use an existing name or use a new name to create a new metric group. Currently, this parameter can have only one string.
func (o LookupFleetResultOutput) MetricGroups() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupFleetResult) []string { return v.MetricGroups }).(pulumi.StringArrayOutput)
}
// [DEPRECATED] The minimum value allowed for the fleet's instance count. When creating a new fleet, GameLift automatically sets this value to "0". After the fleet is active, you can change this value.
func (o LookupFleetResultOutput) MinSize() pulumi.IntPtrOutput {
return o.ApplyT(func(v LookupFleetResult) *int { return v.MinSize }).(pulumi.IntPtrOutput)
}
// A descriptive label that is associated with a fleet. Fleet names do not need to be unique.
func (o LookupFleetResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupFleetResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
// A game session protection policy to apply to all game sessions hosted on instances in this fleet. When protected, active game sessions cannot be terminated during a scale-down event. If this parameter is not set, instances in this fleet default to no protection. You can change a fleet's protection policy to affect future game sessions on the fleet. You can also set protection for individual game sessions.
func (o LookupFleetResultOutput) NewGameSessionProtectionPolicy() FleetNewGameSessionProtectionPolicyPtrOutput {
return o.ApplyT(func(v LookupFleetResult) *FleetNewGameSessionProtectionPolicy {
return v.NewGameSessionProtectionPolicy
}).(FleetNewGameSessionProtectionPolicyPtrOutput)
}
// A policy that limits the number of game sessions an individual player can create over a span of time for this fleet.
func (o LookupFleetResultOutput) ResourceCreationLimitPolicy() FleetResourceCreationLimitPolicyPtrOutput {
return o.ApplyT(func(v LookupFleetResult) *FleetResourceCreationLimitPolicy { return v.ResourceCreationLimitPolicy }).(FleetResourceCreationLimitPolicyPtrOutput)
}
// Instructions for launching server processes on each instance in the fleet. Server processes run either a custom game build executable or a Realtime script. The runtime configuration defines the server executables or launch script file, launch parameters, and the number of processes to run concurrently on each instance. When creating a fleet, the runtime configuration must have at least one server process configuration; otherwise the request fails with an invalid request exception.
//
// This parameter is required unless the parameters ServerLaunchPath and ServerLaunchParameters are defined. Runtime configuration has replaced these parameters, but fleets that use them will continue to work.
func (o LookupFleetResultOutput) RuntimeConfiguration() FleetRuntimeConfigurationPtrOutput {
return o.ApplyT(func(v LookupFleetResult) *FleetRuntimeConfiguration { return v.RuntimeConfiguration }).(FleetRuntimeConfigurationPtrOutput)
}
// A list of rules that control how a fleet is scaled.
func (o LookupFleetResultOutput) ScalingPolicies() FleetScalingPolicyArrayOutput {
return o.ApplyT(func(v LookupFleetResult) []FleetScalingPolicy { return v.ScalingPolicies }).(FleetScalingPolicyArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupFleetResultOutput{})
}