AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::ApiGateway::DocumentationPart

The AWS::ApiGateway::DocumentationPart resource creates a documentation part for an Amazon API Gateway API entity. 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

Note

For more information about each property, including constraints and valid values, see DocumentationPart in the Amazon API Gateway REST API Reference.

Location

The location of the API entity that the documentation applies to.

Required: Yes

Type: Amazon API Gateway DocumentationPart Location

Update requires: Replacement

Properties

The documentation content map of the targeted API entity.

Required: Yes

Type: String

Update requires: No interruption

RestApiId

The identifier of the targeted API entity.

Required: Yes

Type: String

Update requires: Replacement

Return Value

Ref

When you pass the logical ID of an AWS::ApiGateway::DocumentationPart resource to the intrinsic Ref function, the function returns the ID of the documentation part, such as abc123.

For more information about using the Ref function, see Ref.

Example

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" }, "Property": { "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 Property: !Ref property DocumentationVersion: Type: AWS::ApiGateway::DocumentationVersion Properties: Description: !Ref description DocumentationVersion: !Ref version RestApiId: !Ref RestApi DependsOn: DocumentationPart