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
resource "aws_cloud9_environment_ec2" "dev_env" {
instance_type = "t2.micro"
name = var.component_name
resource "aws_cloud9_environment_ec2" "example" {
instance_type = "t2.micro"
name = "example-env"
resource "aws_cloud9_environment_ec2" "edxDeployingonAWS" {
instance_type = "t3.small"
name = "DeployingOnAWS"
}
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
resource "aws_cloud9_environment_ec2" "example" {
instance_type = var.instance_type
name = var.name
}
Parameters
-
arnoptional computed - string -
automatic_stop_time_minutesoptional - number -
descriptionoptional - string -
idoptional computed - string -
instance_typerequired - string -
namerequired - string -
owner_arnoptional computed - string -
subnet_idoptional - string -
tagsoptional - map from string to string -
typeoptional computed - string
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
Type: AWS::Cloud9::EnvironmentEC2
Properties:
AutomaticStopTimeMinutes: 30
ConnectionType: CONNECT_SSH
Description: Jason's Stelligent U dev cloud9 ide
InstanceType: t2.small
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
Type: AWS::Cloud9::EnvironmentEC2
Properties:
Description: Stack IDE
AutomaticStopTimeMinutes: 30
Name: Stack IDE
InstanceType: t2.micro
Type: AWS::Cloud9::EnvironmentEC2
Properties:
Description: AWS Cloud9
AutomaticStopTimeMinutes: 120
InstanceType:
Ref: C9InstanceType
Type: AWS::Cloud9::EnvironmentEC2
Condition: CreateUsers
Properties:
AutomaticStopTimeMinutes: 30
InstanceType: !Ref WorkspaceInstanceType
Name: ECS Workshop Leader
"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" } ]
"Type" : "AWS::Cloud9::EnvironmentEC2",
"Properties" : {
"AutomaticStopTimeMinutes" : {"Ref": "HibernateMinutes"},
"Description" : "Sample Cloud9 IDE from Service Catalog reference architecture",
"InstanceType" : {"Ref": "InstanceType"},
"OwnerArn" : {"Ref": "UserArn"},
"path": "/ResourceTypes/AWS::Cloud9::EnvironmentEC2/Properties/AutomaticStopTimeMinutes/Value",
"value": {
"ValueType": "AWS::Cloud9::EnvironmentEC2.AutomaticStopTimeMinutes"
}
}
]
"Type": "AWS::Cloud9::EnvironmentEC2",
"Properties": {
"ConnectionType": "CONNECT_SSM",
"InstanceType": "t2.small",
"ImageId": "ubuntu-18.04-x86_64",
"Name": "${name}-${count}",
"Type": "AWS::Cloud9::EnvironmentEC2",
"Properties": {
"ConnectionType": "CONNECT_SSM",
"InstanceType": "t2.small",
"ImageId": "ubuntu-18.04-x86_64",
"Name": "${name}-${count}",
Parameters
-
Repositoriesoptional - List of Repository -
OwnerArnoptional - String -
Descriptionoptional - String -
ConnectionTypeoptional - String -
AutomaticStopTimeMinutesoptional - Integer -
ImageIdoptional - String -
SubnetIdoptional - String -
InstanceTyperequired - String -
Tagsoptional - List of Tag -
Nameoptional - String
Explanation in CloudFormation Registry
The
AWS::Cloud9::EnvironmentEC2resource 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.