CreateEnvironment - Amazon WorkSpaces Thin Client

CreateEnvironment

Creates an environment for your thin client devices.

Request Syntax

POST /environments HTTP/1.1 Content-type: application/json { "clientToken": "string", "desiredSoftwareSetId": "string", "desktopArn": "string", "desktopEndpoint": "string", "deviceCreationTags": { "string" : "string" }, "kmsKeyArn": "string", "maintenanceWindow": { "applyTimeOf": "string", "daysOfTheWeek": [ "string" ], "endTimeHour": number, "endTimeMinute": number, "startTimeHour": number, "startTimeMinute": number, "type": "string" }, "name": "string", "softwareSetUpdateMode": "string", "softwareSetUpdateSchedule": "string", "tags": { "string" : "string" } }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

clientToken

Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.

If you don't provide this value, then AWS generates a random one for you.

If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an IdempotentParameterMismatch error.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 512.

Required: No

desiredSoftwareSetId

The ID of the software set to apply.

Type: String

Pattern: [0-9]{1,9}

Required: No

desktopArn

The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, WorkSpaces Web, or AppStream 2.0.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:[\w+=\/,.@-]+:[a-zA-Z0-9\-]+:[a-zA-Z0-9\-]*:[0-9]{0,12}:[a-zA-Z0-9\-\/\._]+

Required: Yes

desktopEndpoint

The URL for the identity provider login (only for environments that use AppStream 2.0).

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1024.

Pattern: (https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,32}(:[0-9]{1,5})?(\/.*)?

Required: No

deviceCreationTags

A map of the key-value pairs of the tag or tags to assign to the newly created devices for this environment.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: (?!aws:)[A-Za-z0-9 _=@:.+-/]+

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Value Pattern: [A-Za-z0-9 _=@:.+-/]+

Required: No

kmsKeyArn

The Amazon Resource Name (ARN) of the AWS Key Management Service key to use to encrypt the environment.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:[\w+=\/,.@-]+:kms:[a-zA-Z0-9\-]*:[0-9]{0,12}:key\/[a-zA-Z0-9-]+

Required: No

maintenanceWindow

A specification for a time window to apply software updates.

Type: MaintenanceWindow object

Required: No

name

The name for the environment.

Type: String

Pattern: [0-9\p{IsAlphabetic}+:,.@'" -][0-9\p{IsAlphabetic}+=:,.@'" -]{0,63}

Required: No

softwareSetUpdateMode

An option to define which software updates to apply.

Type: String

Valid Values: USE_LATEST | USE_DESIRED

Required: No

softwareSetUpdateSchedule

An option to define if software updates should be applied within a maintenance window.

Type: String

Valid Values: USE_MAINTENANCE_WINDOW | APPLY_IMMEDIATELY

Required: No

tags

A map of the key-value pairs of the tag or tags to assign to the resource.

Type: String to string map

Required: No

Response Syntax

HTTP/1.1 201 Content-type: application/json { "environment": { "activationCode": "string", "arn": "string", "createdAt": number, "desiredSoftwareSetId": "string", "desktopArn": "string", "desktopEndpoint": "string", "desktopType": "string", "id": "string", "maintenanceWindow": { "applyTimeOf": "string", "daysOfTheWeek": [ "string" ], "endTimeHour": number, "endTimeMinute": number, "startTimeHour": number, "startTimeMinute": number, "type": "string" }, "name": "string", "pendingSoftwareSetId": "string", "softwareSetUpdateMode": "string", "softwareSetUpdateSchedule": "string", "updatedAt": number } }

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The following data is returned in JSON format by the service.

environment

Describes an environment.

Type: EnvironmentSummary object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403

ConflictException

The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.

HTTP Status Code: 409

InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500

ResourceNotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404

ServiceQuotaExceededException

Your request exceeds a service quota.

HTTP Status Code: 402

ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429

ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: