DocumentationVersion

Provides a resource to manage an API Gateway Documentation Version.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var exampleRestApi = new Aws.ApiGateway.RestApi("exampleRestApi");

    var exampleDocumentationPart = new Aws.ApiGateway.DocumentationPart("exampleDocumentationPart", new()
    {
        Location = new Aws.ApiGateway.Inputs.DocumentationPartLocationArgs
        {
            Type = "API",
        },
        Properties = "{\"description\":\"Example\"}",
        RestApiId = exampleRestApi.Id,
    });

    var exampleDocumentationVersion = new Aws.ApiGateway.DocumentationVersion("exampleDocumentationVersion", new()
    {
        Version = "example_version",
        RestApiId = exampleRestApi.Id,
        Description = "Example description",
    }, new CustomResourceOptions
    {
        DependsOn = new[]
        {
            exampleDocumentationPart,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.RestApi;
import com.pulumi.aws.apigateway.DocumentationPart;
import com.pulumi.aws.apigateway.DocumentationPartArgs;
import com.pulumi.aws.apigateway.inputs.DocumentationPartLocationArgs;
import com.pulumi.aws.apigateway.DocumentationVersion;
import com.pulumi.aws.apigateway.DocumentationVersionArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleRestApi = new RestApi("exampleRestApi");

        var exampleDocumentationPart = new DocumentationPart("exampleDocumentationPart", DocumentationPartArgs.builder()        
            .location(DocumentationPartLocationArgs.builder()
                .type("API")
                .build())
            .properties("{\"description\":\"Example\"}")
            .restApiId(exampleRestApi.id())
            .build());

        var exampleDocumentationVersion = new DocumentationVersion("exampleDocumentationVersion", DocumentationVersionArgs.builder()        
            .version("example_version")
            .restApiId(exampleRestApi.id())
            .description("Example description")
            .build(), CustomResourceOptions.builder()
                .dependsOn(exampleDocumentationPart)
                .build());

    }
}
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],
});
resources:
  exampleDocumentationVersion:
    type: aws:apigateway:DocumentationVersion
    properties:
      version: example_version
      restApiId: ${exampleRestApi.id}
      description: Example description
    options:
      dependson:
        - ${exampleDocumentationPart}
  exampleRestApi:
    type: aws:apigateway:RestApi
  exampleDocumentationPart:
    type: aws:apigateway:DocumentationPart
    properties:
      location:
        type: API
      properties: '{"description":"Example"}'
      restApiId: ${exampleRestApi.id}

Create 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)
public DocumentationVersion(String name, DocumentationVersionArgs args)
public DocumentationVersion(String name, DocumentationVersionArgs args, CustomResourceOptions options)
type: aws:apigateway:DocumentationVersion
properties: # The arguments to resource properties.
options: # 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.
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.
name String
The unique name of the resource.
args DocumentationVersionArgs
The arguments to resource properties.
options 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

ID of the associated Rest API

Version string

Version identifier of the API documentation snapshot.

Description string

Description of the API documentation version.

RestApiId string

ID of the associated Rest API

Version string

Version identifier of the API documentation snapshot.

Description string

Description of the API documentation version.

restApiId String

ID of the associated Rest API

version String

Version identifier of the API documentation snapshot.

description String

Description of the API documentation version.

restApiId string

ID of the associated Rest API

version string

Version identifier of the API documentation snapshot.

description string

Description of the API documentation version.

rest_api_id str

ID of the associated Rest API

version str

Version identifier of the API documentation snapshot.

description str

Description of the API documentation version.

restApiId String

ID of the associated Rest API

version String

Version identifier of the API documentation snapshot.

description String

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 string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up 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)
public static DocumentationVersion get(String name, Output<String> id, DocumentationVersionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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

Description of the API documentation version.

RestApiId string

ID of the associated Rest API

Version string

Version identifier of the API documentation snapshot.

Description string

Description of the API documentation version.

RestApiId string

ID of the associated Rest API

Version string

Version identifier of the API documentation snapshot.

description String

Description of the API documentation version.

restApiId String

ID of the associated Rest API

version String

Version identifier of the API documentation snapshot.

description string

Description of the API documentation version.

restApiId string

ID of the associated Rest API

version string

Version identifier of the API documentation snapshot.

description str

Description of the API documentation version.

rest_api_id str

ID of the associated Rest API

version str

Version identifier of the API documentation snapshot.

description String

Description of the API documentation version.

restApiId String

ID of the associated Rest API

version String

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.