

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

# 應用程式 applicationId 版本semanticVersion
<a name="applications-applicationid-versions-semanticversion"></a>

## URI
<a name="applications-applicationid-versions-semanticversion-url"></a>

`/applications/{{applicationId}}/versions/{{semanticVersion}}`

## HTTP 方法
<a name="applications-applicationid-versions-semanticversion-http-methods"></a>

### PUT
<a name="applications-applicationid-versions-semanticversionput"></a>

**操作 ID：**`CreateApplicationVersion`

建立應用程式版本。


**路徑參數**  

| 名稱 | 類型 | 必要 | Description | 
| --- |--- |--- |--- |
| {{applicationId}} | String | True | 應用程式的 Amazon Resource Name (ARN)。 | 
| {{semanticVersion}} | String | True | 新版本的語意版本。 | 


**回應**  

| 狀態碼 | 回應模型 | Description | 
| --- |--- |--- |
| 201 | Version | 成功 | 
| 400 | BadRequestException | 請求中的其中一個參數無效。 | 
| 403 | ForbiddenException | 用戶端未驗證。 | 
| 409 | ConflictException | 此資源已存在。 | 
| 429 | TooManyRequestsException | 用戶端傳送的請求數量超過每單位時間允許的請求數量。 | 
| 500 | InternalServerErrorException |  AWS Serverless Application Repository 服務發生內部錯誤。 | 

### OPTIONS
<a name="applications-applicationid-versions-semanticversionoptions"></a>


**路徑參數**  

| 名稱 | 類型 | 必要 | Description | 
| --- |--- |--- |--- |
| {{applicationId}} | String | True | 應用程式的 Amazon Resource Name (ARN)。 | 
| {{semanticVersion}} | String | True | 新版本的語意版本。 | 


**回應**  

| 狀態碼 | 回應模型 | Description | 
| --- |--- |--- |
| 200 | None | 200 個回應 | 

## 結構描述
<a name="applications-applicationid-versions-semanticversion-schemas"></a>

### 請求內文
<a name="applications-applicationid-versions-semanticversion-request-examples"></a>

#### PUT 結構描述
<a name="applications-applicationid-versions-semanticversion-request-body-put-example"></a>

```
{
  "templateBody": "string",
  "templateUrl": "string",
  "sourceCodeUrl": "string",
  "sourceCodeArchiveUrl": "string"
}
```

### 回應內文
<a name="applications-applicationid-versions-semanticversion-response-examples"></a>

#### Version 結構描述
<a name="applications-applicationid-versions-semanticversion-response-body-version-example"></a>

```
{
  "applicationId": "string",
  "semanticVersion": "string",
  "sourceCodeUrl": "string",
  "sourceCodeArchiveUrl": "string",
  "templateUrl": "string",
  "creationTime": "string",
  "parameterDefinitions": [
    {
      "name": "string",
      "defaultValue": "string",
      "description": "string",
      "type": "string",
      "noEcho": boolean,
      "allowedPattern": "string",
      "constraintDescription": "string",
      "minValue": integer,
      "maxValue": integer,
      "minLength": integer,
      "maxLength": integer,
      "allowedValues": [
        "string"
      ],
      "referencedByResources": [
        "string"
      ]
    }
  ],
  "requiredCapabilities": [
    enum
  ],
  "resourcesSupported": boolean
}
```

#### BadRequestException 結構描述
<a name="applications-applicationid-versions-semanticversion-response-body-badrequestexception-example"></a>

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### ForbiddenException 結構描述
<a name="applications-applicationid-versions-semanticversion-response-body-forbiddenexception-example"></a>

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### ConflictException 結構描述
<a name="applications-applicationid-versions-semanticversion-response-body-conflictexception-example"></a>

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### TooManyRequestsException 結構描述
<a name="applications-applicationid-versions-semanticversion-response-body-toomanyrequestsexception-example"></a>

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### InternalServerErrorException 結構描述
<a name="applications-applicationid-versions-semanticversion-response-body-internalservererrorexception-example"></a>

```
{
  "message": "string",
  "errorCode": "string"
}
```

## Properties
<a name="applications-applicationid-versions-semanticversion-properties"></a>

### BadRequestException
<a name="applications-applicationid-versions-semanticversion-model-badrequestexception"></a>

請求中的其中一個參數無效。


| 屬性 | Type | 必要 | Description | 
| --- |--- |--- |--- |
| errorCode | string | False | 400 | 
| message | string | False | 請求中的其中一個參數無效。 | 

### Capability
<a name="applications-applicationid-versions-semanticversion-model-capability"></a>

必須指定才能部署某些應用程式的值。
+ `CAPABILITY_IAM`
+ `CAPABILITY_NAMED_IAM`
+ `CAPABILITY_AUTO_EXPAND`
+ `CAPABILITY_RESOURCE_POLICY`

### ConflictException
<a name="applications-applicationid-versions-semanticversion-model-conflictexception"></a>

此資源已存在。


| 屬性 | Type | 必要 | Description | 
| --- |--- |--- |--- |
| errorCode | string | False | 409 | 
| message | string | False | 此資源已存在。 | 

### CreateApplicationVersionInput
<a name="applications-applicationid-versions-semanticversion-model-createapplicationversioninput"></a>

建立版本請求。


| 屬性 | Type | 必要 | Description | 
| --- |--- |--- |--- |
| sourceCodeArchiveUrl | string | False | S3 物件的連結，其中包含此應用程式版本原始碼的 ZIP 封存。<br />大小上限為 50 MB | 
| sourceCodeUrl | string | False | 應用程式原始碼的公有儲存庫連結，例如特定 GitHub 遞交的 URL。 | 
| templateBody | string | False | 應用程式的原始封裝 AWS SAM 範本。 | 
| templateUrl | string | False | 應用程式封裝 AWS SAM 範本的連結。 | 

### ForbiddenException
<a name="applications-applicationid-versions-semanticversion-model-forbiddenexception"></a>

用戶端未驗證。


| 屬性 | Type | 必要 | Description | 
| --- |--- |--- |--- |
| errorCode | string | False | 403 | 
| message | string | False | 用戶端未驗證。 | 

### InternalServerErrorException
<a name="applications-applicationid-versions-semanticversion-model-internalservererrorexception"></a>

 AWS Serverless Application Repository 服務發生內部錯誤。


| 屬性 | Type | 必要 | Description | 
| --- |--- |--- |--- |
| errorCode | string | False | 500 | 
| message | string | False |  AWS Serverless Application Repository 服務發生內部錯誤。 | 

### ParameterDefinition
<a name="applications-applicationid-versions-semanticversion-model-parameterdefinition"></a>

應用程式支援的參數。


| 屬性 | Type | 必要 | Description | 
| --- |--- |--- |--- |
| allowedPattern | string | False | 規則表達式，代表 `String` 類型允許的模式。 | 
| allowedValues | 類型 string 的陣列 | False | 陣列，包含參數的允許值清單。 | 
| constraintDescription | string | False | 字串，說明違反限制時的限制。例如，具有允許模式 `[A-Za-z0-9]+` 的參數會在使用者指定無效值時顯示下列錯誤訊息，但沒有限制描述：<br /> `Malformed input-Parameter MyParameter must match pattern [A-Za-z0-9]+` <br />透過新增限制描述，例如「必須僅包含大寫和小寫字母和數字」，您可以顯示下列自訂錯誤訊息：<br /> `Malformed input-Parameter MyParameter must contain only uppercase and lowercase letters and numbers.`  | 
| defaultValue | string | False | 建立堆疊時，範本要在未指定值時使用的適當類型值。如果您定義參數的限制，則必須指定遵循這些限制的值。 | 
| 描述 | string | False | 最多 4，000 個字元的字串，描述 參數。 | 
| maxLength | integer | False | 整數值，決定您要允許 `String`類型的最大字元數。 | 
| maxValue | integer | False | 數值，決定您要允許 `Number`類型的最大數值。 | 
| minLength | integer | False | 整數值，決定您想要允許 `String`類型使用的最小字元數。 | 
| minValue | integer | False | 數值，決定您想要允許 `Number`類型的最小數值。 | 
| name | string | True | 參數名稱。 | 
| noEcho | boolean | False | 是否在任何人進行描述堆疊的呼叫時遮罩參數值。如果您將值設定為 true，參數值會以星號 (\*\*\*\*\*) 遮罩。 | 
| referencedByResources | 類型 string 的陣列 | True | 使用此參數 AWS SAM 的資源清單。 | 
| type | string | False | 參數的類型。<br />有效值：`String \| Number \| List<Number> \| CommaDelimitedList`<br /> `String`：常值字串。<br />例如，使用者可以指定 `"MyUserName"`。<br /> `Number`：整數或 float. CloudFormation valid 會將參數值驗證為數字。不過，當您在範本的其他位置使用 參數 （例如，使用`Ref`內部 函數） 時， 參數值會變成字串。<br />例如，使用者可以指定 `"8888"`。<br /> `List<Number>`：以逗號分隔的整數或浮點數陣列。 CloudFormation 會將參數值驗證為數字。不過，當您在範本的其他位置使用 參數 （例如，使用`Ref`內部 函數） 時， 參數值會成為字串清單。<br />例如，使用者可能會指定「80，20」，然後`Ref`產生 `["80","20"]`。<br /> `CommaDelimitedList`：以逗號分隔的常值字串陣列。字串總數應該比逗號總數多一個。此外，每個成員字串都是空格修剪的。<br />例如，使用者可能會指定 "test，dev，prod"，然後`Ref`產生 `["test","dev","prod"]`。 | 

### TooManyRequestsException
<a name="applications-applicationid-versions-semanticversion-model-toomanyrequestsexception"></a>

用戶端傳送的請求數量超過每單位時間允許的請求數量。


| 屬性 | Type | 必要 | Description | 
| --- |--- |--- |--- |
| errorCode | string | False | 429 | 
| message | string | False | 用戶端傳送的請求數量超過每單位時間允許的請求數量。 | 

### Version
<a name="applications-applicationid-versions-semanticversion-model-version"></a>

應用程式版本詳細資訊。


| 屬性 | Type | 必要 | Description | 
| --- |--- |--- |--- |
| applicationId | string | True | 應用程式 Amazon Resource Name (ARN)。 | 
| creationTime | string | True | 建立此資源的日期和時間。 | 
| parameterDefinitions | 類型 [ParameterDefinition](#applications-applicationid-versions-semanticversion-model-parameterdefinition) 的陣列 | True | 應用程式支援的參數類型陣列。 | 
| requiredCapabilities | 類型 [Capability](#applications-applicationid-versions-semanticversion-model-capability) 的陣列 | True | 您必須先指定的值清單，才能部署特定應用程式。有些應用程式可能包含會影響您 AWS 帳戶中許可的資源，例如，建立新的 AWS Identity and Access Management (IAM) 使用者。對於這些應用程式，您必須指定此參數來明確認可其功能。<br />唯一有效的值是 `CAPABILITY_IAM`、`CAPABILITY_RESOURCE_POLICY`、 `CAPABILITY_NAMED_IAM`和 `CAPABILITY_AUTO_EXPAND`。<br />下列資源需要由您指定 `CAPABILITY_IAM` 或 `CAPABILITY_NAMED_IAM`：[AWS::IAM::Group](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html)、[AWS::IAM::InstanceProfile](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html)、[AWS::IAM::Policy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html) 和 [AWS::IAM::Role](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html)。如果應用程式包含 IAM 資源，您可以指定 `CAPABILITY_IAM`或 `CAPABILITY_NAMED_IAM`。如果應用程式包含具有自訂名稱的 IAM 資源，則您必須指定 `CAPABILITY_NAMED_IAM`。<br />下列資源需要由您指定 `CAPABILITY_RESOURCE_POLICY`：[AWS::Lambda::Permission](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html)、[AWS::IAM:Policy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html)、[AWS::ApplicationAutoScaling::ScalingPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html)、[AWS::S3::BucketPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html)、[AWS::SQS::QueuePolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-policy.html) 和 [AWS::SNS::TopicPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-policy.html)。<br />包含一個或多個巢狀應用程式的應用程式需要由您指定 `CAPABILITY_AUTO_EXPAND`。<br />如果您的應用程式範本包含上述任何資源，建議您在部署之前檢閱與應用程式相關聯的所有許可。如果您未為需要 功能的應用程式指定此參數，呼叫將會失敗。 | 
| resourcesSupported | boolean | True | 此應用程式中包含的所有 AWS 資源是否都支援擷取該資源的區域。 | 
| semanticVersion | string | True | 應用程式語意版本：<br /> [https://semver.org/](https://semver.org/)  | 
| sourceCodeArchiveUrl | string | False | S3 物件的連結，其中包含此應用程式版本原始碼的 ZIP 封存。<br />大小上限為 50 MB | 
| sourceCodeUrl | string | False | 應用程式原始碼的公有儲存庫連結，例如特定 GitHub 遞交的 URL。 | 
| templateUrl | string | True | 應用程式封裝 AWS SAM 範本的連結。 | 

## 另請參閱
<a name="applications-applicationid-versions-semanticversion-see-also"></a>

如需在其中一種語言特定 AWS SDKs和參考中使用此 API 的詳細資訊，請參閱下列內容：

### CreateApplicationVersion
<a name="CreateApplicationVersion-see-also"></a>
+ [AWS 命令列界面 V2](/goto/cli2/serverlessrepo-2017-09-08/CreateApplicationVersion)
+ [適用於 .NET V4 的 AWS 開發套件](/goto/DotNetSDKV4/serverlessrepo-2017-09-08/CreateApplicationVersion)
+ [適用於 C\+\+ 的 AWS SDK](/goto/SdkForCpp/serverlessrepo-2017-09-08/CreateApplicationVersion)
+ [適用於 Go v2 的 AWS 開發套件](/goto/SdkForGoV2/serverlessrepo-2017-09-08/CreateApplicationVersion)
+ [適用於 Java 的 AWS SDK 第 2 版](/goto/SdkForJavaV2/serverlessrepo-2017-09-08/CreateApplicationVersion)
+ [適用於 JavaScript V3 的 AWS 開發套件](/goto/SdkForJavaScriptV3/serverlessrepo-2017-09-08/CreateApplicationVersion)
+ [適用於 Kotlin 的 AWS 開發套件](/goto/SdkForKotlin/serverlessrepo-2017-09-08/CreateApplicationVersion)
+ [適用於 PHP V3 的 AWS 開發套件](/goto/SdkForPHPV3/serverlessrepo-2017-09-08/CreateApplicationVersion)
+ [適用於 Python 的 AWS 開發套件](/goto/boto3/serverlessrepo-2017-09-08/CreateApplicationVersion)
+ [適用於 Ruby V3 的 AWS 開發套件](/goto/SdkForRubyV3/serverlessrepo-2017-09-08/CreateApplicationVersion)