All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ENS::InstanceSecurityGroupAttachment

更新時間:Apr 19, 2024

ALIYUN::ENS::InstanceSecurityGroupAttachment is used to add an Edge Node Service (ENS) instance to a security group.

Syntax

{
  "Type": "ALIYUN::ENS::InstanceSecurityGroupAttachment",
  "Properties": {
    "InstanceId": String,
    "SecurityGroupId": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

InstanceId

String

No

No

The instance ID.

None.

SecurityGroupId

String

Yes

No

The ID of the security group.

None.

Return values

Fn::GetAtt

  • InstanceId: the instance ID.

  • SecurityGroupId: the ID of the security group.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      InstanceId:
        Description:
          en: Instance ID.
        Required: false
        Type: String
      SecurityGroupId:
        AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
        AssociationPropertyMetadata:
          VpcId: ${VpcId}
        Description:
          en: Security group ID.
        Required: true
        Type: String
    Resources:
      ExtensionResource:
        Properties:
          InstanceId:
            Ref: InstanceId
          SecurityGroupId:
            Ref: SecurityGroupId
        Type: ALIYUN::ENS::InstanceSecurityGroupAttachment
    Outputs:
      InstanceId:
        Description: Instance ID.
        Value:
          Fn::GetAtt:
          - ExtensionResource
          - InstanceId
      SecurityGroupId:
        Description: Security group ID.
        Value:
          Fn::GetAtt:
          - ExtensionResource
          - SecurityGroupId
                            
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "InstanceId": {
          "Type": "String",
          "Description": {
            "en": "Instance ID."
          },
          "Required": false
        },
        "SecurityGroupId": {
          "AssociationPropertyMetadata": {
            "VpcId": "${VpcId}"
          },
          "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
          "Type": "String",
          "Description": {
            "en": "Security group ID."
          },
          "Required": true
        }
      },
      "Resources": {
        "ExtensionResource": {
          "Type": "ALIYUN::ENS::InstanceSecurityGroupAttachment",
          "Properties": {
            "InstanceId": {
              "Ref": "InstanceId"
            },
            "SecurityGroupId": {
              "Ref": "SecurityGroupId"
            }
          }
        }
      },
      "Outputs": {
        "InstanceId": {
          "Description": "Instance ID.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "InstanceId"
            ]
          }
        },
        "SecurityGroupId": {
          "Description": "Security group ID.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "SecurityGroupId"
            ]
          }
        }
      }
    }