@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
437 lines • 17.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* A connectivity test are a static analysis of your resource configurations
* that enables you to evaluate connectivity to and from Google Cloud
* resources in your Virtual Private Cloud (VPC) network.
*
* To get more information about ConnectivityTest, see:
*
* * [API documentation](https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/reference/networkmanagement/rest/v1/projects.locations.global.connectivityTests)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/network-intelligence-center/docs)
*
* ## Example Usage
*
* ### Network Management Connectivity Test Instances
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const vpc = new gcp.compute.Network("vpc", {name: "conn-test-net"});
* const debian9 = gcp.compute.getImage({
* family: "debian-11",
* project: "debian-cloud",
* });
* const source = new gcp.compute.Instance("source", {
* networkInterfaces: [{
* accessConfigs: [{}],
* network: vpc.id,
* }],
* name: "source-vm",
* machineType: "e2-medium",
* bootDisk: {
* initializeParams: {
* image: debian9.then(debian9 => debian9.id),
* },
* },
* });
* const destination = new gcp.compute.Instance("destination", {
* networkInterfaces: [{
* accessConfigs: [{}],
* network: vpc.id,
* }],
* name: "dest-vm",
* machineType: "e2-medium",
* bootDisk: {
* initializeParams: {
* image: debian9.then(debian9 => debian9.id),
* },
* },
* });
* const instance_test = new gcp.networkmanagement.ConnectivityTest("instance-test", {
* name: "conn-test-instances",
* source: {
* instance: source.id,
* },
* destination: {
* instance: destination.id,
* },
* protocol: "TCP",
* labels: {
* env: "test",
* },
* });
* ```
* ### Network Management Connectivity Test Addresses
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const vpc = new gcp.compute.Network("vpc", {name: "connectivity-vpc"});
* const subnet = new gcp.compute.Subnetwork("subnet", {
* name: "connectivity-vpc-subnet",
* ipCidrRange: "10.0.0.0/16",
* region: "us-central1",
* network: vpc.id,
* });
* const source_addr = new gcp.compute.Address("source-addr", {
* name: "src-addr",
* subnetwork: subnet.id,
* addressType: "INTERNAL",
* address: "10.0.42.42",
* region: "us-central1",
* });
* const dest_addr = new gcp.compute.Address("dest-addr", {
* name: "dest-addr",
* subnetwork: subnet.id,
* addressType: "INTERNAL",
* address: "10.0.43.43",
* region: "us-central1",
* });
* const address_test = new gcp.networkmanagement.ConnectivityTest("address-test", {
* name: "conn-test-addr",
* source: {
* ipAddress: source_addr.address,
* projectId: source_addr.project,
* network: vpc.id,
* networkType: "GCP_NETWORK",
* },
* destination: {
* ipAddress: dest_addr.address,
* projectId: dest_addr.project,
* network: vpc.id,
* },
* protocol: "UDP",
* });
* ```
* ### Network Management Connectivity Test Endpoints
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const endpoints_test = new gcp.networkmanagement.ConnectivityTest("endpoints-test", {
* name: "conn-test-endpoints",
* source: {
* gkeMasterCluster: "projects/test-project/locations/us-central1/clusters/name",
* cloudSqlInstance: "projects/test-project/instances/name",
* appEngineVersion: {
* uri: "apps/test-project/services/default/versions/name",
* },
* cloudFunction: {
* uri: "projects/test-project/locations/us-central1/functions/name",
* },
* cloudRunRevision: {
* uri: "projects/test-project/locations/us-central1/revisions/name",
* },
* port: 80,
* },
* destination: {
* port: 443,
* forwardingRule: "projects/test-project/regions/us-central1/forwardingRules/name",
* gkeMasterCluster: "projects/test-project/locations/us-central1/clusters/name",
* fqdn: "name.us-central1.gke.goog",
* cloudSqlInstance: "projects/test-project/instances/name",
* redisInstance: "projects/test-project/locations/us-central1/instances/name",
* redisCluster: "projects/test-project/locations/us-central1/clusters/name",
* },
* bypassFirewallChecks: true,
* roundTrip: true,
* });
* ```
*
* ## Import
*
* ConnectivityTest can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/global/connectivityTests/{{name}}`
* * `{{project}}/{{name}}`
* * `{{name}}`
*
* When using the `pulumi import` command, ConnectivityTest can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:networkmanagement/connectivityTest:ConnectivityTest default projects/{{project}}/locations/global/connectivityTests/{{name}}
* $ pulumi import gcp:networkmanagement/connectivityTest:ConnectivityTest default {{project}}/{{name}}
* $ pulumi import gcp:networkmanagement/connectivityTest:ConnectivityTest default {{name}}
* ```
*/
export declare class ConnectivityTest extends pulumi.CustomResource {
/**
* Get an existing ConnectivityTest 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?: ConnectivityTestState, opts?: pulumi.CustomResourceOptions): ConnectivityTest;
/**
* Returns true if the given object is an instance of ConnectivityTest. 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 ConnectivityTest;
/**
* Whether the analysis should skip firewall checking. Default value is false.
*/
readonly bypassFirewallChecks: pulumi.Output<boolean | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
readonly deletionPolicy: pulumi.Output<string>;
/**
* The user-supplied description of the Connectivity Test.
* Maximum of 512 characters.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Required. Destination specification of the Connectivity Test.
* You can use a combination of destination IP address, URI of a supported
* endpoint, project ID, or VPC network to identify the destination location.
* Reachability analysis proceeds even if the destination location is
* ambiguous. However, the test result might include endpoints or use a
* destination that you don't intend to test.
* Structure is documented below.
*/
readonly destination: pulumi.Output<outputs.networkmanagement.ConnectivityTestDestination>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
readonly effectiveLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* Resource labels to represent user-provided metadata.
*
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
readonly labels: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Unique name for the connectivity test.
*/
readonly name: pulumi.Output<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* IP Protocol of the test. When not provided, "TCP" is assumed.
*/
readonly protocol: pulumi.Output<string | undefined>;
/**
* The combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
readonly pulumiLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* Other projects that may be relevant for reachability analysis.
* This is applicable to scenarios where a test can cross project
* boundaries.
*/
readonly relatedProjects: pulumi.Output<string[] | undefined>;
/**
* Whether run analysis for the return path from destination to source.
* Default value is false.
*/
readonly roundTrip: pulumi.Output<boolean | undefined>;
/**
* Required. Source specification of the Connectivity Test.
* You can use a combination of source IP address, URI of a supported
* endpoint, project ID, or VPC network to identify the source location.
* Reachability analysis might proceed even if the source location is
* ambiguous. However, the test result might include endpoints or use a source
* that you don't intend to test.
* Structure is documented below.
*/
readonly source: pulumi.Output<outputs.networkmanagement.ConnectivityTestSource>;
/**
* Create a ConnectivityTest 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: ConnectivityTestArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ConnectivityTest resources.
*/
export interface ConnectivityTestState {
/**
* Whether the analysis should skip firewall checking. Default value is false.
*/
bypassFirewallChecks?: pulumi.Input<boolean | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* The user-supplied description of the Connectivity Test.
* Maximum of 512 characters.
*/
description?: pulumi.Input<string | undefined>;
/**
* Required. Destination specification of the Connectivity Test.
* You can use a combination of destination IP address, URI of a supported
* endpoint, project ID, or VPC network to identify the destination location.
* Reachability analysis proceeds even if the destination location is
* ambiguous. However, the test result might include endpoints or use a
* destination that you don't intend to test.
* Structure is documented below.
*/
destination?: pulumi.Input<inputs.networkmanagement.ConnectivityTestDestination | undefined>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
effectiveLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* Resource labels to represent user-provided metadata.
*
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* Unique name for the connectivity test.
*/
name?: pulumi.Input<string | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
/**
* IP Protocol of the test. When not provided, "TCP" is assumed.
*/
protocol?: pulumi.Input<string | undefined>;
/**
* The combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
pulumiLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* Other projects that may be relevant for reachability analysis.
* This is applicable to scenarios where a test can cross project
* boundaries.
*/
relatedProjects?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* Whether run analysis for the return path from destination to source.
* Default value is false.
*/
roundTrip?: pulumi.Input<boolean | undefined>;
/**
* Required. Source specification of the Connectivity Test.
* You can use a combination of source IP address, URI of a supported
* endpoint, project ID, or VPC network to identify the source location.
* Reachability analysis might proceed even if the source location is
* ambiguous. However, the test result might include endpoints or use a source
* that you don't intend to test.
* Structure is documented below.
*/
source?: pulumi.Input<inputs.networkmanagement.ConnectivityTestSource | undefined>;
}
/**
* The set of arguments for constructing a ConnectivityTest resource.
*/
export interface ConnectivityTestArgs {
/**
* Whether the analysis should skip firewall checking. Default value is false.
*/
bypassFirewallChecks?: pulumi.Input<boolean | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* The user-supplied description of the Connectivity Test.
* Maximum of 512 characters.
*/
description?: pulumi.Input<string | undefined>;
/**
* Required. Destination specification of the Connectivity Test.
* You can use a combination of destination IP address, URI of a supported
* endpoint, project ID, or VPC network to identify the destination location.
* Reachability analysis proceeds even if the destination location is
* ambiguous. However, the test result might include endpoints or use a
* destination that you don't intend to test.
* Structure is documented below.
*/
destination: pulumi.Input<inputs.networkmanagement.ConnectivityTestDestination>;
/**
* Resource labels to represent user-provided metadata.
*
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* Unique name for the connectivity test.
*/
name?: pulumi.Input<string | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
/**
* IP Protocol of the test. When not provided, "TCP" is assumed.
*/
protocol?: pulumi.Input<string | undefined>;
/**
* Other projects that may be relevant for reachability analysis.
* This is applicable to scenarios where a test can cross project
* boundaries.
*/
relatedProjects?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* Whether run analysis for the return path from destination to source.
* Default value is false.
*/
roundTrip?: pulumi.Input<boolean | undefined>;
/**
* Required. Source specification of the Connectivity Test.
* You can use a combination of source IP address, URI of a supported
* endpoint, project ID, or VPC network to identify the source location.
* Reachability analysis might proceed even if the source location is
* ambiguous. However, the test result might include endpoints or use a source
* that you don't intend to test.
* Structure is documented below.
*/
source: pulumi.Input<inputs.networkmanagement.ConnectivityTestSource>;
}
//# sourceMappingURL=connectivityTest.d.ts.map