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

konnect.ApiSpecification

Explore with Pulumi AI

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

    APISpecification Resource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as konnect from "@pulumi/konnect";
    
    const myApispecification = new konnect.ApiSpecification("myApispecification", {
        apiId: "9f5061ce-78f6-4452-9108-ad7c02821fd5",
        content: "{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Example API\",\"version\":\"1.0.0\"},\"paths\":{\"/example\":{\"get\":{\"summary\":\"Example endpoint\",\"responses\":{\"200\":{\"description\":\"Successful response\"}}}}}}",
        type: "oas3",
    });
    
    import pulumi
    import pulumi_konnect as konnect
    
    my_apispecification = konnect.ApiSpecification("myApispecification",
        api_id="9f5061ce-78f6-4452-9108-ad7c02821fd5",
        content="{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Example API\",\"version\":\"1.0.0\"},\"paths\":{\"/example\":{\"get\":{\"summary\":\"Example endpoint\",\"responses\":{\"200\":{\"description\":\"Successful response\"}}}}}}",
        type="oas3")
    
    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.NewApiSpecification(ctx, "myApispecification", &konnect.ApiSpecificationArgs{
    			ApiId:   pulumi.String("9f5061ce-78f6-4452-9108-ad7c02821fd5"),
    			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\"}}}}}}"),
    			Type:    pulumi.String("oas3"),
    		})
    		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 myApispecification = new Konnect.ApiSpecification("myApispecification", new()
        {
            ApiId = "9f5061ce-78f6-4452-9108-ad7c02821fd5",
            Content = "{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Example API\",\"version\":\"1.0.0\"},\"paths\":{\"/example\":{\"get\":{\"summary\":\"Example endpoint\",\"responses\":{\"200\":{\"description\":\"Successful response\"}}}}}}",
            Type = "oas3",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.konnect.ApiSpecification;
    import com.pulumi.konnect.ApiSpecificationArgs;
    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 myApispecification = new ApiSpecification("myApispecification", ApiSpecificationArgs.builder()
                .apiId("9f5061ce-78f6-4452-9108-ad7c02821fd5")
                .content("{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Example API\",\"version\":\"1.0.0\"},\"paths\":{\"/example\":{\"get\":{\"summary\":\"Example endpoint\",\"responses\":{\"200\":{\"description\":\"Successful response\"}}}}}}")
                .type("oas3")
                .build());
    
        }
    }
    
    resources:
      myApispecification:
        type: konnect:ApiSpecification
        properties:
          apiId: 9f5061ce-78f6-4452-9108-ad7c02821fd5
          content: '{"openapi":"3.0.3","info":{"title":"Example API","version":"1.0.0"},"paths":{"/example":{"get":{"summary":"Example endpoint","responses":{"200":{"description":"Successful response"}}}}}}'
          type: oas3
    

    Create ApiSpecification Resource

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

    Constructor syntax

    new ApiSpecification(name: string, args: ApiSpecificationArgs, opts?: CustomResourceOptions);
    @overload
    def ApiSpecification(resource_name: str,
                         args: ApiSpecificationArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApiSpecification(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         api_id: Optional[str] = None,
                         content: Optional[str] = None,
                         type: Optional[str] = None)
    func NewApiSpecification(ctx *Context, name string, args ApiSpecificationArgs, opts ...ResourceOption) (*ApiSpecification, error)
    public ApiSpecification(string name, ApiSpecificationArgs args, CustomResourceOptions? opts = null)
    public ApiSpecification(String name, ApiSpecificationArgs args)
    public ApiSpecification(String name, ApiSpecificationArgs args, CustomResourceOptions options)
    
    type: konnect:ApiSpecification
    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 ApiSpecificationArgs
    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 ApiSpecificationArgs
    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 ApiSpecificationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApiSpecificationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApiSpecificationArgs
    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 apiSpecificationResource = new Konnect.ApiSpecification("apiSpecificationResource", new()
    {
        ApiId = "string",
        Content = "string",
        Type = "string",
    });
    
    example, err := konnect.NewApiSpecification(ctx, "apiSpecificationResource", &konnect.ApiSpecificationArgs{
    	ApiId:   pulumi.String("string"),
    	Content: pulumi.String("string"),
    	Type:    pulumi.String("string"),
    })
    
    var apiSpecificationResource = new ApiSpecification("apiSpecificationResource", ApiSpecificationArgs.builder()
        .apiId("string")
        .content("string")
        .type("string")
        .build());
    
    api_specification_resource = konnect.ApiSpecification("apiSpecificationResource",
        api_id="string",
        content="string",
        type="string")
    
    const apiSpecificationResource = new konnect.ApiSpecification("apiSpecificationResource", {
        apiId: "string",
        content: "string",
        type: "string",
    });
    
    type: konnect:ApiSpecification
    properties:
        apiId: string
        content: string
        type: string
    

    ApiSpecification 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 ApiSpecification resource accepts the following input properties:

    ApiId string
    The UUID API identifier
    Content string
    The raw content of your API specification, 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"]
    ApiId string
    The UUID API identifier
    Content string
    The raw content of your API specification, 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"]
    apiId String
    The UUID API identifier
    content String
    The raw content of your API specification, 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"]
    apiId string
    The UUID API identifier
    content string
    The raw content of your API specification, 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"]
    api_id str
    The UUID API identifier
    content str
    The raw content of your API specification, 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"]
    apiId String
    The UUID API identifier
    content String
    The raw content of your API specification, 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"]

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ApiSpecification 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.
    ValidationMessages List<ApiSpecificationValidationMessage>
    The errors that occurred while parsing the API specification.
    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.
    ValidationMessages []ApiSpecificationValidationMessage
    The errors that occurred while parsing the API specification.
    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.
    validationMessages List<ApiSpecificationValidationMessage>
    The errors that occurred while parsing the API specification.
    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.
    validationMessages ApiSpecificationValidationMessage[]
    The errors that occurred while parsing the API specification.
    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.
    validation_messages Sequence[ApiSpecificationValidationMessage]
    The errors that occurred while parsing the API specification.
    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.
    validationMessages List<Property Map>
    The errors that occurred while parsing the API specification.

    Look up Existing ApiSpecification Resource

    Get an existing ApiSpecification 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?: ApiSpecificationState, opts?: CustomResourceOptions): ApiSpecification
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_id: Optional[str] = None,
            content: Optional[str] = None,
            created_at: Optional[str] = None,
            type: Optional[str] = None,
            updated_at: Optional[str] = None,
            validation_messages: Optional[Sequence[ApiSpecificationValidationMessageArgs]] = None) -> ApiSpecification
    func GetApiSpecification(ctx *Context, name string, id IDInput, state *ApiSpecificationState, opts ...ResourceOption) (*ApiSpecification, error)
    public static ApiSpecification Get(string name, Input<string> id, ApiSpecificationState? state, CustomResourceOptions? opts = null)
    public static ApiSpecification get(String name, Output<String> id, ApiSpecificationState state, CustomResourceOptions options)
    resources:  _:    type: konnect:ApiSpecification    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
    Content string
    The raw content of your API specification, in json or yaml format (OpenAPI or AsyncAPI).
    CreatedAt string
    An ISO-8601 timestamp representation of entity creation date.
    Type string
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    UpdatedAt string
    An ISO-8601 timestamp representation of entity update date.
    ValidationMessages List<ApiSpecificationValidationMessage>
    The errors that occurred while parsing the API specification.
    ApiId string
    The UUID API identifier
    Content string
    The raw content of your API specification, in json or yaml format (OpenAPI or AsyncAPI).
    CreatedAt string
    An ISO-8601 timestamp representation of entity creation date.
    Type string
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    UpdatedAt string
    An ISO-8601 timestamp representation of entity update date.
    ValidationMessages []ApiSpecificationValidationMessageArgs
    The errors that occurred while parsing the API specification.
    apiId String
    The UUID API identifier
    content String
    The raw content of your API specification, in json or yaml format (OpenAPI or AsyncAPI).
    createdAt String
    An ISO-8601 timestamp representation of entity creation date.
    type String
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    updatedAt String
    An ISO-8601 timestamp representation of entity update date.
    validationMessages List<ApiSpecificationValidationMessage>
    The errors that occurred while parsing the API specification.
    apiId string
    The UUID API identifier
    content string
    The raw content of your API specification, in json or yaml format (OpenAPI or AsyncAPI).
    createdAt string
    An ISO-8601 timestamp representation of entity creation date.
    type string
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    updatedAt string
    An ISO-8601 timestamp representation of entity update date.
    validationMessages ApiSpecificationValidationMessage[]
    The errors that occurred while parsing the API specification.
    api_id str
    The UUID API identifier
    content str
    The raw content of your API specification, in json or yaml format (OpenAPI or AsyncAPI).
    created_at str
    An ISO-8601 timestamp representation of entity creation date.
    type str
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    updated_at str
    An ISO-8601 timestamp representation of entity update date.
    validation_messages Sequence[ApiSpecificationValidationMessageArgs]
    The errors that occurred while parsing the API specification.
    apiId String
    The UUID API identifier
    content String
    The raw content of your API specification, in json or yaml format (OpenAPI or AsyncAPI).
    createdAt String
    An ISO-8601 timestamp representation of entity creation date.
    type String
    The type of specification being stored. This allows us to render the specification correctly. must be one of ["oas2", "oas3", "asyncapi"]
    updatedAt String
    An ISO-8601 timestamp representation of entity update date.
    validationMessages List<Property Map>
    The errors that occurred while parsing the API specification.

    Supporting Types

    ApiSpecificationValidationMessage, ApiSpecificationValidationMessageArgs

    Message string
    Message string
    message String
    message string
    message String

    Import

    $ pulumi import konnect:index/apiSpecification:ApiSpecification my_konnect_api_specification '{"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