CloudFormationでVPC,SG,IGW,SubnetのコードをVscodeで書きAWSのCloudFormation でスタックの作成をしようとしたのですが、下記のエラーがでてしまい困っています。
ご教授お願い致します。
エラー内容
Template format error: Unresolved resource dependencies [hebiishiPrivatesubnet2a] in the Resources block of the template
yaml
1コード 2AWSTemplateFormatVersion: "2010-09-09" 3 4Resources: 5 XXXVPC: 6 Type: AWS::EC2::VPC 7 Properties: 8 CidrBlock: 10.0.0.0/16 9 EnableDnsHostnames: true 10 EnableDnsSupport: true 11 Tags: 12 - Key: Name 13 Value: XXX-VPC 14 15 XXXpublicsubnet2a: 16 Type: AWS::EC2::Subnet 17 Properties: 18 AvailabilityZone: ap-northeast-2a 19 VpcId: !Ref XXXVPC 20 CidrBlock: 10.0.1.0/24 21 MapPublicIpOnLaunch: true 22 Tags: 23 - Key: Name 24 Value: XXXpublicsubnet2a 25 26 XXXpublicsubnet1c: 27 Type: AWS::EC2::Subnet 28 Properties: 29 AvailabilityZone: ap-northeast-1c 30 VpcId: !Ref XXXVPC 31 CidrBlock: 10.0.2.0/24 32 MapPublicIpOnLaunch: true 33 Tags: 34 - Key: Name 35 Value: XXXpublicsubnet1c 36 37 XXXprivatesubnet2a: 38 Type: AWS::EC2::Subnet 39 Properties: 40 AvailabilityZone: ap-northeast-2a 41 VpcId: !Ref XXXVPC 42 CidrBlock: 10.0.3.0/24 43 MapPublicIpOnLaunch: true 44 Tags: 45 - Key: Name 46 Value: XXXprivatesubnet2a 47 48 XXXprivatesubnet2c: 49 Type: AWS::EC2::Subnet 50 Properties: 51 AvailabilityZone: ap-northeast-2c 52 VpcId: !Ref XXXVPC 53 CidrBlock: 10.0.4.0/24 54 MapPublicIpOnLaunch: true 55 Tags: 56 - Key: Name 57 Value: XXXprivatesubnet2c 58 59 XXXIGW: 60 Type: "AWS::EC2::InternetGateway" 61 Properties: 62 Tags: 63 - Key: Name 64 Value: XXX-IGW 65 66 AttachGateway: 67 Type: "AWS::EC2::VPCGatewayAttachment" 68 Properties: 69 InternetGatewayId: !Ref XXX-IGW 70 VpcId: !Ref XXXVPC 71 72 XXXrtbpublicsubnet: 73 Type: AWS::EC2::RouteTable 74 Properties: 75 VpcId: !Ref XXXVPC 76 Tags: 77 - Key: Name 78 Value: XXXrtpublicsubnet 79 80 XXXRoutePublic: 81 Type: AWS::EC2::Route 82 Properties: 83 RouteTableId: !Ref XXX-rtb-publicsubnet 84 DestinationCidrBlock: 0.0.0.0/0 85 GatewayId: !Ref XXXIGW 86 87 XXXrtbprivatesubnet: 88 Type: AWS::EC2::RouteTable 89 Properties: 90 VpcId: !Ref XXXVPC 91 Tags: 92 - Key: Name 93 Value: XXXrtbprivatesubnet 94 95 96 XXXRouteTableAssocPublic2a: 97 Type: AWS::EC2::SubnetRouteTableAssociation 98 Properties: 99 SubnetId: !Ref XXXpublicsubnet2a 100 RouteTableId: !Ref XXXrtbpublicsubnet 101 102 XXXRouteTableAssocPublic2c: 103 Type: AWS::EC2::SubnetRouteTableAssociation 104 Properties: 105 SubnetId: !Ref XXXpublicsubnet2c 106 RouteTableId: !Ref XXXrtbpublicsubnet 107 108 XXXRouteTableAssocPrivate2a: 109 Type: AWS::EC2::SubnetRouteTableAssociation 110 Properties: 111 SubnetId: !Ref XXXPrivatesubnet2a 112 RouteTableId: !Ref XXXrtbprivatesubnet 113 114 XXXRouteTableAssocPrivate2c: 115 Type: AWS::EC2::SubnetRouteTableAssociation 116 Properties: 117 SubnetId: !Ref XXX-Privatesubnet2c 118 RouteTableId: !Ref XXXrtbprivatesubnet

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。