Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AWS Classic

v4.25.0 published on Friday, Oct 15, 2021 by Pulumi

DocumentationVersion

Provides a resource to manage an API Gateway Documentation Version.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleRestApi = new Aws.ApiGateway.RestApi("exampleRestApi", new Aws.ApiGateway.RestApiArgs
        {
        });
        var exampleDocumentationPart = new Aws.ApiGateway.DocumentationPart("exampleDocumentationPart", new Aws.ApiGateway.DocumentationPartArgs
        {
            Location = new Aws.ApiGateway.Inputs.DocumentationPartLocationArgs
            {
                Type = "API",
            },
            Properties = "{\"description\":\"Example\"}",
            RestApiId = exampleRestApi.Id,
        });
        var exampleDocumentationVersion = new Aws.ApiGateway.DocumentationVersion("exampleDocumentationVersion", new Aws.ApiGateway.DocumentationVersionArgs
        {
            Version = "example_version",
            RestApiId = exampleRestApi.Id,
            Description = "Example description",
        }, new CustomResourceOptions
        {
            DependsOn = 
            {
                exampleDocumentationPart,
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/apigateway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleRestApi, err := apigateway.NewRestApi(ctx, "exampleRestApi", nil)
		if err != nil {
			return err
		}
		exampleDocumentationPart, err := apigateway.NewDocumentationPart(ctx, "exampleDocumentationPart", &apigateway.DocumentationPartArgs{
			Location: &apigateway.DocumentationPartLocationArgs{
				Type: pulumi.String("API"),
			},
			Properties: pulumi.String("{\"description\":\"Example\"}"),
			RestApiId:  exampleRestApi.ID(),
		})
		if err != nil {
			return err
		}
		_, err = apigateway.NewDocumentationVersion(ctx, "exampleDocumentationVersion", &apigateway.DocumentationVersionArgs{
			Version:     pulumi.String("example_version"),
			RestApiId:   exampleRestApi.ID(),
			Description: pulumi.String("Example description"),
		}, pulumi.DependsOn([]pulumi.Resource{
			exampleDocumentationPart,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example_rest_api = aws.apigateway.RestApi("exampleRestApi")
example_documentation_part = aws.apigateway.DocumentationPart("exampleDocumentationPart",
    location=aws.apigateway.DocumentationPartLocationArgs(
        type="API",
    ),
    properties="{\"description\":\"Example\"}",
    rest_api_id=example_rest_api.id)
example_documentation_version = aws.apigateway.DocumentationVersion("exampleDocumentationVersion",
    version="example_version",
    rest_api_id=example_rest_api.id,
    description="Example description",
    opts=pulumi.ResourceOptions(depends_on=[example_documentation_part]))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleRestApi = new aws.apigateway.RestApi("exampleRestApi", {});
const exampleDocumentationPart = new aws.apigateway.DocumentationPart("exampleDocumentationPart", {
    location: {
        type: "API",
    },
    properties: "{\"description\":\"Example\"}",
    restApiId: exampleRestApi.id,
});
const exampleDocumentationVersion = new aws.apigateway.DocumentationVersion("exampleDocumentationVersion", {
    version: "example_version",
    restApiId: exampleRestApi.id,
    description: "Example description",
}, {
    dependsOn: [exampleDocumentationPart],
});

Create a DocumentationVersion Resource

new DocumentationVersion(name: string, args: DocumentationVersionArgs, opts?: CustomResourceOptions);
@overload
def DocumentationVersion(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         description: Optional[str] = None,
                         rest_api_id: Optional[str] = None,
                         version: Optional[str] = None)
@overload
def DocumentationVersion(resource_name: str,
                         args: DocumentationVersionArgs,
                         opts: Optional[ResourceOptions] = None)
func NewDocumentationVersion(ctx *Context, name string, args DocumentationVersionArgs, opts ...ResourceOption) (*DocumentationVersion, error)
public DocumentationVersion(string name, DocumentationVersionArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args DocumentationVersionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args DocumentationVersionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DocumentationVersionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DocumentationVersionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

DocumentationVersion Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The DocumentationVersion resource accepts the following input properties:

RestApiId string
The ID of the associated Rest API
Version string
The version identifier of the API documentation snapshot.
Description string
The description of the API documentation version.
RestApiId string
The ID of the associated Rest API
Version string
The version identifier of the API documentation snapshot.
Description string
The description of the API documentation version.
restApiId string
The ID of the associated Rest API
version string
The version identifier of the API documentation snapshot.
description string
The description of the API documentation version.
rest_api_id str
The ID of the associated Rest API
version str
The version identifier of the API documentation snapshot.
description str
The description of the API documentation version.

Outputs

All input properties are implicitly available as output properties. Additionally, the DocumentationVersion resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing DocumentationVersion Resource

Get an existing DocumentationVersion resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DocumentationVersionState, opts?: CustomResourceOptions): DocumentationVersion
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        rest_api_id: Optional[str] = None,
        version: Optional[str] = None) -> DocumentationVersion
func GetDocumentationVersion(ctx *Context, name string, id IDInput, state *DocumentationVersionState, opts ...ResourceOption) (*DocumentationVersion, error)
public static DocumentationVersion Get(string name, Input<string> id, DocumentationVersionState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Description string
The description of the API documentation version.
RestApiId string
The ID of the associated Rest API
Version string
The version identifier of the API documentation snapshot.
Description string
The description of the API documentation version.
RestApiId string
The ID of the associated Rest API
Version string
The version identifier of the API documentation snapshot.
description string
The description of the API documentation version.
restApiId string
The ID of the associated Rest API
version string
The version identifier of the API documentation snapshot.
description str
The description of the API documentation version.
rest_api_id str
The ID of the associated Rest API
version str
The version identifier of the API documentation snapshot.

Import

API Gateway documentation versions can be imported using REST-API-ID/VERSION, e.g.

 $ pulumi import aws:apigateway/documentationVersion:DocumentationVersion example 5i4e1ko720/example-version

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.