UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

398 lines (397 loc) 12 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Provides a resource to manage apig route * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@pulumi/volcengine"; * import * as volcengine from "@volcengine/pulumi"; * * const fooZones = volcengine.ecs.getZones({}); * const fooVpc = new volcengine.vpc.Vpc("fooVpc", { * vpcName: "acc-test-vpc", * cidrBlock: "172.16.0.0/16", * }); * const foo1 = new volcengine.vpc.Subnet("foo1", { * subnetName: "acc-test-subnet", * cidrBlock: "172.16.0.0/24", * zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * vpcId: fooVpc.id, * }); * const foo2 = new volcengine.vpc.Subnet("foo2", { * subnetName: "acc-test-subnet", * cidrBlock: "172.16.1.0/24", * zoneId: fooZones.then(fooZones => fooZones.zones?.[1]?.id), * vpcId: fooVpc.id, * }); * const fooApigGateway = new volcengine.apig.ApigGateway("fooApigGateway", { * type: "standard", * comments: "acc-test", * projectName: "default", * tags: [{ * key: "k1", * value: "v1", * }], * networkSpec: { * vpcId: fooVpc.id, * subnetIds: [ * foo1.id, * foo2.id, * ], * }, * resourceSpec: { * replicas: 2, * instanceSpecCode: "1c2g", * clbSpecCode: "small_1", * publicNetworkBillingType: "bandwidth", * publicNetworkBandwidth: 1, * networkType: { * enablePublicNetwork: true, * enablePrivateNetwork: true, * }, * }, * logSpec: { * enable: true, * projectId: "d3cb87c0-faeb-4074-b1ee-9bd747865a76", * topicId: "d339482e-d86d-4bd8-a9bb-f270417f00a1", * }, * monitorSpec: { * enable: true, * workspaceId: "4ed1caf3-279d-4c5f-8301-87ea38e92ffc", * }, * }); * const fooApigGatewayService = new volcengine.apig.ApigGatewayService("fooApigGatewayService", { * gatewayId: fooApigGateway.id, * serviceName: "acc-test-apig-service", * comments: "acc-test", * protocols: [ * "HTTP", * "HTTPS", * ], * authSpec: { * enable: false, * }, * }); * const foo_fixed_ip = new volcengine.apig.ApigUpstream("foo-fixed-ip", { * gatewayId: fooApigGateway.id, * comments: "acc-test", * resourceType: "Console", * protocol: "HTTP", * loadBalancerSettings: { * lbPolicy: "ConsistentHashLB", * consistentHashLb: { * hashKey: "HTTPCookie", * httpCookie: { * name: "test", * path: "/", * ttl: 300, * }, * }, * }, * tlsSettings: { * tlsMode: "SIMPLE", * sni: "test", * }, * circuitBreakingSettings: { * enable: false, * consecutiveErrors: 5, * interval: 10000, * baseEjectionTime: 30000, * maxEjectionPercent: 20, * minHealthPercent: 60, * }, * sourceType: "FixedIP", * upstreamSpec: { * fixedIpLists: [ * { * ip: "172.16.0.10", * port: 8080, * }, * { * ip: "172.16.0.20", * port: 8090, * }, * { * ip: "172.16.0.30", * port: 8099, * }, * ], * }, * }); * const fooApigRoute = new volcengine.apig.ApigRoute("fooApigRoute", { * serviceId: fooApigGatewayService.id, * resourceType: "Console", * priority: 2, * enable: true, * upstreamLists: [{ * upstreamId: foo_fixed_ip.id, * weight: 100, * }], * matchRule: { * path: { * matchType: "Prefix", * matchContent: "/test", * }, * methods: [ * "GET", * "POST", * ], * queryStrings: [{ * key: "test-key", * value: { * matchType: "Exact", * matchContent: "test-value", * }, * }], * headers: [{ * key: "test-header", * value: { * matchType: "Regex", * matchContent: "test-value", * }, * }], * }, * advancedSetting: { * timeoutSetting: { * enable: false, * timeout: 10, * }, * corsPolicySetting: { * enable: false, * }, * urlRewriteSetting: { * enable: true, * urlRewrite: "/test", * }, * retryPolicySetting: { * enable: true, * attempts: 5, * perTryTimeout: 1000, * retryOns: [ * "5xx", * "reset", * ], * httpCodes: [ * "500", * "502", * "503", * "504", * ], * }, * headerOperations: [ * { * operation: "add", * key: "test-header-req", * value: "test-value", * directionType: "request", * }, * { * operation: "set", * key: "test-header-resp", * value: "test-value", * directionType: "response", * }, * ], * mirrorPolicies: [{ * upstream: { * upstreamId: foo_fixed_ip.id, * type: "fixed_ip", * }, * percent: { * value: 50, * }, * }], * }, * }); * ``` * * ## Import * * ApigRoute can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:apig/apigRoute:ApigRoute default resource_id * ``` */ export declare class ApigRoute extends pulumi.CustomResource { /** * Get an existing ApigRoute 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?: ApigRouteState, opts?: pulumi.CustomResourceOptions): ApigRoute; /** * Returns true if the given object is an instance of ApigRoute. 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 ApigRoute; /** * The advanced setting of the api gateway route. */ readonly advancedSetting: pulumi.Output<outputs.apig.ApigRouteAdvancedSetting>; /** * The create time of the api gateway route. */ readonly createTime: pulumi.Output<string>; /** * The custom domains of the api gateway route. */ readonly customDomains: pulumi.Output<outputs.apig.ApigRouteCustomDomain[]>; /** * The domains of the api gateway route. */ readonly domains: pulumi.Output<outputs.apig.ApigRouteDomain[]>; /** * Whether the apig route is enabled. Default is `false`. */ readonly enable: pulumi.Output<boolean>; /** * The match rule of the api gateway route. */ readonly matchRule: pulumi.Output<outputs.apig.ApigRouteMatchRule>; /** * The name of the apig route. */ readonly name: pulumi.Output<string>; /** * The priority of the apig route. Valid values: 0~100. */ readonly priority: pulumi.Output<number>; /** * The reason of the api gateway route. */ readonly reason: pulumi.Output<string>; /** * The resource type of the apig route. Valid values: `Console`, `Ingress` Default is `Console`. */ readonly resourceType: pulumi.Output<string>; /** * The service id of the apig route. */ readonly serviceId: pulumi.Output<string>; /** * The status of the api gateway route. */ readonly status: pulumi.Output<string>; /** * The update time of the api gateway route. */ readonly updateTime: pulumi.Output<string>; /** * The upstream list of the api gateway route. */ readonly upstreamLists: pulumi.Output<outputs.apig.ApigRouteUpstreamList[]>; /** * Create a ApigRoute 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: ApigRouteArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ApigRoute resources. */ export interface ApigRouteState { /** * The advanced setting of the api gateway route. */ advancedSetting?: pulumi.Input<inputs.apig.ApigRouteAdvancedSetting>; /** * The create time of the api gateway route. */ createTime?: pulumi.Input<string>; /** * The custom domains of the api gateway route. */ customDomains?: pulumi.Input<pulumi.Input<inputs.apig.ApigRouteCustomDomain>[]>; /** * The domains of the api gateway route. */ domains?: pulumi.Input<pulumi.Input<inputs.apig.ApigRouteDomain>[]>; /** * Whether the apig route is enabled. Default is `false`. */ enable?: pulumi.Input<boolean>; /** * The match rule of the api gateway route. */ matchRule?: pulumi.Input<inputs.apig.ApigRouteMatchRule>; /** * The name of the apig route. */ name?: pulumi.Input<string>; /** * The priority of the apig route. Valid values: 0~100. */ priority?: pulumi.Input<number>; /** * The reason of the api gateway route. */ reason?: pulumi.Input<string>; /** * The resource type of the apig route. Valid values: `Console`, `Ingress` Default is `Console`. */ resourceType?: pulumi.Input<string>; /** * The service id of the apig route. */ serviceId?: pulumi.Input<string>; /** * The status of the api gateway route. */ status?: pulumi.Input<string>; /** * The update time of the api gateway route. */ updateTime?: pulumi.Input<string>; /** * The upstream list of the api gateway route. */ upstreamLists?: pulumi.Input<pulumi.Input<inputs.apig.ApigRouteUpstreamList>[]>; } /** * The set of arguments for constructing a ApigRoute resource. */ export interface ApigRouteArgs { /** * The advanced setting of the api gateway route. */ advancedSetting?: pulumi.Input<inputs.apig.ApigRouteAdvancedSetting>; /** * Whether the apig route is enabled. Default is `false`. */ enable?: pulumi.Input<boolean>; /** * The match rule of the api gateway route. */ matchRule: pulumi.Input<inputs.apig.ApigRouteMatchRule>; /** * The name of the apig route. */ name?: pulumi.Input<string>; /** * The priority of the apig route. Valid values: 0~100. */ priority?: pulumi.Input<number>; /** * The resource type of the apig route. Valid values: `Console`, `Ingress` Default is `Console`. */ resourceType?: pulumi.Input<string>; /** * The service id of the apig route. */ serviceId: pulumi.Input<string>; /** * The upstream list of the api gateway route. */ upstreamLists: pulumi.Input<pulumi.Input<inputs.apig.ApigRouteUpstreamList>[]>; }