edit-icon download-icon

ALIYUN::ROS::WaitConditionHandle

Last Updated: Jun 08, 2017

The ALIYUN::ROS::WaitConditionHandle type can be used to create an instance for sending and receiving messages during UserData execution.

Syntax

  1. {
  2. "Type" : "ALIYUN::ROS::WaitConditionHandle",
  3. "Properties" : {
  4. }
  5. }

Return values

Fn::GetAtt

  • CurlCli: A cURL command is generated by the resource and used to send the UserData execution results or status to ROS.

Example

  1. {
  2. "ROSTemplateFormatVersion" : "2015-09-01",
  3. "Resources" : {
  4. "WebServer": {
  5. "Type": "ALIYUN::ECS::Instance",
  6. "Properties": {
  7. "ImageId" : "centos6u5_64_40G_cloudinit_20160728.raw",
  8. "InstanceType": "ecs.s2.large",
  9. "SecurityGroupId": "sg-94q49gota",
  10. "IoOptimized": "optimized",
  11. "VSwitchId": "vsw-94vdvonyi",
  12. "VpcId": "vpc-949uzr8c9",
  13. "SystemDiskCategory": "cloud_ssd",
  14. "UserData": {"Fn::Replace": [
  15. {"ros-notify": {"Fn::GetAtt": ["WaitConHandle", "CurlCli"]}},
  16. {"Fn::Join": ["", [
  17. "#!/bin/sh\n",
  18. "mkdir ~/test_ros\n",
  19. "print hello > ~/1.txt\n",
  20. "ros-notify \n",
  21. "ros-notify -d '{\\"id\\" : \\"1\\"}'\n"
  22. ]]}]}
  23. }
  24. },
  25. "WaitConHandle": {
  26. "Type": "ALIYUN::ROS::WaitConditionHandle"
  27. },
  28. "WaitCondition": {
  29. "Type": "ALIYUN::ROS::WaitCondition",
  30. "Properties": {
  31. "Handle": {"Ref": "WaitConHandle"},
  32. "Timeout": 60,
  33. "Count": 2
  34. }
  35. },
  36. },
  37. "Outputs": {
  38. "InstanceId": {
  39. "Value" : {"Fn::GetAtt": ["WebServer","InstanceId"]}
  40. },
  41. "PublicIp": {
  42. "Value" : {"Fn::GetAtt": ["WebServer","PublicIp"]}
  43. },
  44. "CurlCli" : {
  45. "Value" : { "Fn::GetAtt": ["WaitConHandle", "CurlCli"] }
  46. },
  47. "Data" : {
  48. "Value" : { "Fn::GetAtt": ["WaitCondition", "Data"] }
  49. }
  50. }
  51. }
Thank you! We've received your feedback.