すべてのプロダクト
Search
ドキュメントセンター

Resource Orchestration Service:ALIYUN::VPC::EIPAssociation

最終更新日:Jan 16, 2025

ALIYUN::VPC::EIPAssociation は、Elastic IPアドレス(EIP)をクラウドサービスインスタンスに関連付けるために使用されます。

構文

{
  "Type": "ALIYUN::VPC::EIPAssociation",
  "Properties": {
    "AllocationId": String,
    "InstanceId": String,
    "PrivateIpAddress": String,
    "Mode": String
  }
}         

プロパティ

プロパティタイプ必須編集可能説明制約
AllocationIdStringYesYesEIP の ID。なし。
InstanceIdStringYesYesクラウドサービスインスタンスの ID。次のタイプのインスタンスがサポートされています。
  • 仮想プライベートクラウド(VPC)タイプの弾性計算サービス(ECS)インスタンス
  • VPC タイプのサーバーロードバランサー(SLB)インスタンス
  • NAT ゲートウェイ
  • 高可用性仮想 IP アドレス(HAVIP)
  • Elastic Network Interface(ENI)
PrivateIpAddressStringNoYesvSwitch の CIDR ブロック内のプライベート IP アドレス。このプロパティを指定しない場合、システムは VPC ID と vSwitch ID に基づいてプライベート IP アドレスを割り当てます。
ModeStringNoYes関連付けモード。デフォルト値:NAT。有効な値:
  • NAT:標準 NAT モード
  • MULTI_BINDED:複数 EIP-ENI モード
  • BINDED:カットスルーモード

戻り値

Fn::GetAtt

  • EipAddress:EIP。
  • AllocationId:EIP の ID。

  • YAML 形式

    ROSTemplateFormatVersion: '2015-09-01'
    Description:
      en: Create a VPC type ECS and bind EIP (existing VPC).
       
    Parameters:
      VPC:
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
        Type: String
        Description:
          en: Please search the ID starting with (vpc-xxx) from console-Virtual Private Cloud.
           
        Label:
          en: VPC ID
           
      VSwitch:
        AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
        AssociationPropertyMetadata:
          VpcId: ${VPC}
        Type: String
        Description:
          en: Existing VSwitch ID, query under console-VPC-VSwitch, <font color='red'>VSwitch must be under VPC. ECS will be created under this VSwitch.</font>
            </font>
        Label:
          en: VSwitch ID
           
      SecurityGroup:
        Type: String
        AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
        Description:
          en: Please search the business security group ID starting with (sg-xxx) from console-ECS-Network & Security.
            </font>
        Label:
          en: Business Security Group ID
           
        AssociationPropertyMetadata:
          VpcId: ${VPC}
      ECSInstanceType:
        AssociationPropertyMetadata:
          InstanceChargeType: ${ECSInstanceType}
        AssociationProperty: ALIYUN::ECS::Instance::InstanceType
        Type: String
        Description:
          en: <font color='blue'><b>1.Before selecting the model please confirm that the current available zone under the model is in stock, some models need to be reported in advance</b></font><br><font color='blue'><b>2.List of optional models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]
              </font>]
        Label:
          en: Instance Type
           
      ECSDiskCategory:
        Type: String
        Description:
          en: '<font color=''blue''><b>Optional values:</b></font><br>[cloud_efficiency: <font color=''green''>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color=''green''>SSD Cloud Disk</font>]<br>[cloud_essd: <font color=''green''>ESSD Cloud Disk</font>]<br>[cloud: <font color=''green''>Cloud Disk</font>]<br>[ephemeral_ssd: <font color=''green''>Local SSD Cloud Disk</font>]'
           
        AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
        AssociationPropertyMetadata:
          InstanceType: ${ECSInstanceType}
        Label:
          en: System Disk Type
           
      InstanceChargeType:
        Type: String
        Label:
          en: Instance Charge Type
           
        Description:
          en: '<font color=''blue''><b>Optional values:</b></font><br>[PostPaid: <font color=''green''>Pay as you go.</font>]<br> [PrePaid: <font color=''green''>Prepaid, monthly subscription.</font>]'
            </font>]'
        AllowedValues:
          - PostPaid
          - PrePaid
        Default: PostPaid
      KeyPairName:
        Type: String
        AssociationProperty: ALIYUN::ECS::KeyPair::KeyPairName
        Label:
          en: Key Pair Name
           
        Description:
          en: If it is a Windows ECS instance, ignore this parameter. The default is blank.<br>If you have filled in <font color='green'>key pair name</font>, <font color='green'>instance password< The content of /font> will still be set in the instance, but the password login method in the Linux system will be forbidden.<br><font color='red'>Please enter the name of the existing key pair. If you use the instance password Login, the key pair name does not need to be filled in.</font>
               </font>
        Default: Null
    Metadata:
      ALIYUN::ROS::Interface:
        ParameterGroups:
          - Parameters:
              - VPC
              - VSwitch
              - SecurityGroup
            Label:
              default: 'VPC '
          - Parameters:
              - ECSInstanceType
              - ECSDiskCategory
              - InstanceChargeType
              - KeyPairName
            Label:
              default: ECS
        TemplateTags:
          - Specify the image Id and snapshot to create ECS instance.
    Resources:
      ECSInstanceGroup:
        Type: ALIYUN::ECS::InstanceGroup
        Properties:
          IoOptimized: optimized
          InstanceChargeType:
            Ref: InstanceChargeType
          SystemDisk_Category:
            Ref: ECSDiskCategory
          SecurityGroupId:
            Ref: SecurityGroup
          VSwitchId:
            Ref: VSwitch
          MaxAmount: 1
          SystemDisk_Size: 40
          VpcId:
            Ref: VPC
          ImageId: ubuntu_14
          InstanceType:
            Ref: ECSInstanceType
          AllocatePublicIP: 'false'
          Password: Admin@123!
          KeyPairName:
            Ref: KeyPairName
      ElasticIp:
        Type: ALIYUN::VPC::EIP
        Properties:
          Bandwidth: 5
          InternetChargeType: PayByTraffic
      ElasticIpAssociation:
        Type: ALIYUN::VPC::EIPAssociation
        Properties:
          InstanceId:
            Fn::Select:
              - 0
              - Fn::GetAtt:
                  - ECSInstanceGroup
                  - InstanceIds
          AllocationId:
            Ref: ElasticIp
    Outputs:
      VpcId:
        Description: VPC Id
        Value:
          Ref: VPC
      SecurityGroupId:
        Description: Security Group Id
        Value:
          Ref: SecurityGroup
      VSwitchId:
        Description: VSwitch Id
        Value:
          Ref: VSwitch
      EipAddress:
        Description: IP address of created EIP.
        Value:
          Fn::GetAtt:
            - ElasticIp
            - EipAddress
                        
  • JSON 形式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Description": {
        "en": "Create a VPC type ECS and bind EIP (existing VPC).",
         // VPC タイプの ECS を作成し、EIP をバインドします(既存の VPC)。
      },
      "Parameters": {
        "VPC": {
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
          "Type": "String",
          "Description": {
            "en": "Please search the ID starting with (vpc-xxx) from console-Virtual Private Cloud.",
             // コンソール - 仮想プライベートクラウドから (vpc-xxx) で始まる ID を検索してください。
          },
          "Label": {
            "en": "VPC ID",
             // VPC ID
          }
        },
        "VSwitch": {
          "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
          "AssociationPropertyMetadata": {
            "VpcId": "${VPC}"
          },
          "Type": "String",
          "Description": {
            "en": "Existing VSwitch ID, query under console-VPC-VSwitch, <font color='red'>VSwitch must be under VPC. ECS will be created under this VSwitch.</font>",
              // 既存の VSwitch ID。コンソール - VPC - VSwitch でクエリを実行します。<font color='red'>VSwitch は VPC の下に配置する必要があります。ECS はこの VSwitch の下に作成されます。</font>
          },
          "Label": {
            "en": "VSwitch ID",
             // VSwitch ID
          }
        },
        "SecurityGroup": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
          "Description": {
            "en": "Please search the business security group ID starting with (sg-xxx) from console-ECS-Network & Security.",
              // コンソール - ECS - ネットワークとセキュリティから (sg-xxx) で始まるビジネスセキュリティグループ ID を検索してください。
          },
          "Label": {
            "en": "Business Security Group ID",
             // ビジネスセキュリティグループ ID
          },
          "AssociationPropertyMetadata": {
            "VpcId": "${VPC}"
          }
        },
        "ECSInstanceType": {
          "AssociationPropertyMetadata": {
            "InstanceChargeType": "${ECSInstanceType}"
          },
          "AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
          "Type": "String",
          "Description": {
            "en": "<font color='blue'><b>1.Before selecting the model please confirm that the current available zone under the model is in stock, some models need to be reported in advance</b></font><br><font color='blue'><b>2.List of optional models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]",
                // <font color='blue'><b>1.機種を選択する前に、機種の現在利用可能なゾーンに在庫があることを確認してください。一部の機種は事前に報告する必要があります。</b></font><br><font color='blue'><b>2.オプションの機種一覧</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB イントラネット帯域幅 1Gbps イングリッド送受信パッケージ 3000 万 PPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB イントラネット帯域幅 1.5Gbps イングリッド送受信パッケージ 5000 万 PPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB イントラネット帯域幅 2.5Gbps イングリッド送受信パッケージ 8000 万 PPS</font>]
          },
          "Label": {
            "en": "Instance Type",
             // インスタンスタイプ
          }
        },
        "ECSDiskCategory": {
          "Type": "String",
          "Description": {
            "en": "<font color='blue'><b>Optional values:</b></font><br>[cloud_efficiency: <font color='green'>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color='green'>SSD Cloud Disk</font>]<br>[cloud_essd: <font color='green'>ESSD Cloud Disk</font>]<br>[cloud: <font color='green'>Cloud Disk</font>]<br>[ephemeral_ssd: <font color='green'>Local SSD Cloud Disk</font>]",
             // <font color='blue'><b>オプション値:</b></font><br>[cloud_efficiency: <font color='green'>効率クラウドディスク</font>]<br>[cloud_ssd: <font color='green'>SSD クラウドディスク</font>]<br>[cloud_essd: <font color='green'>ESSD クラウドディスク</font>]<br>[cloud: <font color='green'>クラウドディスク</font>]<br>[ephemeral_ssd: <font color='green'>ローカル SSD クラウドディスク</font>]
          },
          "AssociationProperty": "ALIYUN::ECS::Disk::SystemDiskCategory",
          "AssociationPropertyMetadata": {
            "InstanceType": "${ECSInstanceType}"
          },
          "Label": {
            "en": "System Disk Type",
             // システムディスクタイプ
          }
        },
        "InstanceChargeType": {
          "Type": "String",
          "Label": {
            "en": "Instance Charge Type",
             // インスタンス課金タイプ
          },
          "Description": {
            "en": "<font color='blue'><b>Optional values:</b></font><br>[PostPaid: <font color='green'>Pay as you go.</font>]<br> [PrePaid: <font color='green'>Prepaid, monthly subscription.</font>]",
              // <font color='blue'><b>オプション値:</b></font><br>[PostPaid: <font color='green'>従量課金。</font>]<br> [PrePaid: <font color='green'>前払い、月額サブスクリプション。</font>]
          },
          "AllowedValues": [
            "PostPaid",
            "PrePaid"
          ],
          "Default": "PostPaid"
        },
        "KeyPairName": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::KeyPair::KeyPairName",
          "Label": {
            "en": "Key Pair Name",
             // キーペア名
          },
          "Description": {
            "en": "If it is a Windows ECS instance, ignore this parameter. The default is blank.<br>If you have filled in <font color='green'>key pair name</font>, <font color='green'>instance password< The content of /font> will still be set in the instance, but the password login method in the Linux system will be forbidden.<br><font color='red'>Please enter the name of the existing key pair. If you use the instance password Login, the key pair name does not need to be filled in.</font>",
                 // Windows ECS インスタンスの場合は、このパラメーターを無視してください。デフォルトは空白です。<br><font color='green'>キーペア名</font>を入力した場合、<font color='green'>インスタンスパスワード</font> の内容はインスタンスに設定されますが、Linux システムでのパスワードログイン方法は禁止されます。<br><font color='red'>既存のキーペアの名前を入力してください。インスタンスパスワードログインを使用する場合は、キーペア名を入力する必要はありません。</font>
          },
          "Default": null
        }
      },
      "Metadata": {
        "ALIYUN::ROS::Interface": {
          "ParameterGroups": [
            {
              "Parameters": [
                "VPC",
                "VSwitch",
                "SecurityGroup"
              ],
              "Label": {
                "default": "VPC "
              }
            },
            {
              "Parameters": [
                "ECSInstanceType",
                "ECSDiskCategory",
                "InstanceChargeType",
                "KeyPairName"
              ],
              "Label": {
                "default": "ECS"
              }
            }
          ],
          "TemplateTags": [
            "Specify the image Id and snapshot to create ECS instance." // イメージ ID とスナップショットを指定して ECS インスタンスを作成します。
          ]
        }
      },
      "Resources": {
        "ECSInstanceGroup": {
          "Type": "ALIYUN::ECS::InstanceGroup",
          "Properties": {
            "IoOptimized": "optimized",
            "InstanceChargeType": {
              "Ref": "InstanceChargeType"
            },
            "SystemDisk_Category": {
              "Ref": "ECSDiskCategory"
            },
            "SecurityGroupId": {
              "Ref": "SecurityGroup"
            },
            "VSwitchId": {
              "Ref": "VSwitch"
            },
            "MaxAmount": 1,
            "SystemDisk_Size": 40,
            "VpcId": {
              "Ref": "VPC"
            },
            "ImageId": "ubuntu_14",
            "InstanceType": {
              "Ref": "ECSInstanceType"
            },
            "AllocatePublicIP": "false",
            "Password": "Admin@123!",
            "KeyPairName": {
              "Ref": "KeyPairName"
            }
          }
        },
        "ElasticIp": {
          "Type": "ALIYUN::VPC::EIP",
          "Properties": {
            "Bandwidth": 5,
            "InternetChargeType": "PayByTraffic"
          }
        },
        "ElasticIpAssociation": {
          "Type": "ALIYUN::VPC::EIPAssociation",
          "Properties": {
            "InstanceId": {
              "Fn::Select": [
                0,
                {
                  "Fn::GetAtt": [
                    "ECSInstanceGroup",
                    "InstanceIds"
                  ]
                }
              ]
            },
            "AllocationId": {
              "Ref": "ElasticIp"
            }
          }
        }
      },
      "Outputs": {
        "VpcId": {
          "Description": "VPC Id", // VPC ID
          "Value": {
            "Ref": "VPC"
          }
        },
        "SecurityGroupId": {
          "Description": "Security Group Id", // セキュリティグループ ID
          "Value": {
            "Ref": "SecurityGroup"
          }
        },
        "VSwitchId": {
          "Description": "VSwitch Id", // VSwitch ID
          "Value": {
            "Ref": "VSwitch"
          }
        },
        "EipAddress": {
          "Description": "IP address of created EIP.", // 作成された EIP の IP アドレス。
          "Value": {
            "Fn::GetAtt": [
              "ElasticIp",
              "EipAddress"
            ]
          }
        }
      }
    }