konnect.ApiSpecification
Explore with Pulumi AI
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:
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiSpecification resource produces the following output properties:
- Created
At string - An ISO-8601 timestamp representation of entity creation date.
- Id string
- The provider-assigned unique ID for this managed resource.
- Updated
At string - An ISO-8601 timestamp representation of entity update date.
- Validation
Messages List<ApiSpecification Validation Message> - The errors that occurred while parsing the API specification.
- Created
At string - An ISO-8601 timestamp representation of entity creation date.
- Id string
- The provider-assigned unique ID for this managed resource.
- Updated
At string - An ISO-8601 timestamp representation of entity update date.
- Validation
Messages []ApiSpecification Validation Message - The errors that occurred while parsing the API specification.
- created
At String - An ISO-8601 timestamp representation of entity creation date.
- id String
- The provider-assigned unique ID for this managed resource.
- updated
At String - An ISO-8601 timestamp representation of entity update date.
- validation
Messages List<ApiSpecification Validation Message> - The errors that occurred while parsing the API specification.
- created
At string - An ISO-8601 timestamp representation of entity creation date.
- id string
- The provider-assigned unique ID for this managed resource.
- updated
At string - An ISO-8601 timestamp representation of entity update date.
- validation
Messages ApiSpecification Validation Message[] - 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[ApiSpecification Validation Message] - The errors that occurred while parsing the API specification.
- created
At String - An ISO-8601 timestamp representation of entity creation date.
- id String
- The provider-assigned unique ID for this managed resource.
- updated
At String - An ISO-8601 timestamp representation of entity update date.
- validation
Messages 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.
- Api
Id string - The UUID API identifier
- Content string
- The raw content of your API specification, in json or yaml format (OpenAPI or AsyncAPI).
- Created
At 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"]
- Updated
At string - An ISO-8601 timestamp representation of entity update date.
- Validation
Messages List<ApiSpecification Validation Message> - The errors that occurred while parsing the API specification.
- Api
Id string - The UUID API identifier
- Content string
- The raw content of your API specification, in json or yaml format (OpenAPI or AsyncAPI).
- Created
At 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"]
- Updated
At string - An ISO-8601 timestamp representation of entity update date.
- Validation
Messages []ApiSpecification Validation Message Args - The errors that occurred while parsing the API specification.
- api
Id String - The UUID API identifier
- content String
- The raw content of your API specification, in json or yaml format (OpenAPI or AsyncAPI).
- created
At 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"]
- updated
At String - An ISO-8601 timestamp representation of entity update date.
- validation
Messages List<ApiSpecification Validation Message> - The errors that occurred while parsing the API specification.
- api
Id string - The UUID API identifier
- content string
- The raw content of your API specification, in json or yaml format (OpenAPI or AsyncAPI).
- created
At 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"]
- updated
At string - An ISO-8601 timestamp representation of entity update date.
- validation
Messages ApiSpecification Validation Message[] - 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[ApiSpecification Validation Message Args] - The errors that occurred while parsing the API specification.
- api
Id String - The UUID API identifier
- content String
- The raw content of your API specification, in json or yaml format (OpenAPI or AsyncAPI).
- created
At 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"]
- updated
At String - An ISO-8601 timestamp representation of entity update date.
- validation
Messages 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 str
- 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.