This file contains hidden or 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
'use strict'; | |
const http = require('http'); | |
const server = http.createServer((req,res) => { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('ok'); | |
// below code will block everything until 10 seconds elapsed | |
console.log('starting blocking code, try make connection!'); |
This file contains hidden or 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
provider "aws" { | |
access_key = "ACCESS_KEY_HERE" | |
secret_key = "SECRET_KEY_HERE" | |
region = "ap-northeast-2" | |
} | |
resource "aws_instance" "example" { | |
ami = "ami-983ce8f6" | |
instance_type = "t2.micro" | |
} |
This file contains hidden or 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
provider "aws" { | |
access_key = "ACCESS_KEY_HERE" | |
secret_key = "SECRET_KEY_HERE" | |
region = "ap-northeast-2" | |
} | |
resource "aws_instance" "example" { | |
ami = "ami-983ce8f6" | |
instance_type = "t2.micro" | |
} |
This file contains hidden or 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
provider "aws" { | |
access_key = "ACCESS_KEY_HERE" | |
secret_key = "SECRET_KEY_HERE" | |
region = "ap-northeast-2" | |
} | |
resource "aws_instance" "example" { | |
ami = "ami-983ce8f6" | |
instance_type = "t2.micro" | |
} |
This file contains hidden or 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
provider "aws" { | |
access_key = "ACCESS_KEY_HERE" | |
secret_key = "SECRET_KEY_HERE" | |
region = "ap-northeast-2" | |
} | |
resource "aws_instance" "example" { | |
ami = "ami-983ce8f6" | |
instance_type = "t2.micro" |
This file contains hidden or 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
variable "access_key" {} | |
variable "secret_key" {} | |
variable "region" { | |
default = "ap-northeast-2" | |
} |
This file contains hidden or 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
provider "aws" { | |
access_key = "${var.access_key}" | |
secret_key = "${var.secret_key}" | |
region = "${var.region}" | |
} | |
resource "aws_instance" "example" { | |
ami = "ami-983ce8f6" | |
instance_type = "t2.micro" |
This file contains hidden or 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
access_key = "foo" | |
secret_key = "bar" |
This file contains hidden or 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
variable "access_key" {} | |
variable "secret_key" {} | |
variable "region" { | |
default = "ap-northeast-2" | |
} | |
variable "amis" { | |
type = "map" | |
default = { | |
ap-northeast-2 = "ami-983ce8f6" |
This file contains hidden or 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
provider "aws" { | |
access_key = "${var.access_key}" | |
secret_key = "${var.secret_key}" | |
region = "${var.region}" | |
} | |
resource "aws_instance" "example" { | |
ami = "${lookup(var.amis, var.region)}" | |
instance_type = "t2.micro" |