@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
189 lines (188 loc) • 6.65 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Mange the named ports setting for a managed instance group without
* managing the group as whole. This resource is primarily intended for use
* with GKE-generated groups that shouldn't otherwise be managed by other
* tools.
*
* To get more information about InstanceGroupNamedPort, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/instanceGroup)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/compute/docs/instance-groups/)
*
* ## Example Usage
*
* ### Instance Group Named Port Gke
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const containerNetwork = new gcp.compute.Network("container_network", {
* name: "container-network",
* autoCreateSubnetworks: false,
* });
* const containerSubnetwork = new gcp.compute.Subnetwork("container_subnetwork", {
* name: "container-subnetwork",
* region: "us-central1",
* network: containerNetwork.name,
* ipCidrRange: "10.0.36.0/24",
* });
* const myCluster = new gcp.container.Cluster("my_cluster", {
* name: "my-cluster",
* location: "us-central1-a",
* initialNodeCount: 1,
* network: containerNetwork.name,
* subnetwork: containerSubnetwork.name,
* ipAllocationPolicy: {
* clusterIpv4CidrBlock: "/19",
* servicesIpv4CidrBlock: "/22",
* },
* deletionProtection: true,
* });
* const myPort = new gcp.compute.InstanceGroupNamedPort("my_port", {
* group: myCluster.nodePools.apply(nodePools => nodePools[0].instanceGroupUrls?.[0]),
* zone: "us-central1-a",
* name: "http",
* port: 8080,
* });
* const myPorts = new gcp.compute.InstanceGroupNamedPort("my_ports", {
* group: myCluster.nodePools.apply(nodePools => nodePools[0].instanceGroupUrls?.[0]),
* zone: "us-central1-a",
* name: "https",
* port: 4443,
* });
* ```
*
* ## Import
*
* InstanceGroupNamedPort can be imported using any of these accepted formats:
*
* * `projects/{{project}}/zones/{{zone}}/instanceGroups/{{group}}/{{port}}/{{name}}`
*
* * `{{project}}/{{zone}}/{{group}}/{{port}}/{{name}}`
*
* * `{{zone}}/{{group}}/{{port}}/{{name}}`
*
* * `{{group}}/{{port}}/{{name}}`
*
* When using the `pulumi import` command, InstanceGroupNamedPort can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/instanceGroupNamedPort:InstanceGroupNamedPort default projects/{{project}}/zones/{{zone}}/instanceGroups/{{group}}/{{port}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/instanceGroupNamedPort:InstanceGroupNamedPort default {{project}}/{{zone}}/{{group}}/{{port}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/instanceGroupNamedPort:InstanceGroupNamedPort default {{zone}}/{{group}}/{{port}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/instanceGroupNamedPort:InstanceGroupNamedPort default {{group}}/{{port}}/{{name}}
* ```
*/
export declare class InstanceGroupNamedPort extends pulumi.CustomResource {
/**
* Get an existing InstanceGroupNamedPort 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?: InstanceGroupNamedPortState, opts?: pulumi.CustomResourceOptions): InstanceGroupNamedPort;
/**
* Returns true if the given object is an instance of InstanceGroupNamedPort. 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 InstanceGroupNamedPort;
/**
* The name of the instance group.
*/
readonly group: pulumi.Output<string>;
/**
* The name for this named port. The name must be 1-63 characters
* long, and comply with RFC1035.
*/
readonly name: pulumi.Output<string>;
/**
* The port number, which can be a value between 1 and 65535.
*/
readonly port: pulumi.Output<number>;
/**
* 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>;
/**
* The zone of the instance group.
*/
readonly zone: pulumi.Output<string>;
/**
* Create a InstanceGroupNamedPort 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: InstanceGroupNamedPortArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering InstanceGroupNamedPort resources.
*/
export interface InstanceGroupNamedPortState {
/**
* The name of the instance group.
*/
group?: pulumi.Input<string>;
/**
* The name for this named port. The name must be 1-63 characters
* long, and comply with RFC1035.
*/
name?: pulumi.Input<string>;
/**
* The port number, which can be a value between 1 and 65535.
*/
port?: pulumi.Input<number>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The zone of the instance group.
*/
zone?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a InstanceGroupNamedPort resource.
*/
export interface InstanceGroupNamedPortArgs {
/**
* The name of the instance group.
*/
group: pulumi.Input<string>;
/**
* The name for this named port. The name must be 1-63 characters
* long, and comply with RFC1035.
*/
name?: pulumi.Input<string>;
/**
* The port number, which can be a value between 1 and 65535.
*/
port: pulumi.Input<number>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The zone of the instance group.
*/
zone?: pulumi.Input<string>;
}