edit-icon download-icon

ALIYUN::ECS::EIPAssociation

Last Updated: Jun 13, 2018

Description

Associates an EIP to a specified ECS instance.

Syntax

  1. {
  2. "Type" : "ALIYUN::ECS::EIPAssociation",
  3. "Properties" : {
  4. "InstanceId" : String,
  5. "AllocationId": String
  6. }
  7. }

Properties

Name Type Required Description Constraints
InstanceId String Yes ID of the instance to which the EIP is associated. Only ECS instances in VPCs are valid.
AllocationId String Yes EIP ID. N/A

Return values

Fn::GetAtt

None.

Example

  1. {
  2. "ROSTemplateFormatVersion" : "2015-09-01",
  3. "Resources" : {
  4. "NewEip": {
  5. "Type": "ALIYUN::ECS::EIP",
  6. "Properties": {
  7. "Bandwidth" : 50
  8. }
  9. },
  10. "NewEipAssociation": {
  11. "Type": "ALIYUN::ECS::EIPAssociation",
  12. "Properties": {
  13. "AllocationId": {"Fn::GetAtt": ["NewEip", "AllocationId"]},
  14. "InstanceId": "i-xxxxxx"
  15. }
  16. }
  17. },
  18. "Outputs": {
  19. "EipAddress": {
  20. "Value" : {"Fn::GetAtt": ["NewEip", "EipAddress"]}
  21. },
  22. "AllocationId": {
  23. "Value" : {"Fn::GetAtt": ["NewEip", "AllocationId"]}
  24. }
  25. }
  26. }
Thank you! We've received your feedback.