1. Packages
  2. Konnect Provider
  3. API Docs
  4. ApiVersion
konnect 3.1.0 published on Tuesday, Sep 2, 2025 by kong

konnect.ApiVersion

Explore with Pulumi AI

konnect logo
konnect 3.1.0 published on Tuesday, Sep 2, 2025 by kong

    APIVersion Resource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as konnect from "@pulumi/konnect";
    
    const myApiversion = new konnect.ApiVersion("myApiversion", {
        apiId: "9f5061ce-78f6-4452-9108-ad7c02821fd5",
        spec: {
            content: "{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Example API\",\"version\":\"1.0.0\"},\"paths\":{\"/example\":{\"get\":{\"summary\":\"Example endpoint\",\"responses\":{\"200\":{\"description\":\"Successful response\"}}}}}}",
        },
        version: "1.0.0",
    });
    
    import pulumi
    import pulumi_konnect as konnect
    
    my_apiversion = konnect.ApiVersion("myApiversion",
        api_id="9f5061ce-78f6-4452-9108-ad7c02821fd5",
        spec={
            "content": "{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Example API\",\"version\":\"1.0.0\"},\"paths\":{\"/example\":{\"get\":{\"summary\":\"Example endpoint\",\"responses\":{\"200\":{\"description\":\"Successful response\"}}}}}}",
        },
        version="1.0.0")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/konnect/v3/konnect"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := konnect.NewApiVersion(ctx, "myApiversion", &konnect.ApiVersionArgs{
    			ApiId: pulumi.String("9f5061ce-78f6-4452-9108-ad7c02821fd5"),
    			Spec: &konnect.ApiVersionSpecArgs{
    				Content: pulumi.String("{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Example API\",\"version\":\"1.0.0\"},\"paths\":{\"/example\":{\"get\":{\"summary\":\"Example endpoint\",\"responses\":{\"200\":{\"description\":\"Successful response\"}}}}}}"),
    			},
    			Version: pulumi.String("1.0.0"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Konnect = Pulumi.Konnect;
    
    return await Deployment.RunAsync(() => 
    {
        var myApiversion = new Konnect.ApiVersion("myApiversion", new()
        {
            ApiId = "9f5061ce-78f6-4452-9108-ad7c02821fd5",
            Spec = new Konnect.Inputs.ApiVersionSpecArgs
            {
                Content = "{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Example API\",\"version\":\"1.0.0\"},\"paths\":{\"/example\":{\"get\":{\"summary\":\"Example endpoint\",\"responses\":{\"200\":{\"description\":\"Successful response\"}}}}}}",
            },
            Version = "1.0.0",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.konnect.ApiVersion;
    import com.pulumi.konnect.ApiVersionArgs;
    import com.pulumi.konnect.inputs.ApiVersionSpecArgs;
    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 myApiversion = new ApiVersion("myApiversion", ApiVersionArgs.builder()
                .apiId("9f5061ce-78f6-4452-9108-ad7c02821fd5")
                .spec(ApiVersionSpecArgs.builder()
                    .content("{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Example API\",\"version\":\"1.0.0\"},\"paths\":{\"/example\":{\"get\":{\"summary\":\"Example endpoint\",\"responses\":{\"200\":{\"description\":\"Successful response\"}}}}}}")
                    .build())
                .version("1.0.0")
                .build());
    
        }
    }
    
    resources:
      myApiversion:
        type: konnect:ApiVersion
        properties:
          apiId: 9f5061ce-78f6-4452-9108-ad7c02821fd5
          spec:
            content: '{"openapi":"3.0.3","info":{"title":"Example API","version":"1.0.0"},"paths":{"/example":{"get":{"summary":"Example endpoint","responses":{"200":{"description":"Successful response"}}}}}}'
          version: 1.0.0
    

    Create ApiVersion Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ApiVersion(name: string, args: ApiVersionArgs, opts?: CustomResourceOptions);
    @overload
    def ApiVersion(resource_name: str,
                   args: ApiVersionArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApiVersion(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   api_id: Optional[str] = None,
                   spec: Optional[ApiVersionSpecArgs] = None,
                   version: Optional[str] = None)
    func NewApiVersion(ctx *Context, name string, args ApiVersionArgs, opts ...ResourceOption) (*ApiVersion, error)
    public ApiVersion(string name, ApiVersionArgs args, CustomResourceOptions? opts = null)
    public ApiVersion(String name, ApiVersionArgs args)
    public ApiVersion(String name, ApiVersionArgs args, CustomResourceOptions options)
    
    type: konnect:ApiVersion
    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 ApiVersionArgs
    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 ApiVersionArgs
    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 ApiVersionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApiVersionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApiVersionArgs
    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 apiVersionResource = new Konnect.ApiVersion("apiVersionResource", new()
    {
        ApiId = "string",
        Spec = new Konnect.Inputs.ApiVersionSpecArgs
        {
            Content = "string",
            Type = "string",
            ValidationMessages = new[]
            {
                new Konnect.Inputs.ApiVersionSpecValidationMessageArgs
                {
                    Message = "string",
                },
            },
        },
        Version = "string",
    });
    
    example, err := konnect.NewApiVersion(ctx, "apiVersionResource", &konnect.ApiVersionArgs{
    	ApiId: pulumi.String("string"),
    	Spec: &konnect.ApiVersionSpecArgs{
    		Content: pulumi.String("string"),
    		Type:    pulumi.String("string"),
    		ValidationMessages: konnect.ApiVersionSpecValidationMessageArray{
    			&konnect.ApiVersionSpecValidationMessageArgs{
    				Message: pulumi.String("string"),
    			},
    		},
    	},
    	Version: pulumi.String("string"),
    })
    
    var apiVersionResource = new ApiVersion("apiVersionResource", ApiVersionArgs.builder()
        .apiId("string")
        .spec(ApiVersionSpecArgs.builder()
            .content("string")
            .type("string")
            .validationMessages(ApiVersionSpecValidationMessageArgs.builder()
                .message("string")
                .build())
            .build())
        .version("string")
        .build());
    
    api_version_resource = konnect.ApiVersion("apiVersionResource",
        api_id="string",
        spec={
            "content": "string",
            "type": "string",
            "validation_messages": [{
                "message": "string",
            }],
        },
        version="string")
    
    const apiVersionResource = new konnect.ApiVersion("apiVersionResource", {
        apiId: "string",
        spec: {
            content: "string",
            type: "string",
            validationMessages: [{
                message: "string",
            }],
        },
        version: "string",
    });
    
    type: konnect:ApiVersion
    properties:
        apiId: string
        spec:
            content: string
            type: string
            validationMessages:
                - message: string
        version: string
    

    ApiVersion Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ApiVersion resource accepts the following input properties:

    ApiId string
    The UUID API identifier
    Spec ApiVersionSpec
    Version string
    The version of the api.
    ApiId string
    The UUID API identifier
    Spec ApiVersionSpecArgs
    Version string
    The version of the api.
    apiId String
    The UUID API identifier
    spec ApiVersionSpec
    version String
    The version of the api.
    apiId string
    The UUID API identifier
    spec ApiVersionSpec
    version string
    The version of the api.
    api_id str
    The UUID API identifier
    spec ApiVersionSpecArgs
    version str
    The version of the api.
    apiId String
    The UUID API identifier
    spec Property Map
    version String
    The version of the api.

    Outputs

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

    CreatedAt string
    An ISO-8601 timestamp representation of entity creation date.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt string
    An ISO-8601 timestamp representation of entity update date.
    CreatedAt string
    An ISO-8601 timestamp representation of entity creation date.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt string
    An ISO-8601 timestamp representation of entity update date.
    createdAt String
    An ISO-8601 timestamp representation of entity creation date.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt String
    An ISO-8601 timestamp representation of entity update date.
    createdAt string
    An ISO-8601 timestamp representation of entity creation date.
    id string
    The provider-assigned unique ID for this managed resource.
    updatedAt string
    An ISO-8601 timestamp representation of entity update date.
    created_at str
    An ISO-8601 timestamp representation of entity creation date.
    id str
    The provider-assigned unique ID for this managed resource.
    updated_at str
    An ISO-8601 timestamp representation of entity update date.
    createdAt String
    An ISO-8601 timestamp representation of entity creation date.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt String
    An ISO-8601 timestamp representation of entity update date.

    Look up Existing ApiVersion Resource

    Get an existing ApiVersion 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?: ApiVersionState, opts?: CustomResourceOptions): ApiVersion
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_id: Optional[str] = None,
            created_at: Optional[str] = None,
            spec: Optional[ApiVersionSpecArgs] = None,
            updated_at: Optional[str] = None,
            version: Optional[str] = None) -> ApiVersion
    func GetApiVersion(ctx *Context, name string, id IDInput, state *ApiVersionState, opts ...ResourceOption) (*ApiVersion, error)
    public static ApiVersion Get(string name, Input<string> id, ApiVersionState? state, CustomResourceOptions? opts = null)
    public static ApiVersion get(String name, Output<String> id, ApiVersionState state, CustomResourceOptions options)
    resources:  _:    type: konnect:ApiVersion    get:      id: ${id}
    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:
    ApiId string
    The UUID API identifier
    CreatedAt string
    An ISO-8601 timestamp representation of entity creation date.
    Spec ApiVersionSpec
    UpdatedAt string
    An ISO-8601 timestamp representation of entity update date.
    Version string
    The version of the api.
    ApiId string
    The UUID API identifier
    CreatedAt string
    An ISO-8601 timestamp representation of entity creation date.
    Spec ApiVersionSpecArgs
    UpdatedAt string
    An ISO-8601 timestamp representation of entity update date.
    Version string
    The version of the api.
    apiId String
    The UUID API identifier
    createdAt String
    An ISO-8601 timestamp representation of entity creation date.
    spec ApiVersionSpec
    updatedAt String
    An ISO-8601 timestamp representation of entity update date.
    version String
    The version of the api.
    apiId string
    The UUID API identifier
    createdAt string
    An ISO-8601 timestamp representation of entity creation date.
    spec ApiVersionSpec
    updatedAt string
    An ISO-8601 timestamp representation of entity update date.
    version string
    The version of the api.
    api_id str
    The UUID API identifier
    created_at str
    An ISO-8601 timestamp representation of entity creation date.
    spec ApiVersionSpecArgs
    updated_at str
    An ISO-8601 timestamp representation of entity update date.
    version str
    The version of the api.
    apiId String
    The UUID API identifier
    createdAt String
    An ISO-8601 timestamp representation of entity creation date.
    spec Property Map
    updatedAt String
    An ISO-8601 timestamp representation of entity update date.
    version String
    The version of the api.

    Supporting Types

    ApiVersionSpec, ApiVersionSpecArgs

    Content string
    The raw content of your API spec, in json or yaml format (OpenAPI or AsyncAPI).
    Type string
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    ValidationMessages List<ApiVersionSpecValidationMessage>
    The errors that occurred while parsing the API version spec.
    Content string
    The raw content of your API spec, in json or yaml format (OpenAPI or AsyncAPI).
    Type string
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    ValidationMessages []ApiVersionSpecValidationMessage
    The errors that occurred while parsing the API version spec.
    content String
    The raw content of your API spec, in json or yaml format (OpenAPI or AsyncAPI).
    type String
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    validationMessages List<ApiVersionSpecValidationMessage>
    The errors that occurred while parsing the API version spec.
    content string
    The raw content of your API spec, in json or yaml format (OpenAPI or AsyncAPI).
    type string
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    validationMessages ApiVersionSpecValidationMessage[]
    The errors that occurred while parsing the API version spec.
    content str
    The raw content of your API spec, in json or yaml format (OpenAPI or AsyncAPI).
    type str
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    validation_messages Sequence[ApiVersionSpecValidationMessage]
    The errors that occurred while parsing the API version spec.
    content String
    The raw content of your API spec, in json or yaml format (OpenAPI or AsyncAPI).
    type String
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    validationMessages List<Property Map>
    The errors that occurred while parsing the API version spec.

    ApiVersionSpecValidationMessage, ApiVersionSpecValidationMessageArgs

    Message string
    Message string
    message String
    message string
    message String

    Import

    $ pulumi import konnect:index/apiVersion:ApiVersion my_konnect_api_version '{"api_id": "9f5061ce-78f6-4452-9108-ad7c02821fd5", "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a"}'
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    konnect kong/terraform-provider-konnect
    License
    Notes
    This Pulumi package is based on the konnect Terraform Provider.
    konnect logo
    konnect 3.1.0 published on Tuesday, Sep 2, 2025 by kong