##やりたいこと
標題の通りです。
下記jsonファイルをcloudformationにて実行してもEC2 instance i-xxxxxxxxxxxxx is not in the same VPC as ELB.
といったエラーが表示されてしまいます。
##jsonファイル(一部抜粋)
"Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "Monitoring" : "true", "ImageId" : "ami-859bbfe2", "BlockDeviceMappings" : [{ "DeviceName" : "/dev/sdm", "Ebs" : { "VolumeSize" : "8", "VolumeType" : "standard" } }], "KeyName" : "xxxxxxx", "InstanceType" : "t2.micro", "NetworkInterfaces" : [{ "DeviceIndex" : "0", "AssociatePublicIpAddress" : "true", "DeleteOnTermination" : "true", "SubnetId" : { "Ref" : "SubnetDMZAZa" }, "GroupSet" : [{ "Ref" : "SecurityGroupDefault" }] }], "Tags" : [{ "Key" : "Name", "Value" : "xxxxxxxxx" }] } }, "ElasticIp" : { "Type" : "AWS::EC2::EIP", "Properties" : { "InstanceId" : { "Ref" : "Instance"} } }, "ElasticLoadBalancer" : { "Type" : "AWS::ElasticLoadBalancing::LoadBalancer", "Properties" : { "AvailabilityZones" : { "Fn::GetAZs" : ""}, "Instances" : [ { "Ref" : "Instance" } ], "Listeners" : [{ "LoadBalancerPort" : "80", "InstancePort" : "8080", "Protocol" : "HTTP" }], "Tags" : [{ "Key" : "Name", "Value" : "xxxxxxxxxxxxx" }] } }
以上です。
ElasticLoadBalancerにてVPCを指定することができれいばいいのかとは思っていますが、リファレンスを見てもVPCを指定するプロパティがなさそうなので…
情報が不足していたらご指摘お願いいたします。

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