Giter Club home page Giter Club logo

aws-cdk-sample's Introduction

aws-cdk-sample

Cfn File

cfn.yml

note: cdk synth >> ..\cfn-template\cfn.yml

Overview

Region: ap-northeast-1(Tokyo), ap-northeast-3(Osaka)
Resource: VPC, Subnets(Single-AZ), Compute, EIP
Security Group: allow IPv4 ICMP all, allow IPv4 SSH all , allow IPv4 RDP all

Enviorment

Node.js & npm

$ node -v;npm -v                
v10.19.0
7.5.4
$ 

Windows

Preparation

chcolatey

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Install

aws cli

choco install awscli

Mac

Preparation

homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install

aws cli

brew install awscli

AWS CDK

Install
npm install -g aws-cdk
Check
$ cdk --version
1.94.1 (build 60d8f91)
$ 

Create Project

Working Directory

$ git clone https://github.com/midnight480/aws-cdk-sample.git
$ mkdir src && cd src

Init(Optional)

$ cdk init app --language typescript

Modify Files

default

$ cat lib/src-stack.ts
import * as cdk from '@aws-cdk/core';

export class SrcStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    // The code that defines your stack goes here
  }
}
$

Add Module

$ cdk --version
1.101.0 (build 149f0fc)
npm install @aws-cdk/[email protected]

or

ls -la ./package.json
npm install

Sample Deploy

cdk deploy TokyoVpc -c key_pair=sample
cdk deploy OsakaVpc -c key_pair=sample

Profile

*Use TokyoVpc

$ aws configure
AWS Access Key ID [None]: 
AWS Secret Access Key [None]: 
Default region name [ap-northeast-1]: 
Default output format [None]: 

*Use OsakaVpc

$ aws configure
AWS Access Key ID [None]: 
AWS Secret Access Key [None]: 
Default region name [ap-northeast-3]: 
Default output format [None]: 

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.