Table of Contents
A low-level client representing AWS Cloud9
AWS Cloud9 is a collection of tools that you can use to code, build, run, test, debug, and release software in the cloud.
For more information about AWS Cloud9, see the AWS Cloud9 User Guide .
AWS Cloud9 supports these operations:
import boto3
client = boto3.client('cloud9')
These are the available methods:
Check if an operation can be paginated.
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
response = client.create_environment_ec2(
name='string',
description='string',
clientRequestToken='string',
instanceType='string',
subnetId='string',
automaticStopTimeMinutes=123,
ownerArn='string',
tags=[
{
'Key': 'string',
'Value': 'string'
},
],
connectionType='CONNECT_SSH'|'CONNECT_SSM'
)
[REQUIRED]
The name of the environment to create.
This name is visible to other AWS IAM users in the same AWS account.
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 .
[REQUIRED]
The type of instance to connect to the environment (for example, t2.micro ).
An array of key-value pairs that will be associated with the new AWS Cloud9 development environment.
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.
The name part of a tag.
The value part of a tag.
dict
Response Syntax
{
'environmentId': 'string'
}
Response Structure
(dict) --
environmentId (string) --
The ID of the environment that was created.
Exceptions
Examples
response = client.create_environment_ec2(
name='my-demo-environment',
automaticStopTimeMinutes=60,
description='This is my demonstration environment.',
instanceType='t2.micro',
ownerArn='arn:aws:iam::123456789012:user/MyDemoUser',
subnetId='subnet-1fab8aEX',
)
print(response)
Expected Output:
{
'environmentId': '8d9967e2f0624182b74e7690ad69ebEX',
'ResponseMetadata': {
'...': '...',
},
}
Adds an environment member to an AWS Cloud9 development environment.
See also: AWS API Documentation
Request Syntax
response = client.create_environment_membership(
environmentId='string',
userArn='string',
permissions='read-write'|'read-only'
)
[REQUIRED]
The ID of the environment that contains the environment member you want to add.
[REQUIRED]
The Amazon Resource Name (ARN) of the environment member you want to add.
[REQUIRED]
The type of environment member permissions you want to associate with this environment member. Available values include:
dict
Response Syntax
{
'membership': {
'permissions': 'owner'|'read-write'|'read-only',
'userId': 'string',
'userArn': 'string',
'environmentId': 'string',
'lastAccess': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
membership (dict) --
Information about the environment member that was added.
permissions (string) --
The type of environment member permissions associated with this environment member. Available values include:
userId (string) --
The user ID in AWS Identity and Access Management (AWS IAM) of the environment member.
userArn (string) --
The Amazon Resource Name (ARN) of the environment member.
environmentId (string) --
The ID of the environment for the environment member.
lastAccess (datetime) --
The time, expressed in epoch time format, when the environment member last opened the environment.
Exceptions
Examples
response = client.create_environment_membership(
environmentId='8d9967e2f0624182b74e7690ad69ebEX',
permissions='read-write',
userArn='arn:aws:iam::123456789012:user/AnotherDemoUser',
)
print(response)
Expected Output:
{
'membership': {
'environmentId': '8d9967e2f0624182b74e7690ad69ebEX',
'permissions': 'read-write',
'userArn': 'arn:aws:iam::123456789012:user/AnotherDemoUser',
'userId': 'AIDAJ3BA6O2FMJWCWXHEX',
},
'ResponseMetadata': {
'...': '...',
},
}
Deletes an AWS Cloud9 development environment. If an Amazon EC2 instance is connected to the environment, also terminates the instance.
See also: AWS API Documentation
Request Syntax
response = client.delete_environment(
environmentId='string'
)
[REQUIRED]
The ID of the environment to delete.
{}
Response Structure
Exceptions
Examples
response = client.delete_environment(
environmentId='8d9967e2f0624182b74e7690ad69ebEX',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes an environment member from an AWS Cloud9 development environment.
See also: AWS API Documentation
Request Syntax
response = client.delete_environment_membership(
environmentId='string',
userArn='string'
)
[REQUIRED]
The ID of the environment to delete the environment member from.
[REQUIRED]
The Amazon Resource Name (ARN) of the environment member to delete from the environment.
dict
Response Syntax
{}
Response Structure
Exceptions
Examples
response = client.delete_environment_membership(
environmentId='8d9967e2f0624182b74e7690ad69ebEX',
userArn='arn:aws:iam::123456789012:user/AnotherDemoUser',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Gets information about environment members for an AWS Cloud9 development environment.
See also: AWS API Documentation
Request Syntax
response = client.describe_environment_memberships(
userArn='string',
environmentId='string',
permissions=[
'owner'|'read-write'|'read-only',
],
nextToken='string',
maxResults=123
)
The type of environment member permissions to get information about. Available values include:
If no value is specified, information about all environment members are returned.
dict
Response Syntax
{
'memberships': [
{
'permissions': 'owner'|'read-write'|'read-only',
'userId': 'string',
'userArn': 'string',
'environmentId': 'string',
'lastAccess': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
memberships (list) --
Information about the environment members for the environment.
(dict) --
Information about an environment member for an AWS Cloud9 development environment.
permissions (string) --
The type of environment member permissions associated with this environment member. Available values include:
userId (string) --
The user ID in AWS Identity and Access Management (AWS IAM) of the environment member.
userArn (string) --
The Amazon Resource Name (ARN) of the environment member.
environmentId (string) --
The ID of the environment for the environment member.
lastAccess (datetime) --
The time, expressed in epoch time format, when the environment member last opened the environment.
nextToken (string) --
If there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a next token . To get the next batch of items in the list, call this operation again, adding the next token to the call.
Exceptions
Examples
The following example gets information about all of the environment members for the specified AWS Cloud9 development environment.
response = client.describe_environment_memberships(
environmentId='8d9967e2f0624182b74e7690ad69ebEX',
)
print(response)
Expected Output:
{
'memberships': [
{
'environmentId': '8d9967e2f0624182b74e7690ad69ebEX',
'permissions': 'read-write',
'userArn': 'arn:aws:iam::123456789012:user/AnotherDemoUser',
'userId': 'AIDAJ3BA6O2FMJWCWXHEX',
},
{
'environmentId': '8d9967e2f0624182b74e7690ad69ebEX',
'permissions': 'owner',
'userArn': 'arn:aws:iam::123456789012:user/MyDemoUser',
'userId': 'AIDAJNUEDQAQWFELJDLEX',
},
],
'ResponseMetadata': {
'...': '...',
},
}
The following example gets information about the owner of the specified AWS Cloud9 development environment.
response = client.describe_environment_memberships(
environmentId='8d9967e2f0624182b74e7690ad69ebEX',
permissions=[
'owner',
],
)
print(response)
Expected Output:
{
'memberships': [
{
'environmentId': '8d9967e2f0624182b74e7690ad69ebEX',
'permissions': 'owner',
'userArn': 'arn:aws:iam::123456789012:user/MyDemoUser',
'userId': 'AIDAJNUEDQAQWFELJDLEX',
},
],
'ResponseMetadata': {
'...': '...',
},
}
The following example gets AWS Cloud9 development environment membership information for the specified user.
response = client.describe_environment_memberships(
userArn='arn:aws:iam::123456789012:user/MyDemoUser',
)
print(response)
Expected Output:
{
'memberships': [
{
'environmentId': '10a75714bd494714929e7f5ec4125aEX',
'lastAccess': datetime(2018, 1, 19, 11, 6, 13, 4, 19, 0),
'permissions': 'owner',
'userArn': 'arn:aws:iam::123456789012:user/MyDemoUser',
'userId': 'AIDAJNUEDQAQWFELJDLEX',
},
{
'environmentId': '12bfc3cd537f41cb9776f8af5525c9EX',
'lastAccess': datetime(2018, 1, 19, 11, 39, 19, 4, 19, 0),
'permissions': 'owner',
'userArn': 'arn:aws:iam::123456789012:user/MyDemoUser',
'userId': 'AIDAJNUEDQAQWFELJDLEX',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Gets status information for an AWS Cloud9 development environment.
See also: AWS API Documentation
Request Syntax
response = client.describe_environment_status(
environmentId='string'
)
[REQUIRED]
The ID of the environment to get status information about.
{
'status': 'error'|'creating'|'connecting'|'ready'|'stopping'|'stopped'|'deleting',
'message': 'string'
}
Response Structure
The status of the environment. Available values include:
Any informational message about the status of the environment.
Exceptions
Examples
response = client.describe_environment_status(
environmentId='8d9967e2f0624182b74e7690ad69ebEX',
)
print(response)
Expected Output:
{
'message': 'Environment is ready to use',
'status': 'ready',
'ResponseMetadata': {
'...': '...',
},
}
Gets information about AWS Cloud9 development environments.
See also: AWS API Documentation
Request Syntax
response = client.describe_environments(
environmentIds=[
'string',
]
)
[REQUIRED]
The IDs of individual environments to get information about.
{
'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'
}
},
]
}
Response Structure
Information about the environments that are returned.
Information about an AWS Cloud9 development environment.
The ID of the environment.
The name of the environment.
The description for the environment.
The type of environment. Valid values include the following:
The connection type used for connecting to an Amazon EC2 environment.
The Amazon Resource Name (ARN) of the environment.
The Amazon Resource Name (ARN) of the environment owner.
The state of the environment in its creation or deletion lifecycle.
The current creation or deletion lifecycle state of the environment.
Any informational message about the lifecycle state of the environment.
If the environment failed to delete, the Amazon Resource Name (ARN) of the related AWS resource.
Exceptions
Examples
response = client.describe_environments(
environmentIds=[
'8d9967e2f0624182b74e7690ad69ebEX',
'349c86d4579e4e7298d500ff57a6b2EX',
],
)
print(response)
Expected Output:
{
'environments': [
{
'name': 'my-demo-environment',
'type': 'ec2',
'arn': 'arn:aws:cloud9:us-east-2:123456789012:environment:8d9967e2f0624182b74e7690ad69ebEX',
'description': 'This is my demonstration environment.',
'id': '8d9967e2f0624182b74e7690ad69ebEX',
'ownerArn': 'arn:aws:iam::123456789012:user/MyDemoUser',
},
{
'name': 'another-demo-environment',
'type': 'ssh',
'arn': 'arn:aws:cloud9:us-east-2:123456789012:environment:349c86d4579e4e7298d500ff57a6b2EX',
'id': '349c86d4579e4e7298d500ff57a6b2EX',
'ownerArn': 'arn:aws:sts::123456789012:assumed-role/AnotherDemoUser/AnotherDemoUser',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Generate a presigned url given a client, its method, and arguments
The presigned url
Create a paginator for an operation.
Returns an object that can wait for some condition.
Gets a list of AWS Cloud9 development environment identifiers.
See also: AWS API Documentation
Request Syntax
response = client.list_environments(
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'nextToken': 'string',
'environmentIds': [
'string',
]
}
Response Structure
(dict) --
nextToken (string) --
If there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a next token . To get the next batch of items in the list, call this operation again, adding the next token to the call.
environmentIds (list) --
The list of environment identifiers.
Exceptions
Examples
response = client.list_environments(
)
print(response)
Expected Output:
{
'environmentIds': [
'349c86d4579e4e7298d500ff57a6b2EX',
'45a3da47af0840f2b0c0824f5ee232EX',
],
'ResponseMetadata': {
'...': '...',
},
}
Gets a list of the tags associated with an AWS Cloud9 development environment.
See also: AWS API Documentation
Request Syntax
response = client.list_tags_for_resource(
ResourceARN='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the AWS Cloud9 development environment to get the tags for.
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
The list of tags associated with the AWS Cloud9 development environment.
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.
The name part of a tag.
The value part of a tag.
Exceptions
Adds tags to an AWS Cloud9 development environment.
Warning
Tags that you add to an AWS Cloud9 environment by using this method will NOT be automatically propagated to underlying resources.
See also: AWS API Documentation
Request Syntax
response = client.tag_resource(
ResourceARN='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The Amazon Resource Name (ARN) of the AWS Cloud9 development environment to add tags to.
[REQUIRED]
The list of tags to add to the given AWS Cloud9 development environment.
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.
The name part of a tag.
The value part of a tag.
dict
Response Syntax
{}
Response Structure
Exceptions
Removes tags from an AWS Cloud9 development environment.
See also: AWS API Documentation
Request Syntax
response = client.untag_resource(
ResourceARN='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The Amazon Resource Name (ARN) of the AWS Cloud9 development environment to remove tags from.
[REQUIRED]
The tag names of the tags to remove from the given AWS Cloud9 development environment.
dict
Response Syntax
{}
Response Structure
Exceptions
Changes the settings of an existing AWS Cloud9 development environment.
See also: AWS API Documentation
Request Syntax
response = client.update_environment(
environmentId='string',
name='string',
description='string'
)
[REQUIRED]
The ID of the environment to change settings.
dict
Response Syntax
{}
Response Structure
Exceptions
Examples
response = client.update_environment(
name='my-changed-demo-environment',
description='This is my changed demonstration environment.',
environmentId='8d9967e2f0624182b74e7690ad69ebEX',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Changes the settings of an existing environment member for an AWS Cloud9 development environment.
See also: AWS API Documentation
Request Syntax
response = client.update_environment_membership(
environmentId='string',
userArn='string',
permissions='read-write'|'read-only'
)
[REQUIRED]
The ID of the environment for the environment member whose settings you want to change.
[REQUIRED]
The Amazon Resource Name (ARN) of the environment member whose settings you want to change.
[REQUIRED]
The replacement type of environment member permissions you want to associate with this environment member. Available values include:
dict
Response Syntax
{
'membership': {
'permissions': 'owner'|'read-write'|'read-only',
'userId': 'string',
'userArn': 'string',
'environmentId': 'string',
'lastAccess': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
membership (dict) --
Information about the environment member whose settings were changed.
permissions (string) --
The type of environment member permissions associated with this environment member. Available values include:
userId (string) --
The user ID in AWS Identity and Access Management (AWS IAM) of the environment member.
userArn (string) --
The Amazon Resource Name (ARN) of the environment member.
environmentId (string) --
The ID of the environment for the environment member.
lastAccess (datetime) --
The time, expressed in epoch time format, when the environment member last opened the environment.
Exceptions
Examples
response = client.update_environment_membership(
environmentId='8d9967e2f0624182b74e7690ad69ebEX',
permissions='read-only',
userArn='arn:aws:iam::123456789012:user/AnotherDemoUser',
)
print(response)
Expected Output:
{
'membership': {
'environmentId': '8d9967e2f0624182b74e7690ad69eb31',
'permissions': 'read-only',
'userArn': 'arn:aws:iam::123456789012:user/AnotherDemoUser',
'userId': 'AIDAJ3BA6O2FMJWCWXHEX',
},
'ResponseMetadata': {
'...': '...',
},
}
The available paginators are:
paginator = client.get_paginator('describe_environment_memberships')
Creates an iterator that will paginate through responses from Cloud9.Client.describe_environment_memberships().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
userArn='string',
environmentId='string',
permissions=[
'owner'|'read-write'|'read-only',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The type of environment member permissions to get information about. Available values include:
If no value is specified, information about all environment members are returned.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'memberships': [
{
'permissions': 'owner'|'read-write'|'read-only',
'userId': 'string',
'userArn': 'string',
'environmentId': 'string',
'lastAccess': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
memberships (list) --
Information about the environment members for the environment.
(dict) --
Information about an environment member for an AWS Cloud9 development environment.
permissions (string) --
The type of environment member permissions associated with this environment member. Available values include:
userId (string) --
The user ID in AWS Identity and Access Management (AWS IAM) of the environment member.
userArn (string) --
The Amazon Resource Name (ARN) of the environment member.
environmentId (string) --
The ID of the environment for the environment member.
lastAccess (datetime) --
The time, expressed in epoch time format, when the environment member last opened the environment.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_environments')
Creates an iterator that will paginate through responses from Cloud9.Client.list_environments().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
{
'environmentIds': [
'string',
],
'NextToken': 'string'
}
Response Structure
The list of environment identifiers.
A token to resume pagination.