All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::GA::ResourceAttachment

Last Updated:Jul 20, 2026

ALIYUN::GA::ResourceAttachment is used to associate resources with a Global Accelerator instance.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraints

AcceleratorId

String

Yes

No

The ID of the Global Accelerator (GA) instance.

None

AssociatedResourceId

String

Yes

No

The ID of the resource to associate.

None

AssociatedResourceRegionId

String

Yes

No

The region ID of the resource to associate.

None

AssociatedResourceType

String

Yes

No

The type of the resource to associate.

Valid values:

  • WAF

AssociatedMode

String

No

No

The association mode.

Valid values:

  • Associated

  • Managed

Return values

Fn::GetAtt

None

Examples

Scenario 1: Associate an existing WAF instance with a Global Accelerator instance

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"
    }
  }
}

Scenario 2: Create a Global Accelerator instance and a WAF 2.0 instance, and associate them to build end-to-end GA+WAF acceleration and protection.

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" }
    }
  }
}