-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# AWS Cloud9 | ||
[AWS Cloud9](https://aws.amazon.com/cloud9/) is a cloud-based integrated development environment (IDE) that lets you write, run, and debug your code with just a browser. It includes a code editor, debugger, and terminal. Cloud9 comes prepackaged with essential tools for popular programming languages, including JavaScript, Python, PHP, and more, so you don’t need to install files or configure your development machine to start new projects. Since your Cloud9 IDE is cloud-based, you can work on your projects from your office, home, or anywhere using an internet-connected machine. Cloud9 also provides a seamless experience for developing serverless applications enabling you to easily define resources, debug, and switch between local and remote execution of serverless applications. Fore more details, please refer to [this page](https://aws.amazon.com/cloud9/details/). | ||
|
||
![aws-c9-editor](../../images/aws-c9-editor.png) | ||
|
||
## Setup | ||
### Prerequisites | ||
This module requires *terraform*. If you don't have the terraform tool in your environment, go to the main [page](https://github.com/Young-ook/terraform-aws-ssm) of this repository and follow the installation instructions. | ||
|
||
### Quickstart | ||
``` | ||
module "vpc" { | ||
source = "Young-ook/vpc/aws" | ||
} | ||
module "cloud9" { | ||
source = "Young-ook/ssm/aws//modules/cloud9" | ||
subnet = values(module.vpc.subnets["public"])[0] | ||
} | ||
``` | ||
|
||
Run terraform: | ||
``` | ||
terraform init | ||
terraform apply | ||
``` | ||
|
||
# Additional Resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
### default values | ||
|
||
module "aws" { | ||
source = "Young-ook/spinnaker/aws//modules/aws-partitions" | ||
} | ||
|
||
locals { | ||
default_workspace = { | ||
instance_type = "t2.micro" | ||
connection_type = "CONNECT_SSM" # allowed values: CONNECT_SSH, CONNECT_SSM | ||
automatic_stop_time_minutes = 30 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
### frigga name | ||
module "frigga" { | ||
source = "Young-ook/spinnaker/aws//modules/frigga" | ||
version = "3.0.0" | ||
name = var.name == null || var.name == "" ? "c9" : var.name | ||
petname = var.name == null || var.name == "" ? true : false | ||
} | ||
|
||
locals { | ||
name = module.frigga.name | ||
default-tags = merge( | ||
{ "terraform.io" = "managed" }, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
### integrated development environment | ||
resource "aws_cloud9_environment_ec2" "ide" { | ||
name = local.name | ||
tags = merge(local.default-tags, var.tags) | ||
instance_type = lookup(var.workspace, "instance_type", local.default_workspace.instance_type) | ||
automatic_stop_time_minutes = lookup(var.workspace, "automatic_stop_time_minutes", local.default_workspace.automatic_stop_time_minutes) | ||
connection_type = lookup(var.workspace, "connection_type", local.default_workspace.connection_type) | ||
subnet_id = var.subnet | ||
} | ||
|
||
data "aws_instance" "ide" { | ||
filter { | ||
name = "tag:aws:cloud9:environment" | ||
values = [aws_cloud9_environment_ec2.ide.id] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
### output variables | ||
|
||
output "cloud9_url" { | ||
description = "URL to open AWS Cloud9 IDE" | ||
value = "https://${module.aws.region.name}.console.aws.amazon.com/cloud9/ide/${aws_cloud9_environment_ec2.ide.id}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
terraform { | ||
required_providers { | ||
test = { | ||
source = "terraform.io/builtin/test" | ||
} | ||
} | ||
} | ||
|
||
module "vpc" { | ||
source = "Young-ook/vpc/aws" | ||
version = "1.0.5" | ||
} | ||
|
||
module "main" { | ||
source = "../.." | ||
subnet = values(module.vpc.subnets["public"])[0] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
### network | ||
variable "subnet" { | ||
description = "The subnet ID to deploy your cloud9 environment" | ||
type = string | ||
default = null | ||
} | ||
|
||
### workspace | ||
variable "workspace" { | ||
description = "Cloud9 workspace configuration" | ||
default = {} | ||
} | ||
|
||
### description | ||
variable "name" { | ||
description = "Resource name of your cloud id environment" | ||
type = string | ||
default = null | ||
} | ||
|
||
### tags | ||
variable "tags" { | ||
description = "The key-value maps for tagging" | ||
type = map(string) | ||
default = {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## requirements | ||
|
||
terraform { | ||
# Terraform test is an experimental features introduced in Terraform CLI v0.15.0. | ||
# So, you'll need to upgrade to v0.15.0 or later to use terraform test. | ||
required_version = ">= 0.15" | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 4.0" | ||
} | ||
} | ||
} |