2021/03/31 - AWS Cloud9 - 2 updated api methods
Changes Add ImageId input parameter to CreateEnvironmentEC2 endpoint. New parameter enables creation of environments with different AMIs.
{'imageId': 'string'}
Creates an AWS Cloud9 development environment, launches an Amazon Elastic Compute Cloud (Amazon EC2) instance, and then connects from the instance to the environment.
See also: AWS API Documentation
Request Syntax
client.create_environment_ec2( name='string', description='string', clientRequestToken='string', instanceType='string', subnetId='string', imageId='string', automaticStopTimeMinutes=123, ownerArn='string', tags=[ { 'Key': 'string', 'Value': 'string' }, ], connectionType='CONNECT_SSH'|'CONNECT_SSM' )
string
[REQUIRED]
The name of the environment to create.
This name is visible to other AWS IAM users in the same AWS account.
string
The description of the environment to create.
string
A unique, case-sensitive string that helps AWS Cloud9 to ensure this operation completes no more than one time.
For more information, see Client Tokens in the Amazon EC2 API Reference .
string
[REQUIRED]
The type of instance to connect to the environment (for example, t2.micro ).
string
The ID of the subnet in Amazon VPC that AWS Cloud9 will use to communicate with the Amazon EC2 instance.
string
The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance. You can specify the AMI for the instance using an AMI alias or an AWS Systems Manager (SSM) path. The default AMI is used if the parameter isn't explicitly assigned a value in the request.
AMI aliases
Amazon Linux 2: amazonlinux-2-x86_64
Ubuntu 18.04: ubuntu-18.04-x86_64
Amazon Linux (default): amazonlinux-1-x86_64
SSM paths
Amazon Linux 2: resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64
Ubuntu 18.04: resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64
Amazon Linux (default): resolve:ssm:/aws/service/cloud9/amis/amazonlinux-1-x86_64
integer
The number of minutes until the running instance is shut down after the environment has last been used.
string
The Amazon Resource Name (ARN) of the environment owner. This ARN can be the ARN of any AWS IAM principal. If this value is not specified, the ARN defaults to this environment's creator.
list
An array of key-value pairs that will be associated with the new AWS Cloud9 development environment.
(dict) --
Metadata that is associated with AWS resources. In particular, a name-value pair that can be associated with an AWS Cloud9 development environment. There are two types of tags: user tags and system tags . A user tag is created by the user. A system tag is automatically created by AWS services. A system tag is prefixed with "aws:" and cannot be modified by the user.
Key (string) -- [REQUIRED]
The name part of a tag.
Value (string) -- [REQUIRED]
The value part of a tag.
string
The connection type used for connecting to an Amazon EC2 environment. Valid values are CONNECT_SSH (default) and CONNECT_SSM (connected through AWS Systems Manager).
For more information, see Accessing no-ingress EC2 instances with AWS Systems Manager in the AWS Cloud9 User Guide .
dict
Response Syntax
{ 'environmentId': 'string' }
Response Structure
(dict) --
environmentId (string) --
The ID of the environment that was created.
{'environments': {'managedCredentialsStatus': 'ENABLED_ON_CREATE | ' 'ENABLED_BY_OWNER | ' 'DISABLED_BY_DEFAULT | ' 'DISABLED_BY_OWNER | ' 'DISABLED_BY_COLLABORATOR | ' 'PENDING_REMOVAL_BY_COLLABORATOR ' '| ' 'PENDING_START_REMOVAL_BY_COLLABORATOR ' '| PENDING_REMOVAL_BY_OWNER | ' 'PENDING_START_REMOVAL_BY_OWNER ' '| ' 'FAILED_REMOVAL_BY_COLLABORATOR ' '| FAILED_REMOVAL_BY_OWNER'}}
Gets information about AWS Cloud9 development environments.
See also: AWS API Documentation
Request Syntax
client.describe_environments( environmentIds=[ 'string', ] )
list
[REQUIRED]
The IDs of individual environments to get information about.
(string) --
dict
Response Syntax
{ 'environments': [ { 'id': 'string', 'name': 'string', 'description': 'string', 'type': 'ssh'|'ec2', 'connectionType': 'CONNECT_SSH'|'CONNECT_SSM', 'arn': 'string', 'ownerArn': 'string', 'lifecycle': { 'status': 'CREATING'|'CREATED'|'CREATE_FAILED'|'DELETING'|'DELETE_FAILED', 'reason': 'string', 'failureResource': 'string' }, 'managedCredentialsStatus': 'ENABLED_ON_CREATE'|'ENABLED_BY_OWNER'|'DISABLED_BY_DEFAULT'|'DISABLED_BY_OWNER'|'DISABLED_BY_COLLABORATOR'|'PENDING_REMOVAL_BY_COLLABORATOR'|'PENDING_START_REMOVAL_BY_COLLABORATOR'|'PENDING_REMOVAL_BY_OWNER'|'PENDING_START_REMOVAL_BY_OWNER'|'FAILED_REMOVAL_BY_COLLABORATOR'|'FAILED_REMOVAL_BY_OWNER' }, ] }
Response Structure
(dict) --
environments (list) --
Information about the environments that are returned.
(dict) --
Information about an AWS Cloud9 development environment.
id (string) --
The ID of the environment.
name (string) --
The name of the environment.
description (string) --
The description for the environment.
type (string) --
The type of environment. Valid values include the following:
ec2 : An Amazon Elastic Compute Cloud (Amazon EC2) instance connects to the environment.
ssh : Your own server connects to the environment.
connectionType (string) --
The connection type used for connecting to an Amazon EC2 environment. CONNECT_SSH is selected by default.
arn (string) --
The Amazon Resource Name (ARN) of the environment.
ownerArn (string) --
The Amazon Resource Name (ARN) of the environment owner.
lifecycle (dict) --
The state of the environment in its creation or deletion lifecycle.
status (string) --
The current creation or deletion lifecycle state of the environment.
CREATING : The environment is in the process of being created.
CREATED : The environment was successfully created.
CREATE_FAILED : The environment failed to be created.
DELETING : The environment is in the process of being deleted.
DELETE_FAILED : The environment failed to delete.
reason (string) --
Any informational message about the lifecycle state of the environment.
failureResource (string) --
If the environment failed to delete, the Amazon Resource Name (ARN) of the related AWS resource.
managedCredentialsStatus (string) --
Describes the status of AWS managed temporary credentials for the AWS Cloud9 environment. Available values are:
ENABLED_ON_CREATE
ENABLED_BY_OWNER
DISABLED_BY_DEFAULT
DISABLED_BY_OWNER
DISABLED_BY_COLLABORATOR
PENDING_REMOVAL_BY_COLLABORATOR
PENDING_REMOVAL_BY_OWNER
FAILED_REMOVAL_BY_COLLABORATOR
ENABLED_BY_OWNER
DISABLED_BY_DEFAULT