UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

406 lines • 18.1 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages user created connections for Memorystore instance * * To get more information about InstanceDesiredUserCreatedEndpoints, see: * * * [API documentation](https://cloud.google.com/memorystore/docs/valkey/reference/rest/v1/projects.locations.instances) * * > **Note:** Please ensure your connections meet the requirements outlined at * https://cloud.google.com/memorystore/docs/valkey/about-multiple-vpc-networking#application_connection_requirements. * If you remove a connections item from the resource, the corresponding forwarding rule will no longer be functioning. * If the corresponding forwarding rule is represented in your terraform configuration it is recommended to delete that * `gcp.compute.ForwardingRule` resource at the same time. * * ## Example Usage * * ### Memorystore Instance Desired User Created Endpoints * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network1 = new gcp.compute.Network("network1", { * name: "net1", * autoCreateSubnetworks: false, * }); * const subnetNetwork1 = new gcp.compute.Subnetwork("subnet_network1", { * name: "subnet-net1", * ipCidrRange: "10.0.0.248/29", * region: "us-central1", * network: network1.id, * }); * const ip1Network1 = new gcp.compute.Address("ip1_network1", { * name: "ip1-net1", * region: "us-central1", * subnetwork: subnetNetwork1.id, * addressType: "INTERNAL", * purpose: "GCE_ENDPOINT", * }); * //Valkey instance without endpoints * const instance_user_connInstance = new gcp.memorystore.Instance("instance-user-conn", { * instanceId: "instance-user-conn", * shardCount: 1, * location: "us-central1", * deletionProtectionEnabled: false, * }); * const forwardingRule1Network1 = new gcp.compute.ForwardingRule("forwarding_rule1_network1", { * name: "fwd1-net1", * region: "us-central1", * ipAddress: ip1Network1.id, * loadBalancingScheme: "", * network: network1.id, * target: instance_user_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[0].serviceAttachment), * }); * const ip2Network1 = new gcp.compute.Address("ip2_network1", { * name: "ip2-net1", * region: "us-central1", * subnetwork: subnetNetwork1.id, * addressType: "INTERNAL", * purpose: "GCE_ENDPOINT", * }); * const forwardingRule2Network1 = new gcp.compute.ForwardingRule("forwarding_rule2_network1", { * name: "fwd2-net1", * region: "us-central1", * ipAddress: ip2Network1.id, * loadBalancingScheme: "", * network: network1.id, * target: instance_user_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[1].serviceAttachment), * }); * const network2 = new gcp.compute.Network("network2", { * name: "network2", * autoCreateSubnetworks: false, * }); * const subnetNetwork2 = new gcp.compute.Subnetwork("subnet_network2", { * name: "subnet-net2", * ipCidrRange: "10.0.0.248/29", * region: "us-central1", * network: network2.id, * }); * const ip1Network2 = new gcp.compute.Address("ip1_network2", { * name: "ip1-net2", * region: "us-central1", * subnetwork: subnetNetwork2.id, * addressType: "INTERNAL", * purpose: "GCE_ENDPOINT", * }); * const forwardingRule1Network2 = new gcp.compute.ForwardingRule("forwarding_rule1_network2", { * name: "fwd1-net2", * region: "us-central1", * ipAddress: ip1Network2.id, * loadBalancingScheme: "", * network: network2.id, * target: instance_user_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[0].serviceAttachment), * }); * const ip2Network2 = new gcp.compute.Address("ip2_network2", { * name: "ip2-net2", * region: "us-central1", * subnetwork: subnetNetwork2.id, * addressType: "INTERNAL", * purpose: "GCE_ENDPOINT", * }); * const forwardingRule2Network2 = new gcp.compute.ForwardingRule("forwarding_rule2_network2", { * name: "fwd2-net2", * region: "us-central1", * ipAddress: ip2Network2.id, * loadBalancingScheme: "", * network: network2.id, * target: instance_user_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[1].serviceAttachment), * }); * const instance_user_conn = new gcp.memorystore.InstanceDesiredUserCreatedEndpoints("instance-user-conn", { * name: "instance-user-conn", * region: "us-central1", * desiredUserCreatedEndpoints: [ * { * connections: [ * { * pscConnection: { * pscConnectionId: forwardingRule1Network1.pscConnectionId, * ipAddress: ip1Network1.address, * forwardingRule: forwardingRule1Network1.id, * network: network1.id, * serviceAttachment: instance_user_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[0].serviceAttachment), * }, * }, * { * pscConnection: { * pscConnectionId: forwardingRule2Network1.pscConnectionId, * ipAddress: ip2Network1.address, * forwardingRule: forwardingRule2Network1.id, * network: network1.id, * serviceAttachment: instance_user_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[1].serviceAttachment), * }, * }, * ], * }, * { * connections: [ * { * pscConnection: { * pscConnectionId: forwardingRule1Network2.pscConnectionId, * ipAddress: ip1Network2.address, * forwardingRule: forwardingRule1Network2.id, * network: network2.id, * serviceAttachment: instance_user_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[0].serviceAttachment), * }, * }, * { * pscConnection: { * pscConnectionId: forwardingRule2Network2.pscConnectionId, * ipAddress: ip2Network2.address, * forwardingRule: forwardingRule2Network2.id, * network: network2.id, * serviceAttachment: instance_user_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[1].serviceAttachment), * }, * }, * ], * }, * ], * }); * const project = gcp.organizations.getProject({}); * ``` * ### Memorystore Instance Desired User And Auto Created Endpoints * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network2 = new gcp.compute.Network("network2", { * name: "network2", * autoCreateSubnetworks: false, * }); * const subnetNetwork2 = new gcp.compute.Subnetwork("subnet_network2", { * name: "subnet-net2", * ipCidrRange: "10.0.0.248/29", * region: "us-central1", * network: network2.id, * }); * const ip1Network2 = new gcp.compute.Address("ip1_network2", { * name: "ip1-net2", * region: "us-central1", * subnetwork: subnetNetwork2.id, * addressType: "INTERNAL", * purpose: "GCE_ENDPOINT", * }); * const network1 = new gcp.compute.Network("network1", { * name: "net1", * autoCreateSubnetworks: false, * }); * const subnetNetwork1 = new gcp.compute.Subnetwork("subnet_network1", { * name: "subnet-net1", * ipCidrRange: "10.0.0.248/29", * region: "us-central1", * network: network1.id, * }); * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", { * name: "scpolicy", * location: "us-central1", * serviceClass: "gcp-memorystore", * description: "my basic service connection policy", * network: network1.id, * pscConfig: { * subnetworks: [subnetNetwork1.id], * }, * }); * const project = gcp.organizations.getProject({}); * //valkey instance with endpoints * const instance_user_auto_connInstance = new gcp.memorystore.Instance("instance-user-auto-conn", { * instanceId: "instance-user-auto-conn", * shardCount: 1, * desiredAutoCreatedEndpoints: [{ * network: network1.id, * projectId: project.then(project => project.projectId), * }], * location: "us-central1", * deletionProtectionEnabled: false, * }, { * dependsOn: [_default], * }); * const forwardingRule1Network2 = new gcp.compute.ForwardingRule("forwarding_rule1_network2", { * name: "fwd1-net2", * region: "us-central1", * ipAddress: ip1Network2.id, * loadBalancingScheme: "", * network: network2.id, * target: instance_user_auto_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[0].serviceAttachment), * }); * const ip2Network2 = new gcp.compute.Address("ip2_network2", { * name: "ip2-net2", * region: "us-central1", * subnetwork: subnetNetwork2.id, * addressType: "INTERNAL", * purpose: "GCE_ENDPOINT", * }); * const forwardingRule2Network2 = new gcp.compute.ForwardingRule("forwarding_rule2_network2", { * name: "fwd2-net2", * region: "us-central1", * ipAddress: ip2Network2.id, * loadBalancingScheme: "", * network: network2.id, * target: instance_user_auto_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[1].serviceAttachment), * }); * const instance_user_auto_conn = new gcp.memorystore.InstanceDesiredUserCreatedEndpoints("instance-user-auto-conn", { * name: "instance-user-auto-conn", * region: "us-central1", * desiredUserCreatedEndpoints: [{ * connections: [ * { * pscConnection: { * pscConnectionId: forwardingRule1Network2.pscConnectionId, * ipAddress: ip1Network2.address, * forwardingRule: forwardingRule1Network2.id, * network: network2.id, * serviceAttachment: instance_user_auto_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[0].serviceAttachment), * }, * }, * { * pscConnection: { * pscConnectionId: forwardingRule2Network2.pscConnectionId, * ipAddress: ip2Network2.address, * forwardingRule: forwardingRule2Network2.id, * network: network2.id, * serviceAttachment: instance_user_auto_connInstance.pscAttachmentDetails.apply(pscAttachmentDetails => pscAttachmentDetails[1].serviceAttachment), * }, * }, * ], * }], * }); * ``` * * ## Import * * InstanceDesiredUserCreatedEndpoints can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{region}}/instances/{{name}}` * * `{{project}}/{{region}}/{{name}}` * * `{{region}}/{{name}}` * * `{{name}}` * * When using the `pulumi import` command, InstanceDesiredUserCreatedEndpoints can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:memorystore/instanceDesiredUserCreatedEndpoints:InstanceDesiredUserCreatedEndpoints default projects/{{project}}/locations/{{region}}/instances/{{name}} * $ pulumi import gcp:memorystore/instanceDesiredUserCreatedEndpoints:InstanceDesiredUserCreatedEndpoints default {{project}}/{{region}}/{{name}} * $ pulumi import gcp:memorystore/instanceDesiredUserCreatedEndpoints:InstanceDesiredUserCreatedEndpoints default {{region}}/{{name}} * $ pulumi import gcp:memorystore/instanceDesiredUserCreatedEndpoints:InstanceDesiredUserCreatedEndpoints default {{name}} * ``` */ export declare class InstanceDesiredUserCreatedEndpoints extends pulumi.CustomResource { /** * Get an existing InstanceDesiredUserCreatedEndpoints 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?: InstanceDesiredUserCreatedEndpointsState, opts?: pulumi.CustomResourceOptions): InstanceDesiredUserCreatedEndpoints; /** * Returns true if the given object is an instance of InstanceDesiredUserCreatedEndpoints. 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 InstanceDesiredUserCreatedEndpoints; /** * 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>; /** * A list of desired user endpoints * Structure is documented below. */ readonly desiredUserCreatedEndpoints: pulumi.Output<outputs.memorystore.InstanceDesiredUserCreatedEndpointsDesiredUserCreatedEndpoint[] | undefined>; /** * The name of the Memorystore instance these endpoints should be added to. */ 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>; /** * The name of the region of the Memorystore instance these endpoints should be added to. */ readonly region: pulumi.Output<string>; /** * Create a InstanceDesiredUserCreatedEndpoints 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: InstanceDesiredUserCreatedEndpointsArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering InstanceDesiredUserCreatedEndpoints resources. */ export interface InstanceDesiredUserCreatedEndpointsState { /** * 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>; /** * A list of desired user endpoints * Structure is documented below. */ desiredUserCreatedEndpoints?: pulumi.Input<pulumi.Input<inputs.memorystore.InstanceDesiredUserCreatedEndpointsDesiredUserCreatedEndpoint>[] | undefined>; /** * The name of the Memorystore instance these endpoints should be added to. */ 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>; /** * The name of the region of the Memorystore instance these endpoints should be added to. */ region?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a InstanceDesiredUserCreatedEndpoints resource. */ export interface InstanceDesiredUserCreatedEndpointsArgs { /** * 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>; /** * A list of desired user endpoints * Structure is documented below. */ desiredUserCreatedEndpoints?: pulumi.Input<pulumi.Input<inputs.memorystore.InstanceDesiredUserCreatedEndpointsDesiredUserCreatedEndpoint>[] | undefined>; /** * The name of the Memorystore instance these endpoints should be added to. */ 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>; /** * The name of the region of the Memorystore instance these endpoints should be added to. */ region: pulumi.Input<string>; } //# sourceMappingURL=instanceDesiredUserCreatedEndpoints.d.ts.map