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

Edge Security Acceleration:ROSを使用したリソース統合

最終更新日:Oct 21, 2024

Resource Orchestration Service (ROS) を使用して、Dynamic Content Delivery Network (DCDN) のAPI操作を呼び出すことができます。 このトピックでは、Resource Orchestration Serviceテンプレートを作成し、そのテンプレートを使用してDCDNにドメイン名を自動的に追加する方法について説明します。

ROS

  • ROSは、クラウドコンピューティングリソースの管理を簡素化するAlibaba Cloudサービスです。 Elastic Compute Service (ECS) やApsaraDB RDSインスタンスなど、使用するクラウドコンピューティングリソース、およびリソース間の関係を記述するテンプレートを作成できます。 ROSは、テンプレートに基づいてすべてのリソースを自動的に作成および構成し、自動デプロイとO&Mを実装します。詳細については、「」をご参照ください。ROSとは何ですか?.

  • ROSによるリソース統合の

  • ROSを使用してDCDN APIを呼び出すことができます。 ROSを使用して調整できるのは通常のリソースのみです。

権限

この例では、DCDNにドメイン名を追加する必要があります。 デフォルトでは、Resource Orchestration ServiceはROSコンソールにログインしたユーザーの資格情報を使用します。 ユーザーには、次の権限を付与する必要があります。

  • AliyunDCDNFullAccess: RAMユーザーにDCDNリソースを管理する権限を付与します。

Alibaba Cloudアカウントには、すべてのAPI操作に対する権限があります。 Alibaba Cloudアカウントを使用してAPI操作を呼び出すと、セキュリティリスクが発生する可能性があります。 RAMユーザーとしてAPI操作を呼び出すか、ルーチンのO&Mを実行することを強くお勧めします。 RAMユーザーとしてAPI操作を呼び出す前に、ビジネス要件に基づいて必要な権限をRAMユーザーに付与します。 RAMユーザーには、DCDNリソースを管理する権限が必要です。 詳細については、「DCDNのシステムポリシー」をご参照ください。

手順

  1. ROSコンソールにログインします。 上部のナビゲーションバーで、リージョンを選択します。

  2. 左側のナビゲーションペインで、[スタック] をクリックします。 [スタック] ページで、[スタックの作成] > [ROSを使用] を選択します。

    • テンプレートの指定: [既存のテンプレートの選択] を選択します。

    • テンプレートインポート方法: [テンプレートコンテンツの入力] を選択します。

  3. テンプレートの内容: [ROS] を選択し、コードを入力します。

    DCDNにドメイン名を追加する構文、説明、および例の詳細については、「ALIYUN::DCDN:: domain」をご参照ください。

    YAML形式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      CheckUrl:
        Description: ''
        Type: String
      DomainName:
        Description: 'The name of the accelerated domain. You can specify only one domain
          name.  Wildcard domain names are supported. Wildcard domain names must start
          with a period (.). Example: .a.com.'
        Type: String
      ResourceGroupId:
        Description: The ID of the resource group. If you do not specify this parameter,
          the system automatically uses the ID of the default resource group.
        Type: String
      SSLPub:
        Description: Indicates the public key of the certificate if the HTTPS protocol
          is enabled.
        Type: String
      Scope:
        Description: 'The region where your accelerated service is deployed. Valid values:  domestic
          (default): mainland China. overseas: outside mainland China. global: all countries
          in the world.'
        Type: String
      Sources:
        Description: The origin information.
        Type: Json
      TopLevelDomain:
        Description: ''
        Type: String
    Resources:
      DCDNDomain:
        Properties:
          CheckUrl:
            Ref: CheckUrl
          DomainName:
            Ref: DomainName
          ResourceGroupId:
            Ref: ResourceGroupId
          Scope:
            Ref: Scope
          Sources:
            Ref: Sources
          TopLevelDomain:
            Ref: TopLevelDomain
        Type: ALIYUN::DCDN::Domain
    Outputs:
      CertName:
        Description: The name of the certificate.
        Value:
          Fn::GetAtt:
          - DCDNDomain
          - CertName
      Cname:
        Description: The canonical name (CNAME) of the accelerated domain.
        Value:
          Fn::GetAtt:
          - DCDNDomain
          - Cname
      Description:
        Description: The reason that causes the review failure.
        Value:
          Fn::GetAtt:
          - DCDNDomain
          - Description
      DomainName:
        Description: 'The name of the accelerated domain. You can specify only one domain
          name.  Wildcard domain names are supported. Wildcard domain names must start
          with a period (.). Example: .a.com.'
        Value:
          Fn::GetAtt:
          - DCDNDomain
          - DomainName
      ResourceGroupId:
        Description: The ID of the resource group. If you do not specify this parameter,
          the system automatically uses the ID of the default resource group.
        Value:
          Fn::GetAtt:
          - DCDNDomain
          - ResourceGroupId
      SSLProtocol:
        Description: 'Indicates whether the SSL certificate is enabled. Valid values:  on:
          enabled off: disabled'
        Value:
          Fn::GetAtt:
          - DCDNDomain
          - SSLProtocol
      SSLPub:
        Description: Indicates the public key of the certificate if the HTTPS protocol
          is enabled.
        Value:
          Fn::GetAtt:
          - DCDNDomain
          - SSLPub
      Scope:
        Description: 'The region where your accelerated service is deployed. Valid values:  domestic
          (default): mainland China. overseas: outside mainland China. global: all countries
          in the world.'
        Value:
          Fn::GetAtt:
          - DCDNDomain
          - Scope
      Sources:
        Description: The origin information.
        Value:
          Fn::GetAtt:
          - DCDNDomain
          - Sources

    JSON 形式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "Status": {
          "Type": "String",
          "Description": "The status of the accelerated domain.  online: The domain is enabled. offline: The domain is disabled. configuring: The domain is being configured. configure_failed: The domain configuration failed. checking: The domain is under review. check_failed: The domain failed the review."
        },
        "SecurityToken": {
          "Type": "String",
          "Description": ""
        },
        "CheckUrl": {
          "Type": "String",
          "Description": ""
        },
        "ResourceGroupId": {
          "Type": "String",
          "Description": "The ID of the resource group. If you do not specify this parameter, the system automatically uses the ID of the default resource group."
        },
        "Scope": {
          "Type": "String",
          "Description": "The region where your accelerated service is deployed. Valid values:  domestic (default): mainland China. overseas: outside mainland China. global: all countries in the world."
        },
        "DomainName": {
          "Type": "String",
          "Description": "The name of the accelerated domain. You can specify only one domain name.  Wildcard domain names are supported. Wildcard domain names must start with a period (.). Example: .a.com."
        },
        "TopLevelDomain": {
          "Type": "String",
          "Description": ""
        },
        "Sources": {
          "Type": "Json",
          "Description": "The origin information."
        }
      },
      "Resources": {
        "DCDNDomain": {
          "Type": "ALIYUN::DCDN::Domain",
          "Properties": {
            "SecurityToken": {
              "Ref": "SecurityToken"
            },
            "CheckUrl": {
              "Ref": "CheckUrl"
            },
            "ResourceGroupId": {
              "Ref": "ResourceGroupId"
            },
            "Scope": {
              "Ref": "Scope"
            },
            "DomainName": {
              "Ref": "DomainName"
            },
            "SSLPub": {
              "Ref": "SSLPub"
            },
            "CertName": {
              "Ref": "CertName"
            },
            "TopLevelDomain": {
              "Ref": "TopLevelDomain"
            },
            "Sources": {
              "Ref": "Sources"
            }
          }
        }
      },
      "Outputs": {
        "Description": {
          "Description": "The reason that causes the review failure.",
          "Value": {
            "Fn::GetAtt": [
              "DCDNDomain",
              "Description"
            ]
          }
        },
        "ResourceGroupId": {
          "Description": "The ID of the resource group. If you do not specify this parameter, the system automatically uses the ID of the default resource group.",
          "Value": {
            "Fn::GetAtt": [
              "DCDNDomain",
              "ResourceGroupId"
            ]
          }
        },
        "Scope": {
          "Description": "The region where your accelerated service is deployed. Valid values:  domestic (default): mainland China. overseas: outside mainland China. global: all countries in the world.",
          "Value": {
            "Fn::GetAtt": [
              "DCDNDomain",
              "Scope"
            ]
          }
        },
        "DomainName": {
          "Description": "The name of the accelerated domain. You can specify only one domain name.  Wildcard domain names are supported. Wildcard domain names must start with a period (.). Example: .a.com.",
          "Value": {
            "Fn::GetAtt": [
              "DCDNDomain",
              "DomainName"
            ]
          }
        },
        "SSLPub": {
          "Description": "Indicates the public key of the certificate if the HTTPS protocol is enabled.",
          "Value": {
            "Fn::GetAtt": [
              "DCDNDomain",
              "SSLPub"
            ]
          }
        },
        "CertName": {
          "Description": "The name of the certificate.",
          "Value": {
            "Fn::GetAtt": [
              "DCDNDomain",
              "CertName"
            ]
          }
        },
        "Cname": {
          "Description": "The canonical name (CNAME) of the accelerated domain.",
          "Value": {
            "Fn::GetAtt": [
              "DCDNDomain",
              "Cname"
            ]
          }
        },
        "Sources": {
          "Description": "The origin information.",
          "Value": {
            "Fn::GetAtt": [
              "DCDNDomain",
              "Sources"
            ]
          }
        },
        "SSLProtocol": {
          "Description": "Indicates whether the SSL certificate is enabled. Valid values:  on: enabled off: disabled",
          "Value": {
            "Fn::GetAtt": [
              "DCDNDomain",
              "SSLProtocol"
            ]
          }
        }
      }
    }
  4. [作成] をクリックし、作成したスタックを実行します。

  5. スタックが作成されたら、API操作を呼び出すか、SDKを使用するか、DCDNコンソールにログインしてドメイン名を表示します。

    p826771