Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::GA::ResourceAttachment

Última atualização: Jul 20, 2026

O recurso ALIYUN::GA::ResourceAttachment associa recursos a uma instância do Global Accelerator.

Sintaxe

{
  "Type": "ALIYUN::GA::ResourceAttachment",
  "Properties": {
    "AssociatedResourceRegionId": String,
    "AssociatedResourceId": String,
    "AssociatedResourceType": String,
    "AcceleratorId": String,
    "AssociatedMode": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrições

AcceleratorId

String

Sim

Não

ID da instância do Global Accelerator (GA).

Nenhuma

AssociatedResourceId

String

Sim

Não

ID do recurso para associação.

Nenhuma

AssociatedResourceRegionId

String

Sim

Não

ID da região do recurso para associação.

Nenhuma

AssociatedResourceType

String

Sim

Não

Tipo do recurso para associação.

Valores válidos:

  • WAF

AssociatedMode

String

Não

Não

Modo de associação.

Valores válidos:

  • Associated

  • Managed

Valores de retorno

Fn::GetAtt

Nenhum

Exemplos

Cenário 1: Associar uma instância WAF existente a uma instância do Global Accelerator

ROSTemplateFormatVersion: '2015-09-01'
Description:
  en: Associate an existing WAF instance with a Global Accelerator instance (association mode) for GA traffic security inspection.
Parameters:
  AcceleratorId:
    Type: String
    Label: GA Instance ID
    Description: The ID of the created Global Accelerator instance.
  WafInstanceId:
    Type: String
    Label: WAF Instance ID
    Description: The ID of the created Web Application Firewall (WAF) instance. WAF instances only support the China East 1 (Hangzhou) region.
  WafRegion:
    Type: String
    Label: WAF Instance Region
    Description: The region ID where the WAF instance resides. Only cn-hangzhou is supported.
    Default: cn-hangzhou
Resources:
  WafAttachment:
    Type: ALIYUN::GA::ResourceAttachment
    Properties:
      AcceleratorId:
        Ref: AcceleratorId
      AssociatedResourceId:
        Ref: WafInstanceId
      AssociatedResourceRegionId:
        Ref: WafRegion
      AssociatedResourceType: WAF
      AssociatedMode: Associated
Outputs:
  AcceleratorId:
    Description: The ID of the Global Accelerator instance associated with WAF.
    Value:
      Ref: AcceleratorId
  WafInstanceId:
    Description: The ID of the associated WAF instance.
    Value:
      Ref: WafInstanceId
  AssociatedResourceType:
    Description: The type of the associated resource.
    Value: WAF
  AssociatedMode:
    Description: The association mode.
    Value: Associated
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "en": "Associate an existing WAF instance with a Global Accelerator instance (association mode) for GA traffic security inspection."
  },
  "Parameters": {
    "AcceleratorId": {
      "Type": "String",
      "Label": "GA Instance ID",
      "Description": "The ID of the created Global Accelerator instance."
    },
    "WafInstanceId": {
      "Type": "String",
      "Label": "WAF Instance ID",
      "Description": "The ID of the created Web Application Firewall (WAF) instance. WAF instances only support the China East 1 (Hangzhou) region."
    },
    "WafRegion": {
      "Type": "String",
      "Label": "WAF Instance Region",
      "Description": "The region ID where the WAF instance resides. Only cn-hangzhou is supported.",
      "Default": "cn-hangzhou"
    }
  },
  "Resources": {
    "WafAttachment": {
      "Type": "ALIYUN::GA::ResourceAttachment",
      "Properties": {
        "AcceleratorId": { "Ref": "AcceleratorId" },
        "AssociatedResourceId": { "Ref": "WafInstanceId" },
        "AssociatedResourceRegionId": { "Ref": "WafRegion" },
        "AssociatedResourceType": "WAF",
        "AssociatedMode": "Associated"
      }
    }
  },
  "Outputs": {
    "AcceleratorId": {
      "Description": "The ID of the Global Accelerator instance associated with WAF.",
      "Value": { "Ref": "AcceleratorId" }
    },
    "WafInstanceId": {
      "Description": "The ID of the associated WAF instance.",
      "Value": { "Ref": "WafInstanceId" }
    },
    "AssociatedResourceType": {
      "Description": "The type of the associated resource.",
      "Value": "WAF"
    },
    "AssociatedMode": {
      "Description": "The association mode.",
      "Value": "Associated"
    }
  }
}

Cenário 2: Criar uma instância do Global Accelerator e uma instância do WAF 2.0 e associá-las para estabelecer aceleração e proteção ponta a ponta com GA+WAF

ROSTemplateFormatVersion: '2015-09-01'
Description:
  en: Create a Global Accelerator instance and a WAF 2.0 instance, associate WAF with the GA instance for traffic security inspection, for end-to-end GA+WAF acceleration and protection.
Parameters:
  AcceleratorName:
    Type: String
    Label: GA Instance Name
    Description: The name of the Global Accelerator instance.
    Default: ga-waf-demo
  Spec:
    Type: String
    Label: GA Instance Spec
    Description: The specification of the Global Accelerator instance, such as Small_1, Small_2, Middle_1, etc.
    Default: Small_1
  PackageCode:
    Type: String
    Label: WAF Package Version
    Description: The package version of the WAF 2.0 instance.
    AllowedValues:
      - version_basic_advanced
      - version_3
      - version_4
      - version_5
      - version_exclusive_cluster
    Default: version_3
  Period:
    Type: String
    Label: WAF Prepaid Period
    Description: The prepaid period for the WAF instance, in months.
    AllowedValues:
      - '1'
      - '3'
      - '6'
      - '12'
      - '24'
      - '36'
    Default: '12'
  ExtBandwidth:
    Type: String
    Label: WAF Bandwidth Extension Package
    Description: The WAF bandwidth extension package, in Mbps. Valid values: 0 to 20000.
    Default: '50'
  LogStorage:
    Type: String
    Label: WAF Log Storage Capacity
    Description: The WAF log storage capacity, in TiB.
    AllowedValues:
      - '3'
      - '5'
      - '10'
      - '20'
      - '50'
      - '100'
    Default: '3'
  LogTime:
    Type: String
    Label: WAF Log Retention Period
    Description: The WAF log retention period, in days.
    AllowedValues:
      - '180'
      - '360'
    Default: '180'
  WafLog:
    Type: String
    Label: Enable WAF Log Service
    Description: Specifies whether to enable the WAF log service.
    AllowedValues:
      - 'true'
      - 'false'
    Default: 'true'
  AssociatedMode:
    Type: String
    Label: Association Mode
    Description: 'The association mode. Associated: association mode; Managed: managed mode, where GA uniformly manages WAF.'
    AllowedValues:
      - Associated
      - Managed
    Default: Associated
Resources:
  Accelerator:
    Type: ALIYUN::GA::Accelerator
    Properties:
      AcceleratorName:
        Ref: AcceleratorName
      Spec:
        Ref: Spec
      InstanceChargeType: PostPaid
  WafInstance:
    Type: ALIYUN::WAF::Instance
    Properties:
      PackageCode:
        Ref: PackageCode
      SubscriptionType: Subscription
      Period:
        Ref: Period
      ExtBandwidth:
        Ref: ExtBandwidth
      ExtDomainPackage: '0'
      ExclusiveIpPackage: '0'
      LogStorage:
        Ref: LogStorage
      LogTime:
        Ref: LogTime
      WafLog:
        Ref: WafLog
      BigScreen: '0'
      PrefessionalService: 'false'
      RenewalStatus: ManualRenewal
  WafAttachment:
    Type: ALIYUN::GA::ResourceAttachment
    Properties:
      AcceleratorId:
        Fn::GetAtt:
          - Accelerator
          - AcceleratorId
      AssociatedResourceId:
        Fn::GetAtt:
          - WafInstance
          - InstanceId
      AssociatedResourceRegionId: cn-hangzhou
      AssociatedResourceType: WAF
      AssociatedMode:
        Ref: AssociatedMode
    DependsOn:
      - Accelerator
      - WafInstance
Outputs:
  AcceleratorId:
    Description: The ID of the Global Accelerator instance.
    Value:
      Fn::GetAtt:
        - Accelerator
        - AcceleratorId
  AcceleratorCname:
    Description: The CNAME acceleration domain name of the Global Accelerator instance.
    Value:
      Fn::GetAtt:
        - Accelerator
        - DnsName
  WafInstanceId:
    Description: The ID of the associated WAF 2.0 instance.
    Value:
      Fn::GetAtt:
        - WafInstance
        - InstanceId
  AssociatedMode:
    Description: The association mode.
    Value:
      Ref: AssociatedMode
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "en": "Create a Global Accelerator instance and a WAF 2.0 instance, associate WAF with the GA instance for traffic security inspection, for end-to-end GA+WAF acceleration and protection."
  },
  "Parameters": {
    "AcceleratorName": {
      "Type": "String",
      "Label": "GA Instance Name",
      "Description": "The name of the Global Accelerator instance.",
      "Default": "ga-waf-demo"
    },
    "Spec": {
      "Type": "String",
      "Label": "GA Instance Spec",
      "Description": "The specification of the Global Accelerator instance, such as Small_1, Small_2, Middle_1, etc.",
      "Default": "Small_1"
    },
    "PackageCode": {
      "Type": "String",
      "Label": "WAF Package Version",
      "Description": "The package version of the WAF 2.0 instance.",
      "AllowedValues": ["version_basic_advanced", "version_3", "version_4", "version_5", "version_exclusive_cluster"],
      "Default": "version_3"
    },
    "Period": {
      "Type": "String",
      "Label": "WAF Prepaid Period",
      "Description": "The prepaid period for the WAF instance, in months.",
      "AllowedValues": ["1", "3", "6", "12", "24", "36"],
      "Default": "12"
    },
    "ExtBandwidth": {
      "Type": "String",
      "Label": "WAF Bandwidth Extension Package",
      "Description": "The WAF bandwidth extension package, in Mbps. Valid values: 0 to 20000.",
      "Default": "50"
    },
    "LogStorage": {
      "Type": "String",
      "Label": "WAF Log Storage Capacity",
      "Description": "The WAF log storage capacity, in TiB.",
      "AllowedValues": ["3", "5", "10", "20", "50", "100"],
      "Default": "3"
    },
    "LogTime": {
      "Type": "String",
      "Label": "WAF Log Retention Period",
      "Description": "The WAF log retention period, in days.",
      "AllowedValues": ["180", "360"],
      "Default": "180"
    },
    "WafLog": {
      "Type": "String",
      "Label": "Enable WAF Log Service",
      "Description": "Specifies whether to enable the WAF log service.",
      "AllowedValues": ["true", "false"],
      "Default": "true"
    },
    "AssociatedMode": {
      "Type": "String",
      "Label": "Association Mode",
      "Description": "The association mode. Associated: association mode; Managed: managed mode, where GA uniformly manages WAF.",
      "AllowedValues": ["Associated", "Managed"],
      "Default": "Associated"
    }
  },
  "Resources": {
    "Accelerator": {
      "Type": "ALIYUN::GA::Accelerator",
      "Properties": {
        "AcceleratorName": { "Ref": "AcceleratorName" },
        "Spec": { "Ref": "Spec" },
        "InstanceChargeType": "PostPaid"
      }
    },
    "WafInstance": {
      "Type": "ALIYUN::WAF::Instance",
      "Properties": {
        "PackageCode": { "Ref": "PackageCode" },
        "SubscriptionType": "Subscription",
        "Period": { "Ref": "Period" },
        "ExtBandwidth": { "Ref": "ExtBandwidth" },
        "ExtDomainPackage": "0",
        "ExclusiveIpPackage": "0",
        "LogStorage": { "Ref": "LogStorage" },
        "LogTime": { "Ref": "LogTime" },
        "WafLog": { "Ref": "WafLog" },
        "BigScreen": "0",
        "PrefessionalService": "false",
        "RenewalStatus": "ManualRenewal"
      }
    },
    "WafAttachment": {
      "Type": "ALIYUN::GA::ResourceAttachment",
      "Properties": {
        "AcceleratorId": { "Fn::GetAtt": ["Accelerator", "AcceleratorId"] },
        "AssociatedResourceId": { "Fn::GetAtt": ["WafInstance", "InstanceId"] },
        "AssociatedResourceRegionId": "cn-hangzhou",
        "AssociatedResourceType": "WAF",
        "AssociatedMode": { "Ref": "AssociatedMode" }
      },
      "DependsOn": ["Accelerator", "WafInstance"]
    }
  },
  "Outputs": {
    "AcceleratorId": {
      "Description": "The ID of the Global Accelerator instance.",
      "Value": { "Fn::GetAtt": ["Accelerator", "AcceleratorId"] }
    },
    "AcceleratorCname": {
      "Description": "The CNAME acceleration domain name of the Global Accelerator instance.",
      "Value": { "Fn::GetAtt": ["Accelerator", "DnsName"] }
    },
    "WafInstanceId": {
      "Description": "The ID of the associated WAF 2.0 instance.",
      "Value": { "Fn::GetAtt": ["WafInstance", "InstanceId"] }
    },
    "AssociatedMode": {
      "Description": "The association mode.",
      "Value": { "Ref": "AssociatedMode" }
    }
  }
}