ALIYUN::ROS::WaitConditionHandle 型は、UserData 実行中にメッセージを送受信するインスタンスを作成する場合に使用できます。
構文
{ “Type” : “ALIYUN::ROS::WaitConditionHandle”, “Properties” : { }}
レスポンス値
Fn::GetAtt
CurlCli : リソースによって cURL コマンドが生成され、このコマンドは UserData の実行結果またはステータスを ROS に送信する場合に使用されます。
コーディング例
{ “ROSTemplateFormatVersion” : “2015-09-01”, “Resources” : { “WebServer”: { “Type”: “ALIYUN::ECS::Instance”, “Properties”: { “ImageId” : “centos6u5_64_40G_cloudinit_20160728.raw”, “InstanceType”: “ecs.s2.large”, “SecurityGroupId”: “sg-94q49gota”, “IoOptimized”: “optimized”, “VSwitchId”: “vsw-94vdvonyi”, “VpcId”: “vpc-949uzr8c9”, “SystemDiskCategory”: “cloud_ssd”, “UserData”: {“Fn::Replace”: [ {“ros-notify”: {“Fn::GetAtt”: [“WaitConHandle”, “CurlCli”]}}, {“Fn::Join”: [“”, [ “#! /bin/sh\n”, “mkdir ~/test_ros\n”, “print hello > ~/1.txt\n”, “ros-notify \n”, “ros-notify -d ‘{\“id\“ : \“1\“}’\n” ]]}]} } }, “WaitConHandle”: { “Type”: “ALIYUN::ROS::WaitConditionHandle” }, “WaitCondition”: { “Type”: “ALIYUN::ROS::WaitCondition”, “Properties”: { “Handle”: {“Ref”: “WaitConHandle”}, “Timeout”: 60, “Count”: 2 } }, }, “Outputs”: { “InstanceId”: { “Value” : {“Fn::GetAtt”: [“WebServer”,”InstanceId”]} }, “PublicIp”: { “Value” : {“Fn::GetAtt”: [“WebServer”,”PublicIp”]} }, “CurlCli” : { “Value” : { “Fn::GetAtt”: [“WaitConHandle”, “CurlCli”] } }, “Data” : { “Value” : { “Fn::GetAtt”: [“WaitCondition”, “Data”] } } }}
</article>
</main>