Coder Social home page Coder Social logo

aws-vpc-hello-world-setup's Introduction

aws-vpc-hello-world-setup

This repository contains commands for creating basic network structure which contains private, public subnet within single VPC. Before executing commands in execute section, IAM user with Administrator authority(ex. admin.kim) has to be prepared after following instructions explained in this page. Then, corresponding access key and password has to be configured into local configuration file using aws configure command.

Environment

Execution environment setup

python3 --version  # Python 3.10.10
python3 -m venv venv
source venv/bin/activate
pip3 install typer==0.9.0 boto3==1.26.140

Execute

If administrator user profile is configured, use name of the profile as parameter of --profile-name argument. For example, every command below uses configured credential that corresponds to admin.kim.

1. create VPC

  1. create a VPC
  2. create configured security group and attach it to created VPC
  3. create internet gateway and attach it to created VPC
python main.py configure-vpc \
    --profile-name=admin.kim \
    --region=ap-northeast-2 \
    --vpc-name=prod \
    --vpc-cidr=172.20.0.0/16 \
    --sg-name=prod-sg \
    --igw-name=prod-igw

2. create subnet

To create public subnet within VPC, use --is-public option.

  1. create a subnet
  2. create route table and add route to internet gateway
  3. associate created subnet with created route table
python main.py configure-subnet \
    --profile-name=admin.kim \
    --vpc-name=prod \
    --subnet-name=pub-a \
    --cidr-substitute=100 \
    --availability-zone-postfix=a \
    --route-table-name=rt-pub-a \
    --is-public

To create private subnet within VPC, use --no-is-public option.

  1. create a subnet
  2. create a route table
  3. associate created subnet with created route table
python main.py configure-subnet \
    --profile-name=admin.kim \
    --vpc-name=prod \
    --subnet-name=prv-c \
    --cidr-substitute=101 \
    --availability-zone-postfix=c \
    --route-table-name=rt-prv-c \
    --no-is-public

3. delete subnet

Delete objects in reverse order of their creation.

  1. delete association between subnet and route table
  2. delete the route table
  3. delete the subnet
python main.py remove-subnet \
    --profile-name=admin.kim \
    --subnet-name=pub-a

4. delete VPC

Delete objects in reverse order of their creation.

  1. detach internet gateway from VPC and delete it
  2. delete security group
  3. delete VPC
python main.py remove-vpc \
    --profile-name=admin.kim \
    --vpc-name=prod

aws-vpc-hello-world-setup's People

Contributors

sunsikim avatar

Watchers

 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.