実現したいこと
AWS Cloudformationを用いてコード化した環境を構築したい。
しかし、下記エラーとなるので、スタックへインポートできない。
発生している問題・分からないこと
「Cloudformation > スタック > リソースをインポート」画面で以下のエラーが出る。
具体的には以下の画面・箇所でエラーになります。
→画像参照元:https://business.ntt-east.co.jp/content/cloudsolution/column-try-44.html
エラーメッセージ
error
1- このテンプレートにはインポートするリソースは含まれていません 2- READ operation is not supported
該当のソースコード
YAML
1AWSTemplateFormatVersion: '2010-09-09' 2Resources: 3 VPC: 4 Type: AWS::EC2::VPC 5 Properties: 6 CidrBlock: 10.0.0.0/16 7 Tags: 8 - Key: Name 9 Value: VPC 10 InternetGateway: 11 Type: AWS::EC2::InternetGateway 12 Properties: 13 Tags: 14 - Key: Name 15 Value: InternetGateway 16 VPCGatewayAttachment: 17 Type: AWS::EC2::VPCGatewayAttachment 18 Properties: 19 VpcId: !Ref VPC 20 InternetGatewayId: !Ref InternetGateway 21 RouteTable: 22 Type: AWS::EC2::RouteTable 23 DependsOn: VPCGatewayAttachment 24 Properties: 25 VpcId: !Ref VPC 26 Tags: 27 - Key: Name 28 Value: RouteTable 29 Route: 30 Type: AWS::EC2::Route 31 DependsOn: VPCGatewayAttachment 32 Properties: 33 RouteTableId: !Ref RouteTable 34 DestinationCidrBlock: 0.0.0.0/0 35 GatewayId: !Ref InternetGateway 36 Subnet: 37 Type: AWS::EC2::Subnet 38 DependsOn: VPCGatewayAttachment 39 Properties: 40 CidrBlock: 10.0.0.0/24 41 MapPublicIpOnLaunch: 'true' 42 VpcId: !Ref VPC 43 Tags: 44 - Key: Name 45 Value: Subnet 46 SubnetRouteTableAssociation: 47 Type: AWS::EC2::SubnetRouteTableAssociation 48 Properties: 49 SubnetId: !Ref Subnet 50 RouteTableId: !Ref RouteTable
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
「該当のソースコード」欄のベースとなったコードは以下を参考にしています。
https://business.ntt-east.co.jp/content/cloudsolution/column-try-44.html
補足
ここから読み込ませたところうまくいきました。
※今までは、「既存のリソースを使用(リソースのインポート)」を選択してしまっていたので、エラーになっていたようでした。
回答1件
あなたの回答
tips
プレビュー