다음AWS CLI 예제 명령 및 응답과spec
같이 편집된 서비스 인스턴스를 추가 및 삭제합니다.
CLI를 사용할 때는 삭제할 서비스 인스턴스를 제외하고 추가할 서비스 인스턴스와 삭제하도록 표시하지 않은 기존 서비스 인스턴스를 모두spec
포함해야 합니다.
다음 목록은 편집spec
전의 예와 해당 사양에서 배포한 서비스 인스턴스의 목록을 보여줍니다. 이 사양은 이전 예제에서 서비스 설명을 편집하는 데 사용되었습니다.
Spec:
proton: ServiceSpec
pipeline:
my_sample_pipeline_optional_input: "abc"
my_sample_pipeline_required_input: "123"
instances:
- name: "my-instance"
environment: "simple-env"
spec:
my_sample_service_instance_optional_input: "def"
my_sample_service_instance_required_input: "456"
- name: "my-other-instance"
environment: "simple-env"
spec:
my_sample_service_instance_required_input: "789"
다음 예제 CLIlist-service-instances
명령 및 응답은 서비스 인스턴스를 추가하거나 삭제하기 전의 활성 인스턴스를 보여줍니다.
명령:
$
aws proton list-service-instances \
--service-name "MySimpleService
"
응답:
{
"serviceInstances": [
{
"arn": "arn:aws:proton:region-id:123456789012:service/MySimpleService/service-instance/my-other-instance",
"createdAt": "2021-03-12T22:39:42.318000+00:00",
"deploymentStatus": "SUCCEEDED",
"environmentName": "simple-env",
"lastDeploymentAttemptedAt": "2021-03-12T22:39:43.109000+00:00",
"lastDeploymentSucceededAt": "2021-03-12T22:39:43.109000+00:00",
"name": "my-other-instance",
"serviceName": "example-svc",
"templateMajorVersion": "1",
"templateMinorVersion": "0",
"templateName": "fargate-service"
},
{
"arn": "arn:aws:proton:region-id:123456789012:service/MySimpleService/service-instance/my-instance",
"createdAt": "2021-03-12T22:39:42.318000+00:00",
"deploymentStatus": "SUCCEEDED",
"environmentName": "simple-env",
"lastDeploymentAttemptedAt": "2021-03-12T22:39:43.160000+00:00",
"lastDeploymentSucceededAt": "2021-03-12T22:39:43.160000+00:00",
"name": "my-instance",
"serviceName": "example-svc",
"serviceTemplateArn": "arn:aws:proton:region-id:123456789012:service-template/fargate-service",
"templateMajorVersion": "1",
"templateMinorVersion": "0",
"templateName": "fargate-service"
}
]
}
다음 목록은 인스턴스를 삭제하고 추가하는spec
데 사용된 편집된 예를 보여줍니다. 이름이 지정된 기존my-instance
인스턴스가 제거되고 라는 새yet-another-instance
인스턴스가 추가됩니다.
Spec:
proton: ServiceSpec
pipeline:
my_sample_pipeline_optional_input: "abc"
my_sample_pipeline_required_input: "123"
instances:
- name: "my-other-instance"
environment: "simple-env"
spec:
my_sample_service_instance_required_input: "789"
- name: "yet-another-instance"
environment: "simple-env"
spec:
my_sample_service_instance_required_input: "789"
에 값이 있는 경우 를"${Proton::CURRENT_VAL}"
사용하여spec
원본에서 보존할 매개변수 값을 지정할 수spec
있습니다. get-service
에 설명된 대로 서비스의 원본을spec
보는 데 사용합니다서비스 데이터 보기.
다음 목록은 기존 서비스 인스턴스에 대한 매개 변수 값 변경 내용을spec
포함하지 않도록 하는 데 사용할"${Proton::CURRENT_VAL}"
수 있는 방법을 보여줍니다.
Spec:
proton: ServiceSpec
pipeline:
my_sample_pipeline_optional_input: "${Proton::CURRENT_VAL}"
my_sample_pipeline_required_input: "${Proton::CURRENT_VAL}"
instances:
- name: "my-other-instance"
environment: "simple-env"
spec:
my_sample_service_instance_required_input: "${Proton::CURRENT_VAL}"
- name: "yet-another-instance"
environment: "simple-env"
spec:
my_sample_service_instance_required_input: "789"
다음 목록은 서비스를 편집하기 위한 CLI 명령과 응답을 보여 줍니다.
명령:
$
aws proton update-service
--name "MySimpleService
" \
--description "Edit by adding and deleting a service instance
" \
--spec "file://spec.yaml
"
응답:
{
"service": {
"arn": "arn:aws:proton:region-id:123456789012:service/MySimpleService",
"branchName": "main",
"createdAt": "2021-03-12T22:39:42.318000+00:00",
"description": "Edit by adding and deleting a service instance",
"lastModifiedAt": "2021-03-12T22:55:48.169000+00:00",
"name": "MySimpleService",
"repositoryConnectionArn": "arn:aws:codestar-connections:region-id:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
"repositoryId": "my-repository/myorg-myapp",
"status": "UPDATE_IN_PROGRESS",
"templateName": "fargate-service"
}
}
다음list-service-instances
명령과my-instance
응답은 이름이 지정된 기존 인스턴스가 제거되고 라는 새yet-another-instance
인스턴스가 추가되었음을 확인합니다.
명령:
$
aws proton list-service-instances \
--service-name "MySimpleService
"
응답:
{
"serviceInstances": [
{
"arn": "arn:aws:proton:region-id:123456789012:service/MySimpleService/service-instance/yet-another-instance",
"createdAt": "2021-03-12T22:39:42.318000+00:00",
"deploymentStatus": "SUCCEEDED",
"environmentName": "simple-env",
"lastDeploymentAttemptedAt": "2021-03-12T22:56:01.565000+00:00",
"lastDeploymentSucceededAt": "2021-03-12T22:56:01.565000+00:00",
"name": "yet-another-instance",
"serviceName": "MySimpleService",
"templateMajorVersion": "1",
"templateMinorVersion": "0",
"templateName": "fargate-service"
},
{
"arn": "arn:aws:proton:region-id:123456789012:service/MySimpleService/service-instance/my-other-instance",
"createdAt": "2021-03-12T22:39:42.318000+00:00",
"deploymentStatus": "SUCCEEDED",
"environmentName": "simple-env",
"lastDeploymentAttemptedAt": "2021-03-12T22:39:43.109000+00:00",
"lastDeploymentSucceededAt": "2021-03-12T22:39:43.109000+00:00",
"name": "my-other-instance",
"serviceName": "MySimpleService",
"templateMajorVersion": "1",
"templateMinorVersion": "0",
"templateName": "fargate-service"
}
]
}