1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package appstream
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/appstream/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Creates a fleet. A fleet consists of streaming instances that run a specified
15// image.
16func (c *Client) CreateFleet(ctx context.Context, params *CreateFleetInput, optFns ...func(*Options)) (*CreateFleetOutput, error) {
17	if params == nil {
18		params = &CreateFleetInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "CreateFleet", params, optFns, addOperationCreateFleetMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*CreateFleetOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31type CreateFleetInput struct {
32
33	// The desired capacity for the fleet.
34	//
35	// This member is required.
36	ComputeCapacity *types.ComputeCapacity
37
38	// The instance type to use when launching fleet instances. The following instance
39	// types are available:
40	//
41	// * stream.standard.small
42	//
43	// * stream.standard.medium
44	//
45	// *
46	// stream.standard.large
47	//
48	// * stream.compute.large
49	//
50	// * stream.compute.xlarge
51	//
52	// *
53	// stream.compute.2xlarge
54	//
55	// * stream.compute.4xlarge
56	//
57	// * stream.compute.8xlarge
58	//
59	// *
60	// stream.memory.large
61	//
62	// * stream.memory.xlarge
63	//
64	// * stream.memory.2xlarge
65	//
66	// *
67	// stream.memory.4xlarge
68	//
69	// * stream.memory.8xlarge
70	//
71	// * stream.memory.z1d.large
72	//
73	// *
74	// stream.memory.z1d.xlarge
75	//
76	// * stream.memory.z1d.2xlarge
77	//
78	// *
79	// stream.memory.z1d.3xlarge
80	//
81	// * stream.memory.z1d.6xlarge
82	//
83	// *
84	// stream.memory.z1d.12xlarge
85	//
86	// * stream.graphics-design.large
87	//
88	// *
89	// stream.graphics-design.xlarge
90	//
91	// * stream.graphics-design.2xlarge
92	//
93	// *
94	// stream.graphics-design.4xlarge
95	//
96	// * stream.graphics-desktop.2xlarge
97	//
98	// *
99	// stream.graphics.g4dn.xlarge
100	//
101	// * stream.graphics.g4dn.2xlarge
102	//
103	// *
104	// stream.graphics.g4dn.4xlarge
105	//
106	// * stream.graphics.g4dn.8xlarge
107	//
108	// *
109	// stream.graphics.g4dn.12xlarge
110	//
111	// * stream.graphics.g4dn.16xlarge
112	//
113	// *
114	// stream.graphics-pro.4xlarge
115	//
116	// * stream.graphics-pro.8xlarge
117	//
118	// *
119	// stream.graphics-pro.16xlarge
120	//
121	// This member is required.
122	InstanceType *string
123
124	// A unique name for the fleet.
125	//
126	// This member is required.
127	Name *string
128
129	// The description to display.
130	Description *string
131
132	// The amount of time that a streaming session remains active after users
133	// disconnect. If users try to reconnect to the streaming session after a
134	// disconnection or network interruption within this time interval, they are
135	// connected to their previous session. Otherwise, they are connected to a new
136	// session with a new streaming instance. Specify a value between 60 and 360000.
137	DisconnectTimeoutInSeconds *int32
138
139	// The fleet name to display.
140	DisplayName *string
141
142	// The name of the directory and organizational unit (OU) to use to join the fleet
143	// to a Microsoft Active Directory domain.
144	DomainJoinInfo *types.DomainJoinInfo
145
146	// Enables or disables default internet access for the fleet.
147	EnableDefaultInternetAccess *bool
148
149	// The fleet type. ALWAYS_ON Provides users with instant-on access to their apps.
150	// You are charged for all running instances in your fleet, even if no users are
151	// streaming apps. ON_DEMAND Provide users with access to applications after they
152	// connect, which takes one to two minutes. You are charged for instance streaming
153	// when users are connected and a small hourly fee for instances that are not
154	// streaming apps.
155	FleetType types.FleetType
156
157	// The Amazon Resource Name (ARN) of the IAM role to apply to the fleet. To assume
158	// a role, a fleet instance calls the AWS Security Token Service (STS) AssumeRole
159	// API operation and passes the ARN of the role to use. The operation creates a new
160	// session with temporary credentials. AppStream 2.0 retrieves the temporary
161	// credentials and creates the appstream_machine_role credential profile on the
162	// instance. For more information, see Using an IAM Role to Grant Permissions to
163	// Applications and Scripts Running on AppStream 2.0 Streaming Instances
164	// (https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html)
165	// in the Amazon AppStream 2.0 Administration Guide.
166	IamRoleArn *string
167
168	// The amount of time that users can be idle (inactive) before they are
169	// disconnected from their streaming session and the DisconnectTimeoutInSeconds
170	// time interval begins. Users are notified before they are disconnected due to
171	// inactivity. If they try to reconnect to the streaming session before the time
172	// interval specified in DisconnectTimeoutInSeconds elapses, they are connected to
173	// their previous session. Users are considered idle when they stop providing
174	// keyboard or mouse input during their streaming session. File uploads and
175	// downloads, audio in, audio out, and pixels changing do not qualify as user
176	// activity. If users continue to be idle after the time interval in
177	// IdleDisconnectTimeoutInSeconds elapses, they are disconnected. To prevent users
178	// from being disconnected due to inactivity, specify a value of 0. Otherwise,
179	// specify a value between 60 and 3600. The default value is 0. If you enable this
180	// feature, we recommend that you specify a value that corresponds exactly to a
181	// whole number of minutes (for example, 60, 120, and 180). If you don't do this,
182	// the value is rounded to the nearest minute. For example, if you specify a value
183	// of 70, users are disconnected after 1 minute of inactivity. If you specify a
184	// value that is at the midpoint between two different minutes, the value is
185	// rounded up. For example, if you specify a value of 90, users are disconnected
186	// after 2 minutes of inactivity.
187	IdleDisconnectTimeoutInSeconds *int32
188
189	// The ARN of the public, private, or shared image to use.
190	ImageArn *string
191
192	// The name of the image used to create the fleet.
193	ImageName *string
194
195	// The maximum amount of time that a streaming session can remain active, in
196	// seconds. If users are still connected to a streaming instance five minutes
197	// before this limit is reached, they are prompted to save any open documents
198	// before being disconnected. After this time elapses, the instance is terminated
199	// and replaced by a new instance. Specify a value between 600 and 360000.
200	MaxUserDurationInSeconds *int32
201
202	// The AppStream 2.0 view that is displayed to your users when they stream from the
203	// fleet. When APP is specified, only the windows of applications opened by users
204	// display. When DESKTOP is specified, the standard desktop that is provided by the
205	// operating system displays. The default value is APP.
206	StreamView types.StreamView
207
208	// The tags to associate with the fleet. A tag is a key-value pair, and the value
209	// is optional. For example, Environment=Test. If you do not specify a value,
210	// Environment=. If you do not specify a value, the value is set to an empty
211	// string. Generally allowed characters are: letters, numbers, and spaces
212	// representable in UTF-8, and the following special characters: _ . : / = + \ - @
213	// For more information, see Tagging Your Resources
214	// (https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html)
215	// in the Amazon AppStream 2.0 Administration Guide.
216	Tags map[string]string
217
218	// The VPC configuration for the fleet.
219	VpcConfig *types.VpcConfig
220}
221
222type CreateFleetOutput struct {
223
224	// Information about the fleet.
225	Fleet *types.Fleet
226
227	// Metadata pertaining to the operation's result.
228	ResultMetadata middleware.Metadata
229}
230
231func addOperationCreateFleetMiddlewares(stack *middleware.Stack, options Options) (err error) {
232	err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateFleet{}, middleware.After)
233	if err != nil {
234		return err
235	}
236	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateFleet{}, middleware.After)
237	if err != nil {
238		return err
239	}
240	if err = addSetLoggerMiddleware(stack, options); err != nil {
241		return err
242	}
243	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
244		return err
245	}
246	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
247		return err
248	}
249	if err = addResolveEndpointMiddleware(stack, options); err != nil {
250		return err
251	}
252	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
253		return err
254	}
255	if err = addRetryMiddlewares(stack, options); err != nil {
256		return err
257	}
258	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
259		return err
260	}
261	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
262		return err
263	}
264	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
265		return err
266	}
267	if err = addClientUserAgent(stack); err != nil {
268		return err
269	}
270	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
271		return err
272	}
273	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
274		return err
275	}
276	if err = addOpCreateFleetValidationMiddleware(stack); err != nil {
277		return err
278	}
279	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFleet(options.Region), middleware.Before); err != nil {
280		return err
281	}
282	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
283		return err
284	}
285	if err = addResponseErrorMiddleware(stack); err != nil {
286		return err
287	}
288	if err = addRequestResponseLogging(stack, options); err != nil {
289		return err
290	}
291	return nil
292}
293
294func newServiceMetadataMiddleware_opCreateFleet(region string) *awsmiddleware.RegisterServiceMetadata {
295	return &awsmiddleware.RegisterServiceMetadata{
296		Region:        region,
297		ServiceID:     ServiceID,
298		SigningName:   "appstream",
299		OperationName: "CreateFleet",
300	}
301}
302