檢視範本 - AWS Proton

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

檢視範本

您可以檢視包含詳細資料的範本清單,並使用AWS Proton安慰和AWS CLI。

客受受受受管環境樣板資料包括provisioned參數,值為CUSTOMER_MANAGED

如果服務範本沒有包含服務管線,服務範本資料包括pipelineProvisioning參數,值為CUSTOMER_MANAGED

如需詳細資訊,請參閱 註冊和發佈範本

您可以使用主控台或AWS CLI以列示和檢視樣板資料。

AWS Management Console

使用主控台列出並檢視範本。

  1. 若要檢視範本清單,請選擇(環境或服務) 範本

  2. 若要檢視詳細資料,請選擇範本名稱。

    查看模板的詳細信息,模板的主要和次要版本的列表,AWS Proton使用範本版本和範本標籤部署的資源。

    建議的主要版本和次要版本標示為建議

AWS CLI

使用AWS CLI以列示和檢視樣板。

執行以下命令:

$ aws proton get-environment-template-version \ --template-name "simple-env" \ --major-version "1" \ --minor-version "0"

回應:

{ "environmentTemplateVersion": { "arn": "arn:aws:proton:region-id:123456789012:environment-template/simple-env:1.0", "createdAt": "2020-11-10T18:35:08.293000+00:00", "description": "Version 1", "lastModifiedAt": "2020-11-10T18:35:11.162000+00:00", "majorVersion": "1", "minorVersion": "0", "recommendedMinorVersion": "0", "schema": "schema:\n format:\n openapi: \"3.0.0\"\n environment_input_type: \"MyEnvironmentInputType\"\n types:\n MyEnvironmentInputType:\n type: object\n description: \"Input properties for my environment\"\n properties:\n my_sample_input:\n type: string\n description: \"This is a sample input\"\n default: \"hello world\"\n my_other_sample_input:\n type: string\n description: \"Another sample input\"\n required:\n - my_other_sample_input\n", "status": "DRAFT", "statusMessage": "", "templateName": "simple-env" } }

執行以下命令:

$ aws proton list-environment-templates

回應:

{ "templates": [ { "arn": "arn:aws:proton:region-id:123456789012:environment-template/simple-env-3", "createdAt": "2020-11-10T18:35:05.763000+00:00", "description": "VPC with Public Access", "displayName": "VPC", "lastModifiedAt": "2020-11-10T18:35:05.763000+00:00", "name": "simple-env-3", "recommendedVersion": "1.0" }, { "arn": "arn:aws:proton:region-id:123456789012:environment-template/simple-env-1", "createdAt": "2020-11-10T00:14:06.881000+00:00", "description": "Some SSM Parameters", "displayName": "simple-env-1", "lastModifiedAt": "2020-11-10T00:14:06.881000+00:00", "name": "simple-env-1", "recommendedVersion": "1.0" } ] }

檢視服務範本的次要版本。

執行以下命令:

$ aws proton get-service-template-version \ --template-name "fargate-service" \ --major-version "1" \ --minor-version "0"

回應:

{ "serviceTemplateMinorVersion": { "arn": "arn:aws:proton:us-east-1:123456789012:service-template/fargate-service:1.0", "compatibleEnvironmentTemplates": [ { "majorVersion": "1", "templateName": "simple-env" } ], "createdAt": "2020-11-11T23:02:57.912000+00:00", "description": "Version 1", "lastModifiedAt": "2020-11-11T23:02:57.912000+00:00", "majorVersion": "1", "minorVersion": "0", "schema": "schema:\n format:\n openapi: \"3.0.0\"\n pipeline_input_type: \"MyPipelineInputType\"\n service_input_type: \"MyServiceInstanceInputType\"\n\n types:\n MyPipelineInputType:\n type: object\n description: \"Pipeline input properties\"\n required:\n - my_sample_pipeline_required_input\n properties:\n my_sample_pipeline_optional_input:\n type: string\n description: \"This is a sample input\"\n default: \"hello world\"\n my_sample_pipeline_required_input:\n type: string\n description: \"Another sample input\"\n\n MyServiceInstanceInputType:\n type: object\n description: \"Service instance input properties\"\n required:\n - my_sample_service_instance_required_input\n properties:\n my_sample_service_instance_optional_input:\n type: string\n description: \"This is a sample input\"\n default: \"hello world\"\n my_sample_service_instance_required_input:\n type: string\n description: \"Another sample input\"", "status": "DRAFT", "statusMessage": "", "templateName": "fargate-service" } }

檢視沒有服務管線的服務範本,如下一個範例命令和回應所示。

執行以下命令:

$ aws proton get-service-template \ --name "simple-svc-template-cli"

回應:

{ "serviceTemplate": { "arn": "arn:aws:proton:region-id:123456789012:service-template/simple-svc-template-cli", "createdAt": "2021-02-18T15:38:57.949000+00:00", "displayName": "simple-svc-template-cli", "lastModifiedAt": "2021-02-18T15:38:57.949000+00:00", "status": "DRAFT", "name": "simple-svc-template-cli", "pipelineProvisioning": "CUSTOMER_MANAGED" } }