UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

376 lines (375 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 upstream * ## 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, * }, * ], * }, * }); * const foo_vefaas = new volcengine.apig.ApigUpstream("foo-vefaas", { * gatewayId: fooApigGateway.id, * comments: "acc-test", * resourceType: "Console", * protocol: "HTTP", * sourceType: "VeFaas", * upstreamSpec: { * veFaas: { * functionId: "crnrfajj", * }, * }, * }); * const foo_k8sApigUpstreamSource = new volcengine.apig.ApigUpstreamSource("foo-k8sApigUpstreamSource", { * gatewayId: fooApigGateway.id, * comments: "acc-test-k8s", * sourceType: "K8S", * sourceSpec: { * k8sSource: { * clusterId: "cd197sac4mpmnruh7um80", * }, * }, * ingressSettings: [{ * enableIngress: true, * updateStatus: true, * ingressClasses: ["test"], * watchNamespaces: ["default"], * }], * }); * const foo_k8sApigUpstream = new volcengine.apig.ApigUpstream("foo-k8sApigUpstream", { * 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: "K8S", * upstreamSpec: { * k8sService: { * namespace: "default", * name: "kubernetes", * port: 443, * }, * }, * }, { * dependsOn: [foo_k8sApigUpstreamSource], * }); * ``` * * ## Import * * ApigUpstream can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:apig/apigUpstream:ApigUpstream default resource_id * ``` */ export declare class ApigUpstream extends pulumi.CustomResource { /** * Get an existing ApigUpstream 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?: ApigUpstreamState, opts?: pulumi.CustomResourceOptions): ApigUpstream; /** * Returns true if the given object is an instance of ApigUpstream. 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 ApigUpstream; /** * The circuit breaking settings of apig upstream. */ readonly circuitBreakingSettings: pulumi.Output<outputs.apig.ApigUpstreamCircuitBreakingSettings>; /** * The comments of the apig upstream. */ readonly comments: pulumi.Output<string | undefined>; /** * The create time of apig upstream. */ readonly createTime: pulumi.Output<string>; /** * The gateway id of the apig upstream. */ readonly gatewayId: pulumi.Output<string>; /** * The load balancer settings of apig upstream. */ readonly loadBalancerSettings: pulumi.Output<outputs.apig.ApigUpstreamLoadBalancerSettings>; /** * The name of the apig upstream. */ readonly name: pulumi.Output<string>; /** * The protocol of the apig upstream. Valid values: `HTTP`, `HTTP2`, `GRPC`. */ readonly protocol: pulumi.Output<string>; /** * The resource type of the apig upstream. Valid values: `Console`, `Ingress`. */ readonly resourceType: pulumi.Output<string | undefined>; /** * The source type of the apig upstream. Valid values: `VeFaas`, `ECS`, `FixedIP`, `K8S`, `Nacos`, `Domain`, `AIProvider`, `VeMLP`. */ readonly sourceType: pulumi.Output<string>; /** * The tls settings of apig upstream. */ readonly tlsSettings: pulumi.Output<outputs.apig.ApigUpstreamTlsSettings>; /** * The update time of apig upstream version. */ readonly updateTime: pulumi.Output<string>; /** * The upstream spec of apig upstream. */ readonly upstreamSpec: pulumi.Output<outputs.apig.ApigUpstreamUpstreamSpec>; /** * The version details of apig upstream. */ readonly versionDetails: pulumi.Output<outputs.apig.ApigUpstreamVersionDetail[]>; /** * Create a ApigUpstream 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: ApigUpstreamArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ApigUpstream resources. */ export interface ApigUpstreamState { /** * The circuit breaking settings of apig upstream. */ circuitBreakingSettings?: pulumi.Input<inputs.apig.ApigUpstreamCircuitBreakingSettings>; /** * The comments of the apig upstream. */ comments?: pulumi.Input<string>; /** * The create time of apig upstream. */ createTime?: pulumi.Input<string>; /** * The gateway id of the apig upstream. */ gatewayId?: pulumi.Input<string>; /** * The load balancer settings of apig upstream. */ loadBalancerSettings?: pulumi.Input<inputs.apig.ApigUpstreamLoadBalancerSettings>; /** * The name of the apig upstream. */ name?: pulumi.Input<string>; /** * The protocol of the apig upstream. Valid values: `HTTP`, `HTTP2`, `GRPC`. */ protocol?: pulumi.Input<string>; /** * The resource type of the apig upstream. Valid values: `Console`, `Ingress`. */ resourceType?: pulumi.Input<string>; /** * The source type of the apig upstream. Valid values: `VeFaas`, `ECS`, `FixedIP`, `K8S`, `Nacos`, `Domain`, `AIProvider`, `VeMLP`. */ sourceType?: pulumi.Input<string>; /** * The tls settings of apig upstream. */ tlsSettings?: pulumi.Input<inputs.apig.ApigUpstreamTlsSettings>; /** * The update time of apig upstream version. */ updateTime?: pulumi.Input<string>; /** * The upstream spec of apig upstream. */ upstreamSpec?: pulumi.Input<inputs.apig.ApigUpstreamUpstreamSpec>; /** * The version details of apig upstream. */ versionDetails?: pulumi.Input<pulumi.Input<inputs.apig.ApigUpstreamVersionDetail>[]>; } /** * The set of arguments for constructing a ApigUpstream resource. */ export interface ApigUpstreamArgs { /** * The circuit breaking settings of apig upstream. */ circuitBreakingSettings?: pulumi.Input<inputs.apig.ApigUpstreamCircuitBreakingSettings>; /** * The comments of the apig upstream. */ comments?: pulumi.Input<string>; /** * The gateway id of the apig upstream. */ gatewayId: pulumi.Input<string>; /** * The load balancer settings of apig upstream. */ loadBalancerSettings?: pulumi.Input<inputs.apig.ApigUpstreamLoadBalancerSettings>; /** * The name of the apig upstream. */ name?: pulumi.Input<string>; /** * The protocol of the apig upstream. Valid values: `HTTP`, `HTTP2`, `GRPC`. */ protocol: pulumi.Input<string>; /** * The resource type of the apig upstream. Valid values: `Console`, `Ingress`. */ resourceType?: pulumi.Input<string>; /** * The source type of the apig upstream. Valid values: `VeFaas`, `ECS`, `FixedIP`, `K8S`, `Nacos`, `Domain`, `AIProvider`, `VeMLP`. */ sourceType: pulumi.Input<string>; /** * The tls settings of apig upstream. */ tlsSettings?: pulumi.Input<inputs.apig.ApigUpstreamTlsSettings>; /** * The upstream spec of apig upstream. */ upstreamSpec: pulumi.Input<inputs.apig.ApigUpstreamUpstreamSpec>; }