aws.apigateway.DocumentationVersion
Explore with Pulumi AI
Provides a resource to manage an API Gateway Documentation Version.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleRestApi = new aws.apigateway.RestApi("example", {name: "example_api"});
const exampleDocumentationPart = new aws.apigateway.DocumentationPart("example", {
location: {
type: "API",
},
properties: "{\"description\":\"Example\"}",
restApiId: exampleRestApi.id,
});
const example = new aws.apigateway.DocumentationVersion("example", {
version: "example_version",
restApiId: exampleRestApi.id,
description: "Example description",
}, {
dependsOn: [exampleDocumentationPart],
});
import pulumi
import pulumi_aws as aws
example_rest_api = aws.apigateway.RestApi("example", name="example_api")
example_documentation_part = aws.apigateway.DocumentationPart("example",
location={
"type": "API",
},
properties="{\"description\":\"Example\"}",
rest_api_id=example_rest_api.id)
example = aws.apigateway.DocumentationVersion("example",
version="example_version",
rest_api_id=example_rest_api.id,
description="Example description",
opts = pulumi.ResourceOptions(depends_on=[example_documentation_part]))
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/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, "example", &apigateway.RestApiArgs{
Name: pulumi.String("example_api"),
})
if err != nil {
return err
}
exampleDocumentationPart, err := apigateway.NewDocumentationPart(ctx, "example", &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, "example", &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
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var exampleRestApi = new Aws.ApiGateway.RestApi("example", new()
{
Name = "example_api",
});
var exampleDocumentationPart = new Aws.ApiGateway.DocumentationPart("example", new()
{
Location = new Aws.ApiGateway.Inputs.DocumentationPartLocationArgs
{
Type = "API",
},
Properties = "{\"description\":\"Example\"}",
RestApiId = exampleRestApi.Id,
});
var example = new Aws.ApiGateway.DocumentationVersion("example", new()
{
Version = "example_version",
RestApiId = exampleRestApi.Id,
Description = "Example description",
}, new CustomResourceOptions
{
DependsOn =
{
exampleDocumentationPart,
},
});
});
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.RestApiArgs;
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", RestApiArgs.builder()
.name("example_api")
.build());
var exampleDocumentationPart = new DocumentationPart("exampleDocumentationPart", DocumentationPartArgs.builder()
.location(DocumentationPartLocationArgs.builder()
.type("API")
.build())
.properties("{\"description\":\"Example\"}")
.restApiId(exampleRestApi.id())
.build());
var example = new DocumentationVersion("example", DocumentationVersionArgs.builder()
.version("example_version")
.restApiId(exampleRestApi.id())
.description("Example description")
.build(), CustomResourceOptions.builder()
.dependsOn(exampleDocumentationPart)
.build());
}
}
resources:
example:
type: aws:apigateway:DocumentationVersion
properties:
version: example_version
restApiId: ${exampleRestApi.id}
description: Example description
options:
dependson:
- ${exampleDocumentationPart}
exampleRestApi:
type: aws:apigateway:RestApi
name: example
properties:
name: example_api
exampleDocumentationPart:
type: aws:apigateway:DocumentationPart
name: example
properties:
location:
type: API
properties: '{"description":"Example"}'
restApiId: ${exampleRestApi.id}
Create DocumentationVersion Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DocumentationVersion(name: string, args: DocumentationVersionArgs, opts?: CustomResourceOptions);
@overload
def DocumentationVersion(resource_name: str,
args: DocumentationVersionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DocumentationVersion(resource_name: str,
opts: Optional[ResourceOptions] = None,
rest_api_id: Optional[str] = None,
version: Optional[str] = None,
description: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var documentationVersionResource = new Aws.ApiGateway.DocumentationVersion("documentationVersionResource", new()
{
RestApiId = "string",
Version = "string",
Description = "string",
});
example, err := apigateway.NewDocumentationVersion(ctx, "documentationVersionResource", &apigateway.DocumentationVersionArgs{
RestApiId: pulumi.String("string"),
Version: pulumi.String("string"),
Description: pulumi.String("string"),
})
var documentationVersionResource = new DocumentationVersion("documentationVersionResource", DocumentationVersionArgs.builder()
.restApiId("string")
.version("string")
.description("string")
.build());
documentation_version_resource = aws.apigateway.DocumentationVersion("documentationVersionResource",
rest_api_id="string",
version="string",
description="string")
const documentationVersionResource = new aws.apigateway.DocumentationVersion("documentationVersionResource", {
restApiId: "string",
version: "string",
description: "string",
});
type: aws:apigateway:DocumentationVersion
properties:
description: string
restApiId: string
version: string
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:
- Rest
Api stringId - 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 stringId - 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 StringId - 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 stringId - 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_ strid - ID of the associated Rest API
- version str
- Version identifier of the API documentation snapshot.
- description str
- Description of the API documentation version.
- rest
Api StringId - 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.
- Description string
- Description of the API documentation version.
- Rest
Api stringId - 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 stringId - 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 StringId - 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 stringId - 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_ strid - ID of the associated Rest API
- version str
- Version identifier of the API documentation snapshot.
- description String
- Description of the API documentation version.
- rest
Api StringId - ID of the associated Rest API
- version String
- Version identifier of the API documentation snapshot.
Import
Using pulumi import
, import API Gateway documentation versions using REST-API-ID/VERSION
. For example:
$ pulumi import aws:apigateway/documentationVersion:DocumentationVersion example 5i4e1ko720/example-version
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.