@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
238 lines (237 loc) • 8.57 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* An individual endpoint that provides a service.
*
* To get more information about Endpoint, see:
*
* * [API documentation](https://cloud.google.com/service-directory/docs/reference/rest/v1beta1/projects.locations.namespaces.services.endpoints)
* * How-to Guides
* * [Configuring an endpoint](https://cloud.google.com/service-directory/docs/configuring-service-directory#configuring_an_endpoint)
*
* ## Example Usage
*
* ### Service Directory Endpoint Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const example = new gcp.servicedirectory.Namespace("example", {
* namespaceId: "example-namespace",
* location: "us-central1",
* });
* const exampleService = new gcp.servicedirectory.Service("example", {
* serviceId: "example-service",
* namespace: example.id,
* });
* const exampleEndpoint = new gcp.servicedirectory.Endpoint("example", {
* endpointId: "example-endpoint",
* service: exampleService.id,
* metadata: {
* stage: "prod",
* region: "us-central1",
* },
* address: "1.2.3.4",
* port: 5353,
* });
* ```
* ### Service Directory Endpoint With Network
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const example = new gcp.compute.Network("example", {name: "example-network"});
* const exampleNamespace = new gcp.servicedirectory.Namespace("example", {
* namespaceId: "example-namespace",
* location: "us-central1",
* });
* const exampleService = new gcp.servicedirectory.Service("example", {
* serviceId: "example-service",
* namespace: exampleNamespace.id,
* });
* const exampleEndpoint = new gcp.servicedirectory.Endpoint("example", {
* endpointId: "example-endpoint",
* service: exampleService.id,
* metadata: {
* stage: "prod",
* region: "us-central1",
* },
* network: pulumi.all([project, example.name]).apply(([project, name]) => `projects/${project.number}/locations/global/networks/${name}`),
* address: "1.2.3.4",
* port: 5353,
* });
* ```
*
* ## Import
*
* Endpoint can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/namespaces/{{namespace_id}}/services/{{service_id}}/endpoints/{{endpoint_id}}`
*
* * `{{project}}/{{location}}/{{namespace_id}}/{{service_id}}/{{endpoint_id}}`
*
* * `{{location}}/{{namespace_id}}/{{service_id}}/{{endpoint_id}}`
*
* When using the `pulumi import` command, Endpoint can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:servicedirectory/endpoint:Endpoint default projects/{{project}}/locations/{{location}}/namespaces/{{namespace_id}}/services/{{service_id}}/endpoints/{{endpoint_id}}
* ```
*
* ```sh
* $ pulumi import gcp:servicedirectory/endpoint:Endpoint default {{project}}/{{location}}/{{namespace_id}}/{{service_id}}/{{endpoint_id}}
* ```
*
* ```sh
* $ pulumi import gcp:servicedirectory/endpoint:Endpoint default {{location}}/{{namespace_id}}/{{service_id}}/{{endpoint_id}}
* ```
*/
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;
/**
* IPv4 or IPv6 address of the endpoint.
*/
readonly address: pulumi.Output<string | undefined>;
/**
* The Resource ID must be 1-63 characters long, including digits,
* lowercase letters or the hyphen character.
*
*
* - - -
*/
readonly endpointId: pulumi.Output<string>;
/**
* Metadata for the endpoint. This data can be consumed
* by service clients. The entire metadata dictionary may contain
* up to 512 characters, spread across all key-value pairs.
* Metadata that goes beyond any these limits will be rejected.
*/
readonly metadata: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The resource name for the endpoint in the format
* `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
*/
readonly name: pulumi.Output<string>;
/**
* The URL to the network, such as projects/PROJECT_NUMBER/locations/global/networks/NETWORK_NAME.
*/
readonly network: pulumi.Output<string | undefined>;
/**
* Port that the endpoint is running on, must be in the
* range of [0, 65535]. If unspecified, the default is 0.
*/
readonly port: pulumi.Output<number | undefined>;
/**
* The resource name of the service that this endpoint provides.
*/
readonly service: pulumi.Output<string>;
/**
* 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 {
/**
* IPv4 or IPv6 address of the endpoint.
*/
address?: pulumi.Input<string>;
/**
* The Resource ID must be 1-63 characters long, including digits,
* lowercase letters or the hyphen character.
*
*
* - - -
*/
endpointId?: pulumi.Input<string>;
/**
* Metadata for the endpoint. This data can be consumed
* by service clients. The entire metadata dictionary may contain
* up to 512 characters, spread across all key-value pairs.
* Metadata that goes beyond any these limits will be rejected.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The resource name for the endpoint in the format
* `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
*/
name?: pulumi.Input<string>;
/**
* The URL to the network, such as projects/PROJECT_NUMBER/locations/global/networks/NETWORK_NAME.
*/
network?: pulumi.Input<string>;
/**
* Port that the endpoint is running on, must be in the
* range of [0, 65535]. If unspecified, the default is 0.
*/
port?: pulumi.Input<number>;
/**
* The resource name of the service that this endpoint provides.
*/
service?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Endpoint resource.
*/
export interface EndpointArgs {
/**
* IPv4 or IPv6 address of the endpoint.
*/
address?: pulumi.Input<string>;
/**
* The Resource ID must be 1-63 characters long, including digits,
* lowercase letters or the hyphen character.
*
*
* - - -
*/
endpointId: pulumi.Input<string>;
/**
* Metadata for the endpoint. This data can be consumed
* by service clients. The entire metadata dictionary may contain
* up to 512 characters, spread across all key-value pairs.
* Metadata that goes beyond any these limits will be rejected.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The URL to the network, such as projects/PROJECT_NUMBER/locations/global/networks/NETWORK_NAME.
*/
network?: pulumi.Input<string>;
/**
* Port that the endpoint is running on, must be in the
* range of [0, 65535]. If unspecified, the default is 0.
*/
port?: pulumi.Input<number>;
/**
* The resource name of the service that this endpoint provides.
*/
service: pulumi.Input<string>;
}