@pulumi/kong
Version:
A Pulumi package for creating and managing Kong resources.
276 lines (275 loc) • 8.71 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* ## # kong.Service
*
* The service resource maps directly onto the json for the service endpoint in Kong. For more information on the parameters [see the Kong Service create documentation](https://docs.konghq.com/gateway-oss/2.5.x/admin-api/#service-object).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as kong from "@pulumi/kong";
*
* const service = new kong.Service("service", {
* name: "test",
* protocol: "http",
* host: "test.org",
* port: 8080,
* path: "/mypath",
* retries: 5,
* connectTimeout: 1000,
* writeTimeout: 2000,
* readTimeout: 3000,
* });
* ```
*
* To use a client certificate and ca certificates combine with certificate resource (note protocol must be `https`):
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as kong from "@pulumi/kong";
*
* const certificate = new kong.Certificate("certificate", {
* certificate: ` -----BEGIN CERTIFICATE-----
* ......
* -----END CERTIFICATE-----
* `,
* privateKey: ` -----BEGIN PRIVATE KEY-----
* .....
* -----END PRIVATE KEY-----
* `,
* snis: ["foo.com"],
* });
* const ca = new kong.Certificate("ca", {
* certificate: ` -----BEGIN CERTIFICATE-----
* ......
* -----END CERTIFICATE-----
* `,
* privateKey: ` -----BEGIN PRIVATE KEY-----
* .....
* -----END PRIVATE KEY-----
* `,
* snis: ["ca.com"],
* });
* const service = new kong.Service("service", {
* name: "test",
* protocol: "https",
* host: "test.org",
* tlsVerify: true,
* tlsVerifyDepth: 2,
* clientCertificateId: certificate.id,
* caCertificateIds: [ca.id],
* });
* ```
*
* ## Import
*
* To import a service:
*
* ```sh
* $ pulumi import kong:index/service:Service <service_identifier> <service_id>
* ```
*/
export declare class Service extends pulumi.CustomResource {
/**
* Get an existing Service resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ServiceState, opts?: pulumi.CustomResourceOptions): Service;
/**
* Returns true if the given object is an instance of Service. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Service;
/**
* A of CA Certificate IDs (created from the certificate resource). that are used to build the trust store while verifying upstream server’s TLS certificate.
*/
readonly caCertificateIds: pulumi.Output<string[] | undefined>;
/**
* ID of Certificate to be used as client certificate while TLS handshaking to the upstream server. Use ID from `kong.Certificate` resource
*/
readonly clientCertificateId: pulumi.Output<string | undefined>;
/**
* Connection timeout. Default(ms): 60000
*/
readonly connectTimeout: pulumi.Output<number | undefined>;
/**
* Host to map to
*/
readonly host: pulumi.Output<string | undefined>;
/**
* Service name
*/
readonly name: pulumi.Output<string>;
/**
* Path to map to
*/
readonly path: pulumi.Output<string | undefined>;
/**
* Port to map to. Default: 80
*/
readonly port: pulumi.Output<number | undefined>;
/**
* Protocol to use
*/
readonly protocol: pulumi.Output<string>;
/**
* Read timeout. Default(ms): 60000
*/
readonly readTimeout: pulumi.Output<number | undefined>;
/**
* Number of retries. Default: 5
*/
readonly retries: pulumi.Output<number | undefined>;
/**
* A list of strings associated with the Service for grouping and filtering.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* Whether to enable verification of upstream server TLS certificate. If not set then the nginx default is respected.
*/
readonly tlsVerify: pulumi.Output<boolean | undefined>;
/**
* Maximum depth of chain while verifying Upstream server’s TLS certificate.
*/
readonly tlsVerifyDepth: pulumi.Output<number | undefined>;
/**
* Write timout. Default(ms): 60000
*/
readonly writeTimeout: pulumi.Output<number | undefined>;
/**
* Create a Service resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ServiceArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Service resources.
*/
export interface ServiceState {
/**
* A of CA Certificate IDs (created from the certificate resource). that are used to build the trust store while verifying upstream server’s TLS certificate.
*/
caCertificateIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* ID of Certificate to be used as client certificate while TLS handshaking to the upstream server. Use ID from `kong.Certificate` resource
*/
clientCertificateId?: pulumi.Input<string>;
/**
* Connection timeout. Default(ms): 60000
*/
connectTimeout?: pulumi.Input<number>;
/**
* Host to map to
*/
host?: pulumi.Input<string>;
/**
* Service name
*/
name?: pulumi.Input<string>;
/**
* Path to map to
*/
path?: pulumi.Input<string>;
/**
* Port to map to. Default: 80
*/
port?: pulumi.Input<number>;
/**
* Protocol to use
*/
protocol?: pulumi.Input<string>;
/**
* Read timeout. Default(ms): 60000
*/
readTimeout?: pulumi.Input<number>;
/**
* Number of retries. Default: 5
*/
retries?: pulumi.Input<number>;
/**
* A list of strings associated with the Service for grouping and filtering.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Whether to enable verification of upstream server TLS certificate. If not set then the nginx default is respected.
*/
tlsVerify?: pulumi.Input<boolean>;
/**
* Maximum depth of chain while verifying Upstream server’s TLS certificate.
*/
tlsVerifyDepth?: pulumi.Input<number>;
/**
* Write timout. Default(ms): 60000
*/
writeTimeout?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a Service resource.
*/
export interface ServiceArgs {
/**
* A of CA Certificate IDs (created from the certificate resource). that are used to build the trust store while verifying upstream server’s TLS certificate.
*/
caCertificateIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* ID of Certificate to be used as client certificate while TLS handshaking to the upstream server. Use ID from `kong.Certificate` resource
*/
clientCertificateId?: pulumi.Input<string>;
/**
* Connection timeout. Default(ms): 60000
*/
connectTimeout?: pulumi.Input<number>;
/**
* Host to map to
*/
host?: pulumi.Input<string>;
/**
* Service name
*/
name?: pulumi.Input<string>;
/**
* Path to map to
*/
path?: pulumi.Input<string>;
/**
* Port to map to. Default: 80
*/
port?: pulumi.Input<number>;
/**
* Protocol to use
*/
protocol: pulumi.Input<string>;
/**
* Read timeout. Default(ms): 60000
*/
readTimeout?: pulumi.Input<number>;
/**
* Number of retries. Default: 5
*/
retries?: pulumi.Input<number>;
/**
* A list of strings associated with the Service for grouping and filtering.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Whether to enable verification of upstream server TLS certificate. If not set then the nginx default is respected.
*/
tlsVerify?: pulumi.Input<boolean>;
/**
* Maximum depth of chain while verifying Upstream server’s TLS certificate.
*/
tlsVerifyDepth?: pulumi.Input<number>;
/**
* Write timout. Default(ms): 60000
*/
writeTimeout?: pulumi.Input<number>;
}