@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
484 lines (483 loc) • 20.8 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Provides a resource to manage a VPC endpoint resource.
*
* ## Example Usage
* ### Access to the public interface service
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const publicInterfaceServiceId = config.requireObject("publicInterfaceServiceId");
* const vpcId = config.requireObject("vpcId");
* const networkId = config.requireObject("networkId");
* const test = new huaweicloud.vpcep.Endpoint("test", {
* serviceId: publicInterfaceServiceId,
* vpcId: vpcId,
* networkId: networkId,
* enableDns: true,
* enableWhitelist: true,
* whitelists: ["192.168.0.0/24"],
* });
* ```
* ### Access to the private interface service
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const serviceVpcId = config.requireObject("serviceVpcId");
* const vmPort = config.requireObject("vmPort");
* const vpcId = config.requireObject("vpcId");
* const networkId = config.requireObject("networkId");
* const testService = new huaweicloud.vpcep.Service("testService", {
* serverType: "VM",
* vpcId: serviceVpcId,
* portId: vmPort,
* portMappings: [{
* servicePort: 8080,
* terminalPort: 80,
* }],
* });
* const testEndpoint = new huaweicloud.vpcep.Endpoint("testEndpoint", {
* serviceId: testService.id,
* vpcId: vpcId,
* networkId: networkId,
* enableDns: true,
* description: "test description",
* });
* ```
* ### Access to the gateway service without policy statement
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const gatewayServiceId = config.requireObject("gatewayServiceId");
* const vpcId = config.requireObject("vpcId");
* const test = new huaweicloud.vpcep.Endpoint("test", {
* serviceId: gatewayServiceId,
* vpcId: vpcId,
* description: "test description",
* });
* ```
* ### Access to the gateway service with policy statement
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const gatewayServiceId = config.requireObject("gatewayServiceId");
* const vpcId = config.requireObject("vpcId");
* const test = new huaweicloud.vpcep.Endpoint("test", {
* serviceId: gatewayServiceId,
* vpcId: vpcId,
* description: "test description",
* policyStatement: ` [
* {
* "Effect": "Allow",
* "Action": [
* "obs:bucket:ListBucket"
* ],
* "Resource": [
* "obs:*:*:*:*/*",
* "obs:*:*:*:*"
* ]
* },
* {
* "Effect": "Deny",
* "Action": [
* "obs:object:DeleteObject"
* ],
* "Resource": [
* "obs:*:*:*:*/*",
* "obs:*:*:*:*"
* ]
* }
* ]
* `,
* });
* ```
*
* ## Import
*
* VPC endpoint can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Vpcep/endpoint:Endpoint test <id>
* ```
*
* Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`enable_dns`. It is generally recommended running `terraform plan` after importing a resource. You can then decide if changes should be applied to the resource, or the resource definition should be updated to align with the resource. Also, you can ignore changes as below. hcl resource "huaweicloud_vpcep_endpoint" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* enable_dns,
*
* ]
*
* } }
*/
export declare class Endpoint extends pulumi.CustomResource {
/**
* Get an existing Endpoint 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?: EndpointState, opts?: pulumi.CustomResourceOptions): Endpoint;
/**
* Returns true if the given object is an instance of Endpoint. 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 Endpoint;
/**
* Specifies the description of the VPC endpoint. The value can contain
* characters such as letters and digits, but cannot contain less than signs (<) and great than signs (>).
*/
readonly description: pulumi.Output<string>;
/**
* Specifies whether to create a private domain name. The default value is
* **true**. This field is valid only when creating a VPC endpoint for connecting an interface VPC endpoint service.
*/
readonly enableDns: pulumi.Output<boolean | undefined>;
/**
* Specifies whether to enable access control. The default value is **false**.
*/
readonly enableWhitelist: pulumi.Output<boolean | undefined>;
/**
* Specifies the IP address for accessing the associated VPC endpoint
* service. Only IPv4 addresses are supported. This field is required when creating a VPC endpoint for connecting an
* interface VPC endpoint service.
*/
readonly ipAddress: pulumi.Output<string>;
/**
* Specifies the IP version of the VPC endpoint.
* Changing this will create a new resource.
* The valid values are as follows:
* + **ipv4**: The VPC endpoint IP address can only be an IPv4 address.
* + **dualstack**: The VPC endpoint IP address can be an IPv4 address or IPv6 address.
*/
readonly ipVersion: pulumi.Output<string>;
/**
* Specifies the IPv6 address for accessing the connected VPC
* endpoint service.
* Changing this will create a new resource.
*/
readonly ipv6Address: pulumi.Output<string>;
/**
* Specifies the network ID of the subnet in the VPC specified by `vpcId`.
* This field is required when creating a VPC endpoint for connecting an interface VPC endpoint service.
* The use of this field has the following restrictions:
* + The subnet CIDR block of the VPC cannot overlap with **198.19.128.0/17**.
* + The destination address of the custom route in the VPC route table cannot overlap with **198.19.128.0/17**.
*/
readonly networkId: pulumi.Output<string>;
/**
* The packet ID of the VPC endpoint.
*/
readonly packetId: pulumi.Output<number>;
/**
* Specifies the endpoint policy information
*/
readonly policyDocument: pulumi.Output<string>;
/**
* Specifies the policy of the gateway VPC endpoint. The value is a string in
* JSON array format. This parameter is only available when `enablePolicy` of the VPC endpoint services for
* Object Storage Service (OBS) and Scalable File Service (SFS) is set to **true**.
*/
readonly policyStatement: pulumi.Output<string>;
/**
* The domain name for accessing the associated VPC endpoint service. This parameter is only
* available when enableDns is set to true.
*/
readonly privateDomainName: pulumi.Output<string>;
/**
* The region in which to create the VPC endpoint. If omitted, the provider-level
* region will be used. Changing this creates a new VPC endpoint.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies the IDs of the route tables associated with the VPC endpoint.
* This field is valid only when creating a VPC endpoint for connecting a gateway VPC endpoint service.
* The default route table will be used when this field is not specified.
*/
readonly routetables: pulumi.Output<string[]>;
/**
* Specifies the ID of the VPC endpoint service.
* The VPC endpoint service could be private interface service, public interface service or gateway service.
* + For private interface service, the value of `serviceId` can be obtained through resource `huaweicloud.Vpcep.Service`
* or datasource `huaweicloudVpcepServices`.
* + For public interface service, the value of `serviceId` can be obtained through datasource
* `huaweicloud.Vpcep.getPublicServices`.
* + For gateway service, due to API reasons, the current provider's capabilities do not support the creation of gateway
* VPC endpoint services. Please try to obtain `serviceId` through datasource `huaweicloud.Vpcep.getPublicServices` or
* look for VPCEP operation and maintenance help to find the gateway service ID.
*/
readonly serviceId: pulumi.Output<string>;
/**
* The name of the VPC endpoint service.
*/
readonly serviceName: pulumi.Output<string>;
/**
* The type of the VPC endpoint service.
*/
readonly serviceType: pulumi.Output<string>;
/**
* The status of the VPC endpoint. The value can be **pendingAcceptance**, **creating**, **accepted**,
* **rejected**, **failed**, **deleting**.
*/
readonly status: pulumi.Output<string>;
/**
* The key/value pairs to associate with the VPC endpoint.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Specifies the ID of the VPC where the VPC endpoint is to be created. Changing
* this creates a new VPC endpoint.
*/
readonly vpcId: pulumi.Output<string>;
/**
* Specifies the list of IP address or CIDR block which can be accessed to the
* VPC endpoint. This field is valid when `enableWhitelist` is set to **true**. The max length of whitelist is 20.
* This field is valid only when creating a VPC endpoint for connecting an interface VPC endpoint service.
*/
readonly whitelists: pulumi.Output<string[] | undefined>;
/**
* Create a Endpoint 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: EndpointArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Endpoint resources.
*/
export interface EndpointState {
/**
* Specifies the description of the VPC endpoint. The value can contain
* characters such as letters and digits, but cannot contain less than signs (<) and great than signs (>).
*/
description?: pulumi.Input<string>;
/**
* Specifies whether to create a private domain name. The default value is
* **true**. This field is valid only when creating a VPC endpoint for connecting an interface VPC endpoint service.
*/
enableDns?: pulumi.Input<boolean>;
/**
* Specifies whether to enable access control. The default value is **false**.
*/
enableWhitelist?: pulumi.Input<boolean>;
/**
* Specifies the IP address for accessing the associated VPC endpoint
* service. Only IPv4 addresses are supported. This field is required when creating a VPC endpoint for connecting an
* interface VPC endpoint service.
*/
ipAddress?: pulumi.Input<string>;
/**
* Specifies the IP version of the VPC endpoint.
* Changing this will create a new resource.
* The valid values are as follows:
* + **ipv4**: The VPC endpoint IP address can only be an IPv4 address.
* + **dualstack**: The VPC endpoint IP address can be an IPv4 address or IPv6 address.
*/
ipVersion?: pulumi.Input<string>;
/**
* Specifies the IPv6 address for accessing the connected VPC
* endpoint service.
* Changing this will create a new resource.
*/
ipv6Address?: pulumi.Input<string>;
/**
* Specifies the network ID of the subnet in the VPC specified by `vpcId`.
* This field is required when creating a VPC endpoint for connecting an interface VPC endpoint service.
* The use of this field has the following restrictions:
* + The subnet CIDR block of the VPC cannot overlap with **198.19.128.0/17**.
* + The destination address of the custom route in the VPC route table cannot overlap with **198.19.128.0/17**.
*/
networkId?: pulumi.Input<string>;
/**
* The packet ID of the VPC endpoint.
*/
packetId?: pulumi.Input<number>;
/**
* Specifies the endpoint policy information
*/
policyDocument?: pulumi.Input<string>;
/**
* Specifies the policy of the gateway VPC endpoint. The value is a string in
* JSON array format. This parameter is only available when `enablePolicy` of the VPC endpoint services for
* Object Storage Service (OBS) and Scalable File Service (SFS) is set to **true**.
*/
policyStatement?: pulumi.Input<string>;
/**
* The domain name for accessing the associated VPC endpoint service. This parameter is only
* available when enableDns is set to true.
*/
privateDomainName?: pulumi.Input<string>;
/**
* The region in which to create the VPC endpoint. If omitted, the provider-level
* region will be used. Changing this creates a new VPC endpoint.
*/
region?: pulumi.Input<string>;
/**
* Specifies the IDs of the route tables associated with the VPC endpoint.
* This field is valid only when creating a VPC endpoint for connecting a gateway VPC endpoint service.
* The default route table will be used when this field is not specified.
*/
routetables?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the ID of the VPC endpoint service.
* The VPC endpoint service could be private interface service, public interface service or gateway service.
* + For private interface service, the value of `serviceId` can be obtained through resource `huaweicloud.Vpcep.Service`
* or datasource `huaweicloudVpcepServices`.
* + For public interface service, the value of `serviceId` can be obtained through datasource
* `huaweicloud.Vpcep.getPublicServices`.
* + For gateway service, due to API reasons, the current provider's capabilities do not support the creation of gateway
* VPC endpoint services. Please try to obtain `serviceId` through datasource `huaweicloud.Vpcep.getPublicServices` or
* look for VPCEP operation and maintenance help to find the gateway service ID.
*/
serviceId?: pulumi.Input<string>;
/**
* The name of the VPC endpoint service.
*/
serviceName?: pulumi.Input<string>;
/**
* The type of the VPC endpoint service.
*/
serviceType?: pulumi.Input<string>;
/**
* The status of the VPC endpoint. The value can be **pendingAcceptance**, **creating**, **accepted**,
* **rejected**, **failed**, **deleting**.
*/
status?: pulumi.Input<string>;
/**
* The key/value pairs to associate with the VPC endpoint.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the ID of the VPC where the VPC endpoint is to be created. Changing
* this creates a new VPC endpoint.
*/
vpcId?: pulumi.Input<string>;
/**
* Specifies the list of IP address or CIDR block which can be accessed to the
* VPC endpoint. This field is valid when `enableWhitelist` is set to **true**. The max length of whitelist is 20.
* This field is valid only when creating a VPC endpoint for connecting an interface VPC endpoint service.
*/
whitelists?: pulumi.Input<pulumi.Input<string>[]>;
}
/**
* The set of arguments for constructing a Endpoint resource.
*/
export interface EndpointArgs {
/**
* Specifies the description of the VPC endpoint. The value can contain
* characters such as letters and digits, but cannot contain less than signs (<) and great than signs (>).
*/
description?: pulumi.Input<string>;
/**
* Specifies whether to create a private domain name. The default value is
* **true**. This field is valid only when creating a VPC endpoint for connecting an interface VPC endpoint service.
*/
enableDns?: pulumi.Input<boolean>;
/**
* Specifies whether to enable access control. The default value is **false**.
*/
enableWhitelist?: pulumi.Input<boolean>;
/**
* Specifies the IP address for accessing the associated VPC endpoint
* service. Only IPv4 addresses are supported. This field is required when creating a VPC endpoint for connecting an
* interface VPC endpoint service.
*/
ipAddress?: pulumi.Input<string>;
/**
* Specifies the IP version of the VPC endpoint.
* Changing this will create a new resource.
* The valid values are as follows:
* + **ipv4**: The VPC endpoint IP address can only be an IPv4 address.
* + **dualstack**: The VPC endpoint IP address can be an IPv4 address or IPv6 address.
*/
ipVersion?: pulumi.Input<string>;
/**
* Specifies the IPv6 address for accessing the connected VPC
* endpoint service.
* Changing this will create a new resource.
*/
ipv6Address?: pulumi.Input<string>;
/**
* Specifies the network ID of the subnet in the VPC specified by `vpcId`.
* This field is required when creating a VPC endpoint for connecting an interface VPC endpoint service.
* The use of this field has the following restrictions:
* + The subnet CIDR block of the VPC cannot overlap with **198.19.128.0/17**.
* + The destination address of the custom route in the VPC route table cannot overlap with **198.19.128.0/17**.
*/
networkId?: pulumi.Input<string>;
/**
* Specifies the endpoint policy information
*/
policyDocument?: pulumi.Input<string>;
/**
* Specifies the policy of the gateway VPC endpoint. The value is a string in
* JSON array format. This parameter is only available when `enablePolicy` of the VPC endpoint services for
* Object Storage Service (OBS) and Scalable File Service (SFS) is set to **true**.
*/
policyStatement?: pulumi.Input<string>;
/**
* The region in which to create the VPC endpoint. If omitted, the provider-level
* region will be used. Changing this creates a new VPC endpoint.
*/
region?: pulumi.Input<string>;
/**
* Specifies the IDs of the route tables associated with the VPC endpoint.
* This field is valid only when creating a VPC endpoint for connecting a gateway VPC endpoint service.
* The default route table will be used when this field is not specified.
*/
routetables?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the ID of the VPC endpoint service.
* The VPC endpoint service could be private interface service, public interface service or gateway service.
* + For private interface service, the value of `serviceId` can be obtained through resource `huaweicloud.Vpcep.Service`
* or datasource `huaweicloudVpcepServices`.
* + For public interface service, the value of `serviceId` can be obtained through datasource
* `huaweicloud.Vpcep.getPublicServices`.
* + For gateway service, due to API reasons, the current provider's capabilities do not support the creation of gateway
* VPC endpoint services. Please try to obtain `serviceId` through datasource `huaweicloud.Vpcep.getPublicServices` or
* look for VPCEP operation and maintenance help to find the gateway service ID.
*/
serviceId: pulumi.Input<string>;
/**
* The key/value pairs to associate with the VPC endpoint.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the ID of the VPC where the VPC endpoint is to be created. Changing
* this creates a new VPC endpoint.
*/
vpcId: pulumi.Input<string>;
/**
* Specifies the list of IP address or CIDR block which can be accessed to the
* VPC endpoint. This field is valid when `enableWhitelist` is set to **true**. The max length of whitelist is 20.
* This field is valid only when creating a VPC endpoint for connecting an interface VPC endpoint service.
*/
whitelists?: pulumi.Input<pulumi.Input<string>[]>;
}