AWS Cloud9 Environment EC2

This page shows how to write Terraform and CloudFormation for AWS Cloud9 Environment EC2 and write them securely.

aws_cloud9_environment_ec2 (Terraform)

The Environment EC2 in AWS Cloud9 can be configured in Terraform with the resource name aws_cloud9_environment_ec2. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "aws_cloud9_environment_ec2" "dev_env" {
  instance_type = "t2.micro"
  name          = var.component_name
main.tf#L1
resource "aws_cloud9_environment_ec2" "example" {
  instance_type = "t2.micro"
  name          = "example-env"
cloud9.tf#L1
resource "aws_cloud9_environment_ec2" "edxDeployingonAWS" {
  instance_type = "t3.small"
  name          = "DeployingOnAWS"

}
main.tf#L1
resource "aws_cloud9_environment_ec2" "cloud9" {

  instance_type                 = var.instance_type
  name                          = var.name
  automatic_stop_time_minutes   = var.automatic_stop_time_minutes
  description                   = var.description
main.tf#L1
resource "aws_cloud9_environment_ec2" "example" {
  instance_type = var.instance_type
  name          = var.name
}

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a Cloud9 EC2 Development Environment.

AWS::Cloud9::EnvironmentEC2 (CloudFormation)

The EnvironmentEC2 in Cloud9 can be configured in CloudFormation with the resource name AWS::Cloud9::EnvironmentEC2. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

cloud9-devenv.yml#L5
    Type: AWS::Cloud9::EnvironmentEC2
    Properties:
      AutomaticStopTimeMinutes: 30
      ConnectionType: CONNECT_SSH
      Description: Jason's Stelligent U dev cloud9 ide
      InstanceType: t2.small
stack.yml#L44
    Type: 'AWS::Cloud9::EnvironmentEC2'
    Condition: IfNotSpecialUserName
    Properties:
      OwnerArn: !Sub "arn:aws:sts::${AWS::AccountId}:assumed-role/${AssumedRole}/${UserName}@gmail.com"
      Description: !Ref Description
      AutomaticStopTimeMinutes: !Ref AutomaticStopTimeMinutes
Cloud9Stack.yml#L3
  Type: AWS::Cloud9::EnvironmentEC2
  Properties:
   Description: Stack IDE
   AutomaticStopTimeMinutes: 30
   Name: Stack IDE
   InstanceType: t2.micro
container_cloudformation.yml#L17
    Type: AWS::Cloud9::EnvironmentEC2
    Properties:
      Description: AWS Cloud9
      AutomaticStopTimeMinutes: 120
      InstanceType:
        Ref: C9InstanceType
classroom.yml#L130
    Type: AWS::Cloud9::EnvironmentEC2
    Condition: CreateUsers
    Properties:
      AutomaticStopTimeMinutes: 30
      InstanceType: !Ref WorkspaceInstanceType
      Name: ECS Workshop Leader
CloudFormationCloud9IDE.json#L8
      "Type" : "AWS::Cloud9::EnvironmentEC2",
      "Properties": {
        "Description": " A cloud IDE for writing, running, and debugging codes.",
        "AutomaticStopTimeMinutes" : "30",
        "InstanceType": "t2.micro",
        "Tags": [ { "Key": "resoure-name", "Value": "aws-cloud9-ide-1" } ]
sc-ccoe-cloud9-ra.json#L47
          "Type" : "AWS::Cloud9::EnvironmentEC2",
          "Properties" : {
              "AutomaticStopTimeMinutes" : {"Ref": "HibernateMinutes"},
              "Description" : "Sample Cloud9 IDE from Service Catalog reference architecture",
              "InstanceType" : {"Ref": "InstanceType"},
              "OwnerArn" : {"Ref": "UserArn"},
aws_cloud9.json#L4
    "path": "/ResourceTypes/AWS::Cloud9::EnvironmentEC2/Properties/AutomaticStopTimeMinutes/Value",
    "value": {
      "ValueType": "AWS::Cloud9::EnvironmentEC2.AutomaticStopTimeMinutes"
    }
  }
]
cloud9_stack.json#L4
      "Type": "AWS::Cloud9::EnvironmentEC2",
      "Properties": {
        "ConnectionType": "CONNECT_SSM",
        "InstanceType": "t2.small",
        "ImageId": "ubuntu-18.04-x86_64",
        "Name": "${name}-${count}",
cloud9-stack.json#L4
        "Type": "AWS::Cloud9::EnvironmentEC2",
        "Properties": {
          "ConnectionType": "CONNECT_SSM",
          "InstanceType": "t2.small",
          "ImageId": "ubuntu-18.04-x86_64",
          "Name": "${name}-${count}",

Parameters

Explanation in CloudFormation Registry

The AWS::Cloud9::EnvironmentEC2 resource creates an Amazon EC2 development environment in AWS Cloud9. For more information, see Creating an Environment in the AWS Cloud9 User Guide.

Frequently asked questions

What is AWS Cloud9 Environment EC2?

AWS Cloud9 Environment EC2 is a resource for Cloud9 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Cloud9 Environment EC2?

For Terraform, the formit-io/formit-master, naruhide/terraform-aws-collections and mourackb/edx-deploying-on-aws source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the CreativeMaladjustment/stelligent-u-020201208, Adp74/cloud9 and yaythecloud/serverless-notes-app source code examples are useful. See the CloudFormation Example section for further details.