Git Product home page Git Product logo

kma-highload's Introduction

VPC

aws ec2 create-vpc --cidr-block 10.10.0.0/18 --no-amazon-provided-ipv6-cidr-block --tag-specifications 'ResourceType=vpc,Tags=[{Key=Name,Value=kma-genesis},{Key=Lesson,Value=public-clouds}]' --query Vpc.VpcId --output text

➜ export VPC_ID=<vpc_id>


Subnets

aws ec2 create-subnet --vpc-id $VPC_ID --availability-zone us-east-1a --cidr-block 10.10.1.0/24

➜ export S1_ID=<subnet_id>

aws ec2 create-subnet --vpc-id $VPC_ID --availability-zone us-east-1b --cidr-block 10.10.2.0/24

➜ export S2_ID=<subnet_id>

aws ec2 create-subnet --vpc-id $VPC_ID --availability-zone us-east-1c --cidr-block 10.10.3.0/24

➜ export S3_ID=<subnet_id>


IGW

aws ec2 create-internet-gateway --query InternetGateway.InternetGatewayId --output text

➜ export IG_ID=<ig_id>

aws ec2 attach-internet-gateway --internet-gateway-id $IG_ID --vpc-id $VPC_ID

Security group

aws ec2 create-security-group --group-name kma-highload-sg --description "kma highload sh" --vpc-id $VPC_ID

➜ export SG_ID=<sg_id>

aws ec2 authorize-security-group-ingress --group-id $SG_ID --protocol tcp --port 22 --cidr  0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-id $SG_ID --protocol tcp --port 80 --cidr  0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-id $SG_ID --protocol tcp --port 443 --cidr  0.0.0.0/0

Instances management

aws ec2 create-launch-template --launch-template-name KmaHighloadTemplate --version-description AutoScalingVersion1 --launch-template-data '{"NetworkInterfaces":[{"DeviceIndex":0,"AssociatePublicIpAddress":true,"Groups":["$SG_ID"],"DeleteOnTermination":true}],"ImageId":"ami-0ff8a91507f77f867","InstanceType":"t3.micro","TagSpecifications":[{"ResourceType":"instance","Tags":[{"Key":"Name","Value":"KmaASG"}]}],"BlockDeviceMappings":[{"DeviceName":"/dev/sda1","Ebs":{"VolumeSize":15}}]}' --region us-east-1
aws autoscaling create-auto-scaling-group --auto-scaling-group-name KmaHighloadASG --launch-template "LaunchTemplateName=KmaHighloadTemplate" --min-size 1 --max-size 2 --desired-capacity 1 --vpc-zone-identifier "$S1_ID,$2_ID,$S3_ID" --availability-zones "us-east-1a" "us-east-1b" "us-east-1c"
# ec2 instance will be created by ASG in a couple of minutes
aws elbv2 create-load-balancer --name kma-highload-lb  --subnets $S1_ID $S2_ID $S3_ID --security-groups $SG_ID
aws autoscaling attach-load-balancers --load-balancer-names kma-highload-lb --auto-scaling-group-name KmaHighloadASG

kma-highload's People

Contributors

dimazhornyk avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.