ALIYUN::ROS::CustomResource is used to create a custom resource.

Syntax

{
  "Type": "ALIYUN::ROS::CustomResource",
  "Properties": {
    "ServiceToken": String,
    "Timeout": Number,
    "Parameters": Map
  }
}

Properties

Name Type Required Editable Description Validity
ServiceToken String Yes No The service token that is given to the template developer by the service provider to access the service. The service token can be a Function Compute function, a MNS topic, a MNS queue, or an HTTP or HTTPS URL. Service token types and sample values:
  • Function Compute function: acs:fc:<region_id>:<account_id>:services/<service_name>/functions/<function_name>
  • MNS queue: acs:mns:<region_id>:<account_id>:queues/<queue_name>
  • MNS topic: acs:mns:<region_id>:<account_id>:topics/<topic_name>
  • HTTP or HTTPS URL: web[options]:<url>

    options is an optional parameter that can be set to sync and/or idempotent. When the preceding two values are combined, they must be separated a comma (,).

Timeout Number No Yes The time to wait before the service provider responds. Unit: seconds.
  • When ServiceToken is used to make an asynchronous HTTP or HTTPS request or access a Function Compute function, MNS topic, or MNS queue, Timeout is set to 60 by default.
  • When ServiceToken is used to make a synchronous HTTP or HTTPS request, Timeout is set to 10 by default.
Parameters Map No Yes The parameters to be passed to the service provider. None

Response parameters

Fn::GetAtt

  • Outputs: the data received from the service provider (user), in Map format.
  • *: uses the key in Outputs as the specific value.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "CustomResource": {
      "Type": "ALIYUN::ROS::CustomResource",
      "Properties": {
        "ServiceToken": {
          "Ref": "ServiceToken"
        },
        "Parameters": {
          "Ref": "Parameters"
        },
        "Timeout": {
          "Ref": "Timeout"
        }
      }
    }
  },
  "Parameters": {
    "ServiceToken": {
      "Type": "String",
      "Description": "The service token that was given to the template developer by the service provider to access the service.Allowed values:- Function Compute: acs:fc:<region_id>:<account_id>:services/<service_name>/functions/<function_name>- MNS Queue: acs:mns:<region_id>:<account_id>:queues/<queue_name>- MNS Topic: acs:mns:<region_id>:<account_id>:topics/<topic_name>- HTTP&HTTPS: web[options]:<url>  Two options are supported:  - sync: sync HTTP&HTTPS request.  - idempotent: indicates that the Create request is idempotent. Update and Delete requests should be always idempotent.Examples:  - acs:fc:cn-hangzhou:123456789:services/test-service/functions/test-function  - acs:mns:cn-hangzhou:123456789:queues/test-queue  - acs:mns:cn-hangzhou:123456789:topics/test-topic  - web:https://abc.com  - web[sync]:http://abc.com  - web[sync,idempotent]:https://abc.com",
      "MaxLength": 512
    },
    "Parameters": {
      "Type": "Json",
      "Description": "Parameters to be passed to service provider."
    },
    "Timeout": {
      "Default": 60,
      "Type": "Number",
      "Description": "Timeout seconds before service provider responses.It takes effects only if the type of ServiceToken is Function Compute, MNS Queue, MNS Topic or async HTTP&HTTPS request.Timeout seconds are always 10 for sync HTTP&HTTPS request.",
      "MaxValue": 43200,
      "MinValue": 1
    }
  },
  "Outputs": {
    "Outputs": {
      "Description": "Output data received from service provider.",
      "Value": {
        "Fn::GetAtt": [
          "CustomResource",
          "Outputs"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  CustomResource:
    Type: ALIYUN::ROS::CustomResource
    Properties:
      ServiceToken:
        Ref: ServiceToken
      Parameters:
        Ref: Parameters
      Timeout:
        Ref: Timeout
Parameters:
  ServiceToken:
    Type: String
    Description: 'The service token that was given to the template developer by the
      service provider to access the service.Allowed values:- Function Compute: acs:fc:<region_id>:<account_id>:services/<service_name>/functions/<function_name>-
      MNS Queue: acs:mns:<region_id>:<account_id>:queues/<queue_name>- MNS Topic:
      acs:mns:<region_id>:<account_id>:topics/<topic_name>- HTTP&HTTPS: web[options]:<url>  Two
      options are supported:  - sync: sync HTTP&HTTPS request.  - idempotent: indicates
      that the Create request is idempotent. Update and Delete requests should be
      always idempotent.Examples:  - acs:fc:cn-hangzhou:123456789:services/test-service/functions/test-function  -
      acs:mns:cn-hangzhou:123456789:queues/test-queue  - acs:mns:cn-hangzhou:123456789:topics/test-topic  -
      web:https://abc.com  - web[sync]:http://abc.com  - web[sync,idempotent]:https://abc.com'
    MaxLength: 512
  Parameters:
    Type: Json
    Description: Parameters to be passed to service provider.
  Timeout:
    Default: 60
    Type: Number
    Description: Timeout seconds before service provider responses.It takes effects
      only if the type of ServiceToken is Function Compute, MNS Queue, MNS Topic or
      async HTTP&HTTPS request.Timeout seconds are always 10 for sync HTTP&HTTPS request.
    MaxValue: 43200
    MinValue: 1
Outputs:
  Outputs:
    Description: Output data received from service provider.
    Value:
      Fn::GetAtt:
      - CustomResource
      - Outputs