AWS CloudFormation
User Guide (Version )

AWS::ApiGateway::DocumentationPart

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 API entity that the documentation applies to.

Required: Yes

Type: 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 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.

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" }, "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

See Also