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 exampleDocumentationVersion = new Aws.ApiGateway.DocumentationVersion("exampleDocumentationVersion", new Aws.ApiGateway.DocumentationVersionArgs
{
Description = "Example description",
RestApiId = exampleRestApi.Id,
Version = "example_version",
}, new CustomResourceOptions
{
DependsOn =
{
"aws_api_gateway_documentation_part.example",
},
});
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,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleRestApi, err := apigateway.NewRestApi(ctx, "exampleRestApi", nil)
if err != nil {
return err
}
_, err = apigateway.NewDocumentationVersion(ctx, "exampleDocumentationVersion", &apigateway.DocumentationVersionArgs{
Description: pulumi.String("Example description"),
RestApiId: exampleRestApi.ID(),
Version: pulumi.String("example_version"),
}, pulumi.DependsOn([]pulumi.Resource{
"aws_api_gateway_documentation_part.example",
}))
if err != nil {
return err
}
_, 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
}
return nil
})
}import pulumi
import pulumi_aws as aws
example_rest_api = aws.apigateway.RestApi("exampleRestApi")
example_documentation_version = aws.apigateway.DocumentationVersion("exampleDocumentationVersion",
description="Example description",
rest_api_id=example_rest_api.id,
version="example_version",
opts=ResourceOptions(depends_on=["aws_api_gateway_documentation_part.example"]))
example_documentation_part = aws.apigateway.DocumentationPart("exampleDocumentationPart",
location={
"type": "API",
},
properties="{\"description\":\"Example\"}",
rest_api_id=example_rest_api.id)import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleRestApi = new aws.apigateway.RestApi("example", {});
const exampleDocumentationPart = new aws.apigateway.DocumentationPart("example", {
location: {
type: "API",
},
properties: "{\"description\":\"Example\"}",
restApiId: exampleRestApi.id,
});
const exampleDocumentationVersion = new aws.apigateway.DocumentationVersion("example", {
description: "Example description",
restApiId: exampleRestApi.id,
version: "example_version",
}, { dependsOn: [exampleDocumentationPart] });Create a DocumentationVersion Resource
new DocumentationVersion(name: string, args: DocumentationVersionArgs, opts?: CustomResourceOptions);def DocumentationVersion(resource_name, opts=None, description=None, rest_api_id=None, version=None, __props__=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.
- opts ResourceOptions
- A bag of options that control this 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 Programming Model docs.
Inputs
The DocumentationVersion resource accepts the following input properties:
- rest_
api_ strid 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:
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): DocumentationVersionstatic get(resource_name, id, opts=None, description=None, rest_api_id=None, version=None, __props__=None);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 str
The description of the API documentation version.
- rest_
api_ strid The ID of the associated Rest API
- version str
The version identifier of the API documentation snapshot.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.