2017-12-05 36 views
1

CloudFormationテンプレートのNetworkInterfaceを参照すると、エラーValue of property NetworkInterfaces must be a list of objectsが表示されます。CloudFormationエラー:プロパティの値NetworkInterfacesはオブジェクトのリストである必要があります

MyAppNetworkInterface: Type: AWS::EC2::NetworkInterface Properties: SubnetId: !Ref SubnetPrivate

MyApp: Type: AWS::EC2::Instance Properties: InstanceType: t2.medium NetworkInterfaces: - !Ref MyAppNetworkInterface

答えて

1

あなたが実際にEC2ホストから直接ネットワークインターフェイスを参照することができます。しかし、構文は若干異なります。

MyAppNetworkInterface: 
    Type: AWS::EC2::NetworkInterface 
    Properties: 
    SubnetId: !Ref SubnetPrivate 

MyApp: 
    Type: AWS::EC2::Instance 
    Properties: 
    InstanceType: t2.medium 
    NetworkInterfaces: 
    - NetworkInterfaceId: !Ref MyAppNetworkInterface 
     DeviceIndex: 0 

(参照:http://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-network-interface.html#cfn-awsec2networkinterface-templateexamples)を

関連する問題