service_instances
Creates, updates, deletes, gets or lists a service_instances resource.
Overview
| Name | service_instances |
| Type | Resource |
| Id | aws.proton.service_instances |
Fields
The following fields are returned by SELECT queries:
- get_service_instance
- list_service_instances
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the service instance. (pattern: <code>^[0-9A-Za-z]+[0-9A-Za-z_-]*$</code>) |
arn | string | The Amazon Resource Name (ARN) of the service instance. |
created_at | string (date-time) | The time when the service instance was created. |
deployment_status | string | The service instance deployment status. (IN_PROGRESS, FAILED, SUCCEEDED, DELETE_IN_PROGRESS, DELETE_FAILED, DELETE_COMPLETE, CANCELLING, CANCELLED) |
deployment_status_message | string | The message associated with the service instance deployment status. |
environment_name | string | The 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_id | string | The 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_token | string | The last client request token received. |
last_deployment_attempted_at | string (date-time) | The time when a deployment of the service instance was last attempted. |
last_deployment_succeeded_at | string (date-time) | The time when the service instance was last deployed successfully. |
last_succeeded_deployment_id | string | The 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_name | string | The name of the service that the service instance belongs to. (pattern: <code>^[0-9A-Za-z]+[0-9A-Za-z_-]*$</code>) |
spec | string | The service spec that was used to create the service instance. |
template_major_version | string | The major version of the service template that was used to create the service instance. (pattern: <code>^(0|([1-9]{1}\d*))$</code>) |
template_minor_version | string | The minor version of the service template that was used to create the service instance. (pattern: <code>^(0|([1-9]{1}\d*))$</code>) |
template_name | string | The name of the service template that was used to create the service instance. (pattern: <code>^[0-9A-Za-z]+[0-9A-Za-z_-]*$</code>) |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the service instance. (pattern: <code>^[0-9A-Za-z]+[0-9A-Za-z_-]*$</code>) |
arn | string | The Amazon Resource Name (ARN) of the service instance. |
created_at | string (date-time) | The time when the service instance was created. |
deployment_status | string | The service instance deployment status. (IN_PROGRESS, FAILED, SUCCEEDED, DELETE_IN_PROGRESS, DELETE_FAILED, DELETE_COMPLETE, CANCELLING, CANCELLED) |
deployment_status_message | string | A service instance deployment status message. |
environment_name | string | The 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_id | string | The 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_deployment_attempted_at | string (date-time) | The time when a deployment of the service was last attempted. |
last_deployment_succeeded_at | string (date-time) | The time when the service was last deployed successfully. |
last_succeeded_deployment_id | string | The 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_name | string | The name of the service that the service instance belongs to. (pattern: <code>^[0-9A-Za-z]+[0-9A-Za-z_-]*$</code>) |
template_major_version | string | The service instance template major version. (pattern: <code>^(0|([1-9]{1}\d*))$</code>) |
template_minor_version | string | The service instance template minor version. (pattern: <code>^(0|([1-9]{1}\d*))$</code>) |
template_name | string | The name of the service template. (pattern: <code>^[0-9A-Za-z]+[0-9A-Za-z_-]*$</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_service_instance | select | region | Get detailed data for a service instance. A service instance is an instantiation of service template and it runs in a specific environment. | |
list_service_instances | select | region | List service instances with summary data. This action lists service instances of all services in the Amazon Web Services account. | |
create_service_instance | insert | region, name, serviceName, spec | Create a service instance. | |
update_service_instance | update | region, deploymentType, name, serviceName | 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. | |
cancel_service_instance_deployment | exec | region, serviceInstanceName, serviceName | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_service_instance
- list_service_instances
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
;
List service instances with summary data. This action lists service instances of all services in the Amazon Web Services account.
SELECT
name,
arn,
created_at,
deployment_status,
deployment_status_message,
environment_name,
last_attempted_deployment_id,
last_deployment_attempted_at,
last_deployment_succeeded_at,
last_succeeded_deployment_id,
service_name,
template_major_version,
template_minor_version,
template_name
FROM aws.proton.service_instances
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_service_instance
- Manifest
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
;
# Description fields are for documentation purposes
- name: service_instances
props:
- name: region
value: "{{ region }}"
description: Required parameter for the service_instances resource.
- name: clientToken
value: "{{ clientToken }}"
description: |
The client token of the service instance to create.
- name: name
value: "{{ name }}"
description: |
The name of the service instance to create.
- name: serviceName
value: "{{ serviceName }}"
description: |
The name of the service the service instance is added to.
- name: spec
value: "{{ spec }}"
description: |
The spec for the service instance you want to create.
- name: tags
description: |
An optional list of metadata items that you can associate with the Proton service instance. A tag is a key-value pair. For more information, see Proton resources and tagging in the Proton User Guide.
value:
- key: "{{ key }}"
value: "{{ value }}"
- name: templateMajorVersion
value: "{{ templateMajorVersion }}"
description: |
To create a new major and minor version of the service template, exclude major Version.
- name: templateMinorVersion
value: "{{ templateMinorVersion }}"
description: |
To create a new minor version of the service template, include a major Version.
UPDATE examples
- update_service_instance
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
- cancel_service_instance_deployment
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 }}"
}'
;