

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::ApiGateway::DocumentationPart
<a name="aws-resource-apigateway-documentationpart"></a>

The `AWS::ApiGateway::DocumentationPart` resource creates a documentation part for an API. For more information, see [Representation of API Documentation in API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-documenting-api-content-representation.html) in the *API Gateway Developer Guide*.

## Syntax
<a name="aws-resource-apigateway-documentationpart-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-apigateway-documentationpart-syntax.json"></a>

```
{
  "Type" : "AWS::ApiGateway::DocumentationPart",
  "Properties" : {
      "[Location](#cfn-apigateway-documentationpart-location)" : Location,
      "[Properties](#cfn-apigateway-documentationpart-properties)" : String,
      "[RestApiId](#cfn-apigateway-documentationpart-restapiid)" : String
    }
}
```

### YAML
<a name="aws-resource-apigateway-documentationpart-syntax.yaml"></a>

```
Type: AWS::ApiGateway::DocumentationPart
Properties:
  [Location](#cfn-apigateway-documentationpart-location): 
    Location
  [Properties](#cfn-apigateway-documentationpart-properties): String
  [RestApiId](#cfn-apigateway-documentationpart-restapiid): String
```

## Properties
<a name="aws-resource-apigateway-documentationpart-properties"></a>

`Location`  <a name="cfn-apigateway-documentationpart-location"></a>
The location of the targeted API entity of the to-be-created documentation part.  
*Required*: Yes  
*Type*: [Location](aws-properties-apigateway-documentationpart-location.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Properties`  <a name="cfn-apigateway-documentationpart-properties"></a>
The new documentation content map of the targeted API entity. Enclosed key-value pairs are API-specific, but only OpenAPI-compliant key-value pairs can be exported and, hence, published.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RestApiId`  <a name="cfn-apigateway-documentationpart-restapiid"></a>
The string identifier of the associated RestApi.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-apigateway-documentationpart-return-values"></a>

### Ref
<a name="aws-resource-apigateway-documentationpart-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the ID of the documentation part, such as `abc123`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-apigateway-documentationpart-return-values-fn--getatt"></a>

#### 
<a name="aws-resource-apigateway-documentationpart-return-values-fn--getatt-fn--getatt"></a>

`DocumentationPartId`  <a name="DocumentationPartId-fn::getatt"></a>
The ID for the documentation part.

## Examples
<a name="aws-resource-apigateway-documentationpart--examples"></a>



### Associate documentation part with documentation version
<a name="aws-resource-apigateway-documentationpart--examples--Associate_documentation_part_with_documentation_version"></a>

The following example associates a documentation part for an API entity with a documentation version.

#### JSON
<a name="aws-resource-apigateway-documentationpart--examples--Associate_documentation_part_with_documentation_version--json"></a>

```
{
    "Parameters": {
        "apiName": {
            "Type": "String"
        },
        "description": {
            "Type": "String"
        },
        "version": {
            "Type": "String"
        },
        "type": {
            "Type": "String"
        },
        "property": {
            "Type": "String"
        }
    },
    "Resources": {
        "RestApi": {
            "Type": "AWS::ApiGateway::RestApi",
            "Properties": {
                "Name": {
                    "Ref": "apiName"
                }
            }
        },
        "DocumentationPart": {
            "Type": "AWS::ApiGateway::DocumentationPart",
            "Properties": {
                "Location": {
                    "Type": {
                        "Ref": "type"
                    }
                },
                "RestApiId": {
                    "Ref": "RestApi"
                },
                "Properties": {
                    "Ref": "property"
                }
            }
        },
        "DocumentationVersion": {
            "Type": "AWS::ApiGateway::DocumentationVersion",
            "Properties": {
                "Description": {
                    "Ref": "description"
                },
                "DocumentationVersion": {
                    "Ref": "version"
                },
                "RestApiId": {
                    "Ref": "RestApi"
                }
            },
            "DependsOn": "DocumentationPart"
        }
    }
}
```

#### YAML
<a name="aws-resource-apigateway-documentationpart--examples--Associate_documentation_part_with_documentation_version--yaml"></a>

```
Parameters:
  apiName:
    Type: String
  description:
    Type: String
  version:
    Type: String
  type:
    Type: String
  property:
    Type: String
Resources:
  RestApi:
    Type: AWS::ApiGateway::RestApi
    Properties:
      Name: !Ref apiName
  DocumentationPart:
    Type: AWS::ApiGateway::DocumentationPart
    Properties:
      Location:
        Type: !Ref type
      RestApiId: !Ref RestApi
      Properties: !Ref property
  DocumentationVersion:
    Type: AWS::ApiGateway::DocumentationVersion
    Properties:
      Description: !Ref description
      DocumentationVersion: !Ref version
      RestApiId: !Ref RestApi
    DependsOn: DocumentationPart
```

## See also
<a name="aws-resource-apigateway-documentationpart--seealso"></a>
+ [documentationpart:create](https://docs.aws.amazon.com/apigateway/latest/api/API_CreateDocumentationPart.html) in the *Amazon API Gateway REST API Reference*



# AWS::ApiGateway::DocumentationPart Location
<a name="aws-properties-apigateway-documentationpart-location"></a>

The `Location` property specifies the location of the Amazon API Gateway API entity that the documentation applies to. `Location` is a property of the [AWS::ApiGateway::DocumentationPart](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-documentationpart.html) resource.

**Note**  
For more information about each property, including constraints and valid values, see [DocumentationPart](https://docs.aws.amazon.com/apigateway/latest/api/API_DocumentationPartLocation.html) in the *Amazon API Gateway REST API Reference*.

## Syntax
<a name="aws-properties-apigateway-documentationpart-location-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-apigateway-documentationpart-location-syntax.json"></a>

```
{
  "[Method](#cfn-apigateway-documentationpart-location-method)" : String,
  "[Name](#cfn-apigateway-documentationpart-location-name)" : String,
  "[Path](#cfn-apigateway-documentationpart-location-path)" : String,
  "[StatusCode](#cfn-apigateway-documentationpart-location-statuscode)" : String,
  "[Type](#cfn-apigateway-documentationpart-location-type)" : String
}
```

### YAML
<a name="aws-properties-apigateway-documentationpart-location-syntax.yaml"></a>

```
  [Method](#cfn-apigateway-documentationpart-location-method): String
  [Name](#cfn-apigateway-documentationpart-location-name): String
  [Path](#cfn-apigateway-documentationpart-location-path): String
  [StatusCode](#cfn-apigateway-documentationpart-location-statuscode): String
  [Type](#cfn-apigateway-documentationpart-location-type): String
```

## Properties
<a name="aws-properties-apigateway-documentationpart-location-properties"></a>

`Method`  <a name="cfn-apigateway-documentationpart-location-method"></a>
The HTTP verb of a method. It is a valid field for the API entity types of `METHOD`, `PATH_PARAMETER`, `QUERY_PARAMETER`, `REQUEST_HEADER`, `REQUEST_BODY`, `RESPONSE`, `RESPONSE_HEADER`, and `RESPONSE_BODY`. The default value is `*` for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other `location` attributes, the child entity's `method` attribute must match that of the parent entity exactly.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Name`  <a name="cfn-apigateway-documentationpart-location-name"></a>
The name of the targeted API entity. It is a valid and required field for the API entity types of `AUTHORIZER`, `MODEL`, `PATH_PARAMETER`, `QUERY_PARAMETER`, `REQUEST_HEADER`, `REQUEST_BODY` and `RESPONSE_HEADER`. It is an invalid field for any other entity type.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Path`  <a name="cfn-apigateway-documentationpart-location-path"></a>
The URL path of the target. It is a valid field for the API entity types of `RESOURCE`, `METHOD`, `PATH_PARAMETER`, `QUERY_PARAMETER`, `REQUEST_HEADER`, `REQUEST_BODY`, `RESPONSE`, `RESPONSE_HEADER`, and `RESPONSE_BODY`. The default value is `/` for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the other `location` attributes, the child entity's `path` attribute must match that of the parent entity as a prefix.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`StatusCode`  <a name="cfn-apigateway-documentationpart-location-statuscode"></a>
The HTTP status code of a response. It is a valid field for the API entity types of `RESPONSE`, `RESPONSE_HEADER`, and `RESPONSE_BODY`. The default value is `*` for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other `location` attributes, the child entity's `statusCode` attribute must match that of the parent entity exactly.  
*Required*: No  
*Type*: String  
*Pattern*: `^([1-5]\d\d|\*|\s*)$`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Type`  <a name="cfn-apigateway-documentationpart-location-type"></a>
The type of API entity to which the documentation content applies. Valid values are `API`, `AUTHORIZER`, `MODEL`, `RESOURCE`, `METHOD`, `PATH_PARAMETER`, `QUERY_PARAMETER`, `REQUEST_HEADER`, `REQUEST_BODY`, `RESPONSE`, `RESPONSE_HEADER`, and `RESPONSE_BODY`. Content inheritance does not apply to any entity of the `API`, `AUTHORIZER`, `METHOD`, `MODEL`, `REQUEST_BODY`, or `RESOURCE` type.  
*Required*: No  
*Type*: String  
*Allowed values*: `API | AUTHORIZER | MODEL | RESOURCE | METHOD | PATH_PARAMETER | QUERY_PARAMETER | REQUEST_HEADER | REQUEST_BODY | RESPONSE | RESPONSE_HEADER | RESPONSE_BODY`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## See also
<a name="aws-properties-apigateway-documentationpart-location--seealso"></a>
+ [DocumentationPart](https://docs.aws.amazon.com/apigateway/latest/api/API_DocumentationPartLocation.html) in the *Amazon API Gateway REST API Reference*

