When you create a stack that contains a custom resource, Resource Orchestration Service (ROS) sends a custom resource request with RequestType set to Create.
Request
- RequestType
This field is set to Create.
- ResponseURL
A presigned public network URL. The custom resource provider uses this URL to send a response to ROS.
- IntranetResponseURL
A presigned internal network URL for use within an ECS instance. The custom resource provider uses this URL to send a response 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 that owns the stack.
- CallerId
The ID of the account that performs the stack operation. The account can be an Alibaba Cloud account or a RAM user.
- RegionId
The region of the stack that contains the custom resource.
- RequestId
The unique ID of the request.
- ResourceType
The type of the custom resource, as specified by the template developer in the ROS template. The 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) of the custom resource, as specified by the template developer in the ROS template.
- ResourceProperties
The custom resource properties defined by the template developer. The structure of this object 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" }
}
}
Response
Success
If the create request succeeds, the custom resource provider must send a response to ROS that contains the following fields:
- Status
This field must be set to SUCCESS.
- RequestId
The unique ID of the request. This value must be copied from the original request.
- LogicalResourceId
The name (logical ID) of the custom resource, as specified by the template developer in the ROS template. This value must be copied from the original request.
- StackId
The ID of the stack that contains the custom resource. This value must be copied from the original request.
- PhysicalResourceId
A unique identifier for the resource from the custom resource provider. The value can be up to 255 bytes long, must be a non-empty string, and must remain consistent across all responses for the resource.
- Data
Optional. A set of name-value pairs defined by the custom resource provider. You can use the `Fn::GetAtt` intrinsic function to access these values 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"
}
}
Failure
If the create request fails, the custom resource provider must send a response to ROS that contains the following fields:
- Status
This field must be set to FAILED.
- Reason
A description of why the request failed.
- RequestId
The unique ID of the request. This value must be copied from the original request.
- LogicalResourceId
The name (logical ID) of the custom resource, as specified by the template developer in the ROS template. This value must be copied from the original request.
- StackId
The ID of the stack that contains the custom resource. This value must be copied from the original 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)"
}