Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Introducción a EC2
- * Presentación: twitter de javi, web de capside, web de aws
- * Aplicación a desplegar: https://thelounge.chat/
- * Diagrama: red, vm con software, ip flotante, firewall 8080
- * Login en AWS console
- * Seleccionar región
- * Presentar default vpc
- * Presentar el IAM
- * Crear policy EIPAdmin
- ```
- {
- "Version": "2012-10-17",
- "Statement": [{
- "Action": [
- "ec2:AllocateAddress",
- "ec2:AssociateAddress",
- "ec2:DescribeAddresses",
- "ec2:DisassociateAddress"
- ],
- "Resource": [
- "*"
- ],
- "Effect": "Allow"
- }]
- }
- ```
- * Crear role lounge-chat-instance con la nueva policy EIPAdmin
- * Presentar EC2
- * Presentar elastic IP
- * Crear EIP lounge-server
- * Generar key: ssh-keygen -t rsa
- * Subir public
- * amazon linux, t2.micro, IAM role, auto-assign public ip + user-data, 8gb ssd, Name, Owner, Project, loung-chat-server-sg (22, 8080), launch (keypair)
- ```
- #!/bin/sh
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
- export NVM_DIR="$HOME/.nvm"
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
- [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
- nvm install --lts
- npm -g install thelounge
- IP=<YOUR-VERY-OWN-ELASTIC-IP>
- INSTANCE=$(curl http://169.254.169.254/latest/meta-data/instance-id)
- aws ec2 associate-address --instance-id $INSTANCE --public-ip $IP --region eu-west-1
- lounge start --host 0.0.0.0 --port 8080 --public
- ```
- * Presentar IP/DNS en detalles
- * Revisar log de arranque (settings)
- * Acceder al chat
- * Proponer paso a HA con ASG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement