0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【AWS】CloudFormationでVPCとSubnetを作成する。

0
Posted at

#はじめに

CloudFormationを使用してVPCとSubnetを作成する。

##構成

image.png

プライベートサブネットをAZごとに作成する。

##テンプレート

AWSTemplateFormatVersion: "2010-09-09"
Description: simple myvpc

Resources:
  myVPC:
    Type: AWS::EC2::VPC
    Properties:
      CidrBlock: "192.168.0.0/24"
      EnableDnsSupport: true
      EnableDnsHostnames: true
      Tags:
        - Key: Name
          Value: CF_VPC_TEST
  mySubnet1:
    Type: AWS::EC2::Subnet
    Properties:
      CidrBlock: "192.168.0.0/25"
      VpcId: !Ref myVPC
      Tags:
        - Key: Name
          Value: Privatesubnet01
  mySubnet2:
    Type: AWS::EC2::Subnet
    Properties:
      CidrBlock: "192.168.0.128/25"
      VpcId: !Ref myVPC
      Tags:
        - Key: Name
          Value: Privatesubnet02

##おわりに
まずは最小構成で作成できることを確認する。
意外とインデントの位置が違ったり、必要なパラメータがわからなかったりするのでやってみることが重要。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?