Last active
March 7, 2020 10:21
-
-
Save harrythebarry/852e8e40d2c0bf16eede3143db07c055 to your computer and use it in GitHub Desktop.
Revisions
-
harrythebarry revised this gist
Mar 7, 2020 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -76,3 +76,10 @@ http.get('http://18.217.220.5:8081', (resp) => { console.log("Error: " + err.message); }); # IAM permissions - Using ENV Variables of User - Using AWS credentials inside application - Passing AWS credentials dynamically to application - Attach role to EC2 instane on which application is running -
harrythebarry revised this gist
Mar 7, 2020 . 1 changed file with 26 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -50,3 +50,29 @@ http.createServer(function (request, response) { // Console will print the message console.log('Server running at http://127.0.0.1:8081/'); #### Talk to another server.. const http = require('http'); //load with local ip //http.get('http://172.31.36.226:8081', (resp) => { http.get('http://18.217.220.5:8081', (resp) => { let data = ''; // A chunk of data has been recieved. resp.on('data', (chunk) => { data += chunk; }); // The whole response has been received. Print out the result. resp.on('end', () => { console.log(data); }); }).on("error", (err) => { console.log("Error: " + err.message); }); -
harrythebarry revised this gist
Mar 7, 2020 . 1 changed file with 19 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -31,4 +31,22 @@ nvm install node export AWS_DEFAULT_REGION=us-east-1 export AWS__REGION=us-east-1 export AWS_ACCESS_KEY_ID=<ACCESS_ID> export AWS_SECRET_ACCESS_KEY=<SECRET_ACCESS_KEY> # Start node server var http = require("http"); http.createServer(function (request, response) { // Send the HTTP header // HTTP Status: 200 : OK // Content Type: text/plain response.writeHead(200, {'Content-Type': 'text/plain'}); // Send the response body as "Hello World" response.end('Hello World\n'); }).listen(8081); // Console will print the message console.log('Server running at http://127.0.0.1:8081/'); -
harrythebarry revised this gist
Mar 7, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -30,5 +30,5 @@ nvm install node export AWS_DEFAULT_REGION=us-east-1 export AWS__REGION=us-east-1 export AWS_ACCESS_KEY_ID=<ACCESS_ID> export AWS_SECRET_ACCESS_KEY=<SECRET_ACCESS_KEY> -
harrythebarry revised this gist
Mar 7, 2020 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -26,3 +26,9 @@ nvm install node # TODO - Create User and provide programmatic & console access - Attach Admin Policy - Download export AWS_DEFAULT_REGION=us-east-1 export AWS__REGION=us-east-1 export AWS_ACCESS_KEY_ID=<ACCESS_KEY> export AWS_SECRET_ACCESS_KEY=OsAGhw99uaPycjBWMxQRlYJoPnqg8AipdFAo2j0x -
harrythebarry created this gist
Mar 7, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ ## Setup * Create VPC * Create 2 Subnets under it * Connect both subnets to same routing table * Add Internetgateway to routing table * Connect EC2 to one of the subnets * Start instance and connect ## Install node on ec2 instance curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash . ~/.nvm/nvm.sh nvm install node # Check node # * IAM - Roles & Policies - Users & Groups - Access Type - Programmatic & Console - User will be in a Group and also given Role or attached with some policies # TODO - Create User and provide programmatic & console access - Attach Admin Policy