All Products
Search
Document Center

Resource Orchestration Service:Create

Last Updated:Jul 19, 2024

When the template developer creates a stack that contains a custom resource, Resource Orchestration Service (ROS) sends a request to the custom resource provider. The RequestType field in the request is set to Create.

Request

A Create request contains the following fields:

  • RequestType

    This field is set to Create.

  • ResponseURL

    The presigned public URL. The URL receives responses from the custom resource provider to ROS.

  • IntranetResponseURL

    The presigned internal URL. You can use this URL in Elastic Compute Service (ECS). The URL receives responses from the custom resource provider to ROS.

  • StackId

    The ID of the stack that contains the custom resource.

  • StackName

    The name of the stack that contains the custom resource.

  • ResourceOwnerId

    The ID of the Alibaba Cloud account to which the stack with the custom resource belongs.

  • CallerId

    The ID of the Alibaba Cloud account or Resource Access Management (RAM) user that is used to perform this operation.

  • RegionId

    The region ID of the stack that contains the custom resource.

  • RequestId

    The unique ID of the request.

  • ResourceType

    The resource type selected by the template developer for the custom resource in the template. The name of the custom resource type can be up to 68 characters in length and can contain letters, digits, underscores (_), at signs (@), and hyphens (-).

  • LogicalResourceId

    The name (logical ID) specified by the template developer for the custom resource in the template.

  • ResourceProperties

    This field contains the parameters in the Properties section of the request sent by the template developer. The content is defined by the custom resource provider.

Example:

{
   "RequestType" : "Create",
   "RequestId" : "unique id for this create request",
   "ResponseURL" : "pre-signed-url-for-create-response",
   "IntranetResponseURL" : "pre-signed-intranet-url-for-create-response",
   "ResourceType" : "Custom::MyCustomResourceType",
   "LogicalResourceId" : "name of resource in template",
   "StackId" : "stack id",
   "StackName" : "stack name",
   "ResourceOwnerId": "resource owner id",
   "CallerId": "caller id",
   "RegionId": "region id",
   "ResourceProperties" : {
      "key1" : "string",
      "key2" : [ "list" ],
      "key3" : { "key4" : "map" }
   }
}

Responses

Success

When the Create request is sent, the custom resource provider must send a response that contains the following fields to ROS:

  • Status

    Only SUCCESS is returned.

  • RequestId

    The unique ID of the request. This response value must be copied from the request.

  • LogicalResourceId

    The name (logical ID) specified by the template developer for the custom resource in the template. This response value must be copied from the request.

  • StackId

    The ID of the stack that contains the custom resource. This response value must be copied from the request.

  • PhysicalResourceId

    This value must be unique to the custom resource provider. The value can be up to 255 bytes in length. The value cannot be an empty string and must be identical for the same resource in all responses.

  • Data

    Optional. The name-value pairs to be sent in the response. You can use the Fn::GetAtt function to access the values provided here by name in the template.

Example:

{
   "Status" : "SUCCESS",
   "RequestId" : "unique id for this create request (copied from request)",
   "LogicalResourceId" : "name of resource in template (copied from request)",
   "StackId" : "stack id (copied from request)",
   "PhysicalResourceId" : "required vendor-defined physical id that is unique for that vendor",
   "Data" : {
      "keyThatCanBeUsedInGetAtt1" : "data for key 1",
      "keyThatCanBeUsedInGetAtt2" : "data for key 2"
   }
}

Failed

When the Create request fails, the custom resource provider must send a response that contains the following fields to ROS:

  • Status

    Only FAILED is returned.

  • Reason

    The reason for the response failure.

  • RequestId

    The unique ID of the request. This response value must be copied from the request.

  • LogicalResourceId

    The name (logical ID) specified by the template developer for the custom resource in the template. This response value must be copied from the request.

  • StackId

    The ID of the stack that contains the custom resource. This response value must be copied from the request.

Example:

{
   "Status" : "FAILED",
   "Reason" : "Required failure reason string",
   "RequestId" : "unique id for this create request (copied from request)",
   "LogicalResourceId" : "name of resource in template (copied from request)",
   "StackId" : "stack id (copied from request)"
}