Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

AWS::ApiGateway::DocumentationPart

Focus mode
AWS::ApiGateway::DocumentationPart - AWS CloudFormation
Filter View

The AWS::ApiGateway::DocumentationPart resource creates a documentation part for an API. For more information, see Representation of API Documentation in API Gateway in the API Gateway Developer Guide.

Syntax

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

JSON

{ "Type" : "AWS::ApiGateway::DocumentationPart", "Properties" : { "Location" : Location, "Properties" : String, "RestApiId" : String } }

YAML

Type: AWS::ApiGateway::DocumentationPart Properties: Location: Location Properties: String RestApiId: String

Properties

Location

The location of the targeted API entity of the to-be-created documentation part.

Required: Yes

Type: Location

Update requires: Replacement

Properties

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

RestApiId

The string identifier of the associated RestApi.

Required: Yes

Type: String

Update requires: Replacement

Return values

Ref

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 Ref.

Fn::GetAtt

DocumentationPartId

The ID for the documentation part.

Examples

Associate documentation part with documentation version

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

JSON

{ "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

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

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.