Skip to main content

service_instances

Creates, updates, deletes, gets or lists a service_instances resource.

Overview

Nameservice_instances
TypeResource
Idaws.proton.service_instances

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the service instance. (pattern: <code>^[0-9A-Za-z]+[0-9A-Za-z_-]*$</code>)
arnstringThe Amazon Resource Name (ARN) of the service instance.
created_atstring (date-time)The time when the service instance was created.
deployment_statusstringThe service instance deployment status. (IN_PROGRESS, FAILED, SUCCEEDED, DELETE_IN_PROGRESS, DELETE_FAILED, DELETE_COMPLETE, CANCELLING, CANCELLED)
deployment_status_messagestringThe message associated with the service instance deployment status.
environment_namestringThe name of the environment that the service instance was deployed into. (pattern: <code>^[0-9A-Za-z]+[0-9A-Za-z_-]*$</code>)
last_attempted_deployment_idstringThe ID of the last attempted deployment of this service instance. (pattern: <code>^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$</code>)
last_client_request_tokenstringThe last client request token received.
last_deployment_attempted_atstring (date-time)The time when a deployment of the service instance was last attempted.
last_deployment_succeeded_atstring (date-time)The time when the service instance was last deployed successfully.
last_succeeded_deployment_idstringThe ID of the last successful deployment of this service instance. (pattern: <code>^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$</code>)
service_namestringThe name of the service that the service instance belongs to. (pattern: <code>^[0-9A-Za-z]+[0-9A-Za-z_-]*$</code>)
specstringThe service spec that was used to create the service instance.
template_major_versionstringThe major version of the service template that was used to create the service instance. (pattern: <code>^(0|([1-9]{1}\d*))$</code>)
template_minor_versionstringThe minor version of the service template that was used to create the service instance. (pattern: <code>^(0|([1-9]{1}\d*))$</code>)
template_namestringThe name of the service template that was used to create the service instance. (pattern: <code>^[0-9A-Za-z]+[0-9A-Za-z_-]*$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_service_instanceselectregionGet detailed data for a service instance. A service instance is an instantiation of service template and it runs in a specific environment.
list_service_instancesselectregionList service instances with summary data. This action lists service instances of all services in the Amazon Web Services account.
create_service_instanceinsertregion, name, serviceName, specCreate a service instance.
update_service_instanceupdateregion, deploymentType, name, serviceNameUpdate a service instance. There are a few modes for updating a service instance. The deploymentType field defines the mode. You can't update a service instance while its deployment status, or the deployment status of a component attached to it, is IN_PROGRESS. For more information about components, see Proton components in the Proton User Guide.
cancel_service_instance_deploymentexecregion, serviceInstanceName, serviceNameAttempts to cancel a service instance deployment on an UpdateServiceInstance action, if the deployment is IN_PROGRESS. For more information, see Update a service instance in the Proton User guide. The following list includes potential cancellation scenarios. If the cancellation attempt succeeds, the resulting deployment state is CANCELLED. If the cancellation attempt fails, the resulting deployment state is FAILED. If the current UpdateServiceInstance action succeeds before the cancellation attempt starts, the resulting deployment state is SUCCEEDED and the cancellation attempt has no effect.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Get detailed data for a service instance. A service instance is an instantiation of service template and it runs in a specific environment.

SELECT
name,
arn,
created_at,
deployment_status,
deployment_status_message,
environment_name,
last_attempted_deployment_id,
last_client_request_token,
last_deployment_attempted_at,
last_deployment_succeeded_at,
last_succeeded_deployment_id,
service_name,
spec,
template_major_version,
template_minor_version,
template_name
FROM aws.proton.service_instances
WHERE region = '{{ region }}' -- required
;

INSERT examples

Create a service instance.

INSERT INTO aws.proton.service_instances (
clientToken,
name,
serviceName,
spec,
tags,
templateMajorVersion,
templateMinorVersion,
region
)
SELECT
'{{ clientToken }}',
'{{ name }}' /* required */,
'{{ serviceName }}' /* required */,
'{{ spec }}' /* required */,
'{{ tags }}',
'{{ templateMajorVersion }}',
'{{ templateMinorVersion }}',
'{{ region }}'
RETURNING
service_instance
;

UPDATE examples

Update a service instance. There are a few modes for updating a service instance. The deploymentType field defines the mode. You can't update a service instance while its deployment status, or the deployment status of a component attached to it, is IN_PROGRESS. For more information about components, see Proton components in the Proton User Guide.

UPDATE aws.proton.service_instances
SET
clientToken = '{{ clientToken }}',
deploymentType = '{{ deploymentType }}',
name = '{{ name }}',
serviceName = '{{ serviceName }}',
spec = '{{ spec }}',
templateMajorVersion = '{{ templateMajorVersion }}',
templateMinorVersion = '{{ templateMinorVersion }}'
WHERE
region = '{{ region }}' --required
AND deploymentType = '{{ deploymentType }}' --required
AND name = '{{ name }}' --required
AND serviceName = '{{ serviceName }}' --required
RETURNING
service_instance;

Lifecycle Methods

Attempts to cancel a service instance deployment on an UpdateServiceInstance action, if the deployment is IN_PROGRESS. For more information, see Update a service instance in the Proton User guide. The following list includes potential cancellation scenarios. If the cancellation attempt succeeds, the resulting deployment state is CANCELLED. If the cancellation attempt fails, the resulting deployment state is FAILED. If the current UpdateServiceInstance action succeeds before the cancellation attempt starts, the resulting deployment state is SUCCEEDED and the cancellation attempt has no effect.

EXEC aws.proton.service_instances.cancel_service_instance_deployment
@region='{{ region }}' --required
@@json=
'{
"serviceInstanceName": "{{ serviceInstanceName }}",
"serviceName": "{{ serviceName }}"
}'
;