konnect.Api
API Resource
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as konnect from "@pulumi/konnect";
const myApi = new konnect.Api("myApi", {
    attributes: "{ \"see\": \"documentation\" }",
    description: "...my_description...",
    labels: {
        key: "value",
    },
    slug: "my-api-v1",
    specContent: "...my_spec_content...",
    version: "...my_version...",
});
import pulumi
import pulumi_konnect as konnect
my_api = konnect.Api("myApi",
    attributes="{ \"see\": \"documentation\" }",
    description="...my_description...",
    labels={
        "key": "value",
    },
    slug="my-api-v1",
    spec_content="...my_spec_content...",
    version="...my_version...")
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.NewApi(ctx, "myApi", &konnect.ApiArgs{
			Attributes:  pulumi.String("{ \"see\": \"documentation\" }"),
			Description: pulumi.String("...my_description..."),
			Labels: pulumi.StringMap{
				"key": pulumi.String("value"),
			},
			Slug:        pulumi.String("my-api-v1"),
			SpecContent: pulumi.String("...my_spec_content..."),
			Version:     pulumi.String("...my_version..."),
		})
		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 myApi = new Konnect.Api("myApi", new()
    {
        Attributes = "{ \"see\": \"documentation\" }",
        Description = "...my_description...",
        Labels = 
        {
            { "key", "value" },
        },
        Slug = "my-api-v1",
        SpecContent = "...my_spec_content...",
        Version = "...my_version...",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.konnect.Api;
import com.pulumi.konnect.ApiArgs;
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 myApi = new Api("myApi", ApiArgs.builder()
            .attributes("{ \"see\": \"documentation\" }")
            .description("...my_description...")
            .labels(Map.of("key", "value"))
            .slug("my-api-v1")
            .specContent("...my_spec_content...")
            .version("...my_version...")
            .build());
    }
}
resources:
  myApi:
    type: konnect:Api
    properties:
      attributes: '{ "see": "documentation" }'
      description: '...my_description...'
      labels:
        key: value
      slug: my-api-v1
      specContent: '...my_spec_content...'
      version: '...my_version...'
Create Api Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Api(name: string, args?: ApiArgs, opts?: CustomResourceOptions);@overload
def Api(resource_name: str,
        args: Optional[ApiArgs] = None,
        opts: Optional[ResourceOptions] = None)
@overload
def Api(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        attributes: Optional[str] = None,
        description: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        slug: Optional[str] = None,
        spec_content: Optional[str] = None,
        version: Optional[str] = None)func NewApi(ctx *Context, name string, args *ApiArgs, opts ...ResourceOption) (*Api, error)public Api(string name, ApiArgs? args = null, CustomResourceOptions? opts = null)type: konnect:Api
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 ApiArgs
- 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 ApiArgs
- 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 ApiArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiArgs
- 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 apiResource = new Konnect.Api("apiResource", new()
{
    Attributes = "string",
    Description = "string",
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
    Slug = "string",
    SpecContent = "string",
    Version = "string",
});
example, err := konnect.NewApi(ctx, "apiResource", &konnect.ApiArgs{
	Attributes:  pulumi.String("string"),
	Description: pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name:        pulumi.String("string"),
	Slug:        pulumi.String("string"),
	SpecContent: pulumi.String("string"),
	Version:     pulumi.String("string"),
})
var apiResource = new Api("apiResource", ApiArgs.builder()
    .attributes("string")
    .description("string")
    .labels(Map.of("string", "string"))
    .name("string")
    .slug("string")
    .specContent("string")
    .version("string")
    .build());
api_resource = konnect.Api("apiResource",
    attributes="string",
    description="string",
    labels={
        "string": "string",
    },
    name="string",
    slug="string",
    spec_content="string",
    version="string")
const apiResource = new konnect.Api("apiResource", {
    attributes: "string",
    description: "string",
    labels: {
        string: "string",
    },
    name: "string",
    slug: "string",
    specContent: "string",
    version: "string",
});
type: konnect:Api
properties:
    attributes: string
    description: string
    labels:
        string: string
    name: string
    slug: string
    specContent: string
    version: string
Api 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 Api resource accepts the following input properties:
- Attributes string
- A set of attributes that describe the API. Parsed as JSON.
- Description string
- A description of your API. Will be visible on your live Portal.
- Labels Dictionary<string, string>
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- Name string
- The name of your API. The name + versioncombination must be unique for each API you publish.
- Slug string
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- SpecContent string
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- Version string
- An optional version for your API. Leave this empty if your API is unversioned.
- Attributes string
- A set of attributes that describe the API. Parsed as JSON.
- Description string
- A description of your API. Will be visible on your live Portal.
- Labels map[string]string
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- Name string
- The name of your API. The name + versioncombination must be unique for each API you publish.
- Slug string
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- SpecContent string
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- Version string
- An optional version for your API. Leave this empty if your API is unversioned.
- attributes String
- A set of attributes that describe the API. Parsed as JSON.
- description String
- A description of your API. Will be visible on your live Portal.
- labels Map<String,String>
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- name String
- The name of your API. The name + versioncombination must be unique for each API you publish.
- slug String
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- specContent String
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- version String
- An optional version for your API. Leave this empty if your API is unversioned.
- attributes string
- A set of attributes that describe the API. Parsed as JSON.
- description string
- A description of your API. Will be visible on your live Portal.
- labels {[key: string]: string}
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- name string
- The name of your API. The name + versioncombination must be unique for each API you publish.
- slug string
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- specContent string
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- version string
- An optional version for your API. Leave this empty if your API is unversioned.
- attributes str
- A set of attributes that describe the API. Parsed as JSON.
- description str
- A description of your API. Will be visible on your live Portal.
- labels Mapping[str, str]
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- name str
- The name of your API. The name + versioncombination must be unique for each API you publish.
- slug str
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- spec_content str
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- version str
- An optional version for your API. Leave this empty if your API is unversioned.
- attributes String
- A set of attributes that describe the API. Parsed as JSON.
- description String
- A description of your API. Will be visible on your live Portal.
- labels Map<String>
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- name String
- The name of your API. The name + versioncombination must be unique for each API you publish.
- slug String
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- specContent String
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- version String
- An optional version for your API. Leave this empty if your API is unversioned.
Outputs
All input properties are implicitly available as output properties. Additionally, the Api resource produces the following output properties:
- ApiSpec List<string>Ids 
- The list of API specification ids for the API.
- CreatedAt string
- An ISO-8601 timestamp representation of entity creation date.
- Id string
- The provider-assigned unique ID for this managed resource.
- Portals
List<ApiPortal> 
- The list of portals which this API is published to.
- UpdatedAt string
- An ISO-8601 timestamp representation of entity update date.
- ApiSpec []stringIds 
- The list of API specification ids for the API.
- CreatedAt string
- An ISO-8601 timestamp representation of entity creation date.
- Id string
- The provider-assigned unique ID for this managed resource.
- Portals
[]ApiPortal 
- The list of portals which this API is published to.
- UpdatedAt string
- An ISO-8601 timestamp representation of entity update date.
- apiSpec List<String>Ids 
- The list of API specification ids for the API.
- createdAt String
- An ISO-8601 timestamp representation of entity creation date.
- id String
- The provider-assigned unique ID for this managed resource.
- portals
List<ApiPortal> 
- The list of portals which this API is published to.
- updatedAt String
- An ISO-8601 timestamp representation of entity update date.
- apiSpec string[]Ids 
- The list of API specification ids for the API.
- createdAt string
- An ISO-8601 timestamp representation of entity creation date.
- id string
- The provider-assigned unique ID for this managed resource.
- portals
ApiPortal[] 
- The list of portals which this API is published to.
- updatedAt string
- An ISO-8601 timestamp representation of entity update date.
- api_spec_ Sequence[str]ids 
- The list of API specification ids for the API.
- created_at str
- An ISO-8601 timestamp representation of entity creation date.
- id str
- The provider-assigned unique ID for this managed resource.
- portals
Sequence[ApiPortal] 
- The list of portals which this API is published to.
- updated_at str
- An ISO-8601 timestamp representation of entity update date.
- apiSpec List<String>Ids 
- The list of API specification ids for the API.
- createdAt String
- An ISO-8601 timestamp representation of entity creation date.
- id String
- The provider-assigned unique ID for this managed resource.
- portals List<Property Map>
- The list of portals which this API is published to.
- updatedAt String
- An ISO-8601 timestamp representation of entity update date.
Look up Existing Api Resource
Get an existing Api 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?: ApiState, opts?: CustomResourceOptions): Api@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_spec_ids: Optional[Sequence[str]] = None,
        attributes: Optional[str] = None,
        created_at: Optional[str] = None,
        description: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        portals: Optional[Sequence[ApiPortalArgs]] = None,
        slug: Optional[str] = None,
        spec_content: Optional[str] = None,
        updated_at: Optional[str] = None,
        version: Optional[str] = None) -> Apifunc GetApi(ctx *Context, name string, id IDInput, state *ApiState, opts ...ResourceOption) (*Api, error)public static Api Get(string name, Input<string> id, ApiState? state, CustomResourceOptions? opts = null)public static Api get(String name, Output<String> id, ApiState state, CustomResourceOptions options)resources:  _:    type: konnect:Api    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.
- ApiSpec List<string>Ids 
- The list of API specification ids for the API.
- Attributes string
- A set of attributes that describe the API. Parsed as JSON.
- CreatedAt string
- An ISO-8601 timestamp representation of entity creation date.
- Description string
- A description of your API. Will be visible on your live Portal.
- Labels Dictionary<string, string>
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- Name string
- The name of your API. The name + versioncombination must be unique for each API you publish.
- Portals
List<ApiPortal> 
- The list of portals which this API is published to.
- Slug string
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- SpecContent string
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- UpdatedAt string
- An ISO-8601 timestamp representation of entity update date.
- Version string
- An optional version for your API. Leave this empty if your API is unversioned.
- ApiSpec []stringIds 
- The list of API specification ids for the API.
- Attributes string
- A set of attributes that describe the API. Parsed as JSON.
- CreatedAt string
- An ISO-8601 timestamp representation of entity creation date.
- Description string
- A description of your API. Will be visible on your live Portal.
- Labels map[string]string
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- Name string
- The name of your API. The name + versioncombination must be unique for each API you publish.
- Portals
[]ApiPortal Args 
- The list of portals which this API is published to.
- Slug string
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- SpecContent string
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- UpdatedAt string
- An ISO-8601 timestamp representation of entity update date.
- Version string
- An optional version for your API. Leave this empty if your API is unversioned.
- apiSpec List<String>Ids 
- The list of API specification ids for the API.
- attributes String
- A set of attributes that describe the API. Parsed as JSON.
- createdAt String
- An ISO-8601 timestamp representation of entity creation date.
- description String
- A description of your API. Will be visible on your live Portal.
- labels Map<String,String>
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- name String
- The name of your API. The name + versioncombination must be unique for each API you publish.
- portals
List<ApiPortal> 
- The list of portals which this API is published to.
- slug String
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- specContent String
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- updatedAt String
- An ISO-8601 timestamp representation of entity update date.
- version String
- An optional version for your API. Leave this empty if your API is unversioned.
- apiSpec string[]Ids 
- The list of API specification ids for the API.
- attributes string
- A set of attributes that describe the API. Parsed as JSON.
- createdAt string
- An ISO-8601 timestamp representation of entity creation date.
- description string
- A description of your API. Will be visible on your live Portal.
- labels {[key: string]: string}
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- name string
- The name of your API. The name + versioncombination must be unique for each API you publish.
- portals
ApiPortal[] 
- The list of portals which this API is published to.
- slug string
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- specContent string
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- updatedAt string
- An ISO-8601 timestamp representation of entity update date.
- version string
- An optional version for your API. Leave this empty if your API is unversioned.
- api_spec_ Sequence[str]ids 
- The list of API specification ids for the API.
- attributes str
- A set of attributes that describe the API. Parsed as JSON.
- created_at str
- An ISO-8601 timestamp representation of entity creation date.
- description str
- A description of your API. Will be visible on your live Portal.
- labels Mapping[str, str]
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- name str
- The name of your API. The name + versioncombination must be unique for each API you publish.
- portals
Sequence[ApiPortal Args] 
- The list of portals which this API is published to.
- slug str
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- spec_content str
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- updated_at str
- An ISO-8601 timestamp representation of entity update date.
- version str
- An optional version for your API. Leave this empty if your API is unversioned.
- apiSpec List<String>Ids 
- The list of API specification ids for the API.
- attributes String
- A set of attributes that describe the API. Parsed as JSON.
- createdAt String
- An ISO-8601 timestamp representation of entity creation date.
- description String
- A description of your API. Will be visible on your live Portal.
- labels Map<String>
- Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
- name String
- The name of your API. The name + versioncombination must be unique for each API you publish.
- portals List<Property Map>
- The list of portals which this API is published to.
- slug String
- The slugis used in generated URLs to provide human readable paths. Defaults toslugify(name + version)
- specContent String
- The content of the API specification. This is the raw content of the API specification, in json or yaml. By including this field, you can add a API specification without having to make a separate call to update the API specification. Requires replacement if changed.
- updatedAt String
- An ISO-8601 timestamp representation of entity update date.
- version String
- An optional version for your API. Leave this empty if your API is unversioned.
Supporting Types
ApiPortal, ApiPortalArgs    
- DisplayName string
- The display name of the portal. This value will be the portal's namein Portal API.
- Id string
- The portal identifier.
- Name string
- The name of the portal, used to distinguish it from other portals.
- DisplayName string
- The display name of the portal. This value will be the portal's namein Portal API.
- Id string
- The portal identifier.
- Name string
- The name of the portal, used to distinguish it from other portals.
- displayName String
- The display name of the portal. This value will be the portal's namein Portal API.
- id String
- The portal identifier.
- name String
- The name of the portal, used to distinguish it from other portals.
- displayName string
- The display name of the portal. This value will be the portal's namein Portal API.
- id string
- The portal identifier.
- name string
- The name of the portal, used to distinguish it from other portals.
- display_name str
- The display name of the portal. This value will be the portal's namein Portal API.
- id str
- The portal identifier.
- name str
- The name of the portal, used to distinguish it from other portals.
- displayName String
- The display name of the portal. This value will be the portal's namein Portal API.
- id String
- The portal identifier.
- name String
- The name of the portal, used to distinguish it from other portals.
Import
In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:
terraform
import {
to = konnect_api.my_konnect_api
id = “9f5061ce-78f6-4452-9108-ad7c02821fd5”
}
The pulumi import command can be used, for example:
$ pulumi import konnect:index/api:Api my_konnect_api "9f5061ce-78f6-4452-9108-ad7c02821fd5"
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 konnectTerraform Provider.
