@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
210 lines (209 loc) • 7.59 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* A Response Policy is a collection of selectors that apply to queries
* made against one or more Virtual Private Cloud networks.
*
* ## Example Usage
*
* ### Dns Response Policy Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const network_1 = new gcp.compute.Network("network-1", {
* name: "network-1",
* autoCreateSubnetworks: false,
* });
* const network_2 = new gcp.compute.Network("network-2", {
* name: "network-2",
* autoCreateSubnetworks: false,
* });
* const subnetwork_1 = new gcp.compute.Subnetwork("subnetwork-1", {
* name: network_1.name,
* network: network_1.name,
* ipCidrRange: "10.0.36.0/24",
* region: "us-central1",
* privateIpGoogleAccess: true,
* secondaryIpRanges: [
* {
* rangeName: "pod",
* ipCidrRange: "10.0.0.0/19",
* },
* {
* rangeName: "svc",
* ipCidrRange: "10.0.32.0/22",
* },
* ],
* });
* const cluster_1 = new gcp.container.Cluster("cluster-1", {
* name: "cluster-1",
* location: "us-central1-c",
* initialNodeCount: 1,
* networkingMode: "VPC_NATIVE",
* defaultSnatStatus: {
* disabled: true,
* },
* network: network_1.name,
* subnetwork: subnetwork_1.name,
* privateClusterConfig: {
* enablePrivateEndpoint: true,
* enablePrivateNodes: true,
* masterIpv4CidrBlock: "10.42.0.0/28",
* masterGlobalAccessConfig: {
* enabled: true,
* },
* },
* masterAuthorizedNetworksConfig: {},
* ipAllocationPolicy: {
* clusterSecondaryRangeName: subnetwork_1.secondaryIpRanges.apply(secondaryIpRanges => secondaryIpRanges[0].rangeName),
* servicesSecondaryRangeName: subnetwork_1.secondaryIpRanges.apply(secondaryIpRanges => secondaryIpRanges[1].rangeName),
* },
* deletionProtection: true,
* });
* const example_response_policy = new gcp.dns.ResponsePolicy("example-response-policy", {
* responsePolicyName: "example-response-policy",
* networks: [
* {
* networkUrl: network_1.id,
* },
* {
* networkUrl: network_2.id,
* },
* ],
* gkeClusters: [{
* gkeClusterName: cluster_1.id,
* }],
* });
* ```
*
* ## Import
*
* ResponsePolicy can be imported using any of these accepted formats:
*
* * `projects/{{project}}/responsePolicies/{{response_policy_name}}`
*
* * `{{project}}/{{response_policy_name}}`
*
* * `{{response_policy_name}}`
*
* When using the `pulumi import` command, ResponsePolicy can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:dns/responsePolicy:ResponsePolicy default projects/{{project}}/responsePolicies/{{response_policy_name}}
* ```
*
* ```sh
* $ pulumi import gcp:dns/responsePolicy:ResponsePolicy default {{project}}/{{response_policy_name}}
* ```
*
* ```sh
* $ pulumi import gcp:dns/responsePolicy:ResponsePolicy default {{response_policy_name}}
* ```
*/
export declare class ResponsePolicy extends pulumi.CustomResource {
/**
* Get an existing ResponsePolicy 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?: ResponsePolicyState, opts?: pulumi.CustomResourceOptions): ResponsePolicy;
/**
* Returns true if the given object is an instance of ResponsePolicy. 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 ResponsePolicy;
/**
* The description of the response policy, such as `My new response policy`.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The list of Google Kubernetes Engine clusters that can see this zone.
* Structure is documented below.
*/
readonly gkeClusters: pulumi.Output<outputs.dns.ResponsePolicyGkeCluster[] | undefined>;
/**
* The list of network names specifying networks to which this policy is applied.
* Structure is documented below.
*/
readonly networks: pulumi.Output<outputs.dns.ResponsePolicyNetwork[] | undefined>;
/**
* 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 user assigned name for this Response Policy, such as `myresponsepolicy`.
*/
readonly responsePolicyName: pulumi.Output<string>;
/**
* Create a ResponsePolicy 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: ResponsePolicyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ResponsePolicy resources.
*/
export interface ResponsePolicyState {
/**
* The description of the response policy, such as `My new response policy`.
*/
description?: pulumi.Input<string>;
/**
* The list of Google Kubernetes Engine clusters that can see this zone.
* Structure is documented below.
*/
gkeClusters?: pulumi.Input<pulumi.Input<inputs.dns.ResponsePolicyGkeCluster>[]>;
/**
* The list of network names specifying networks to which this policy is applied.
* Structure is documented below.
*/
networks?: pulumi.Input<pulumi.Input<inputs.dns.ResponsePolicyNetwork>[]>;
/**
* 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 user assigned name for this Response Policy, such as `myresponsepolicy`.
*/
responsePolicyName?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a ResponsePolicy resource.
*/
export interface ResponsePolicyArgs {
/**
* The description of the response policy, such as `My new response policy`.
*/
description?: pulumi.Input<string>;
/**
* The list of Google Kubernetes Engine clusters that can see this zone.
* Structure is documented below.
*/
gkeClusters?: pulumi.Input<pulumi.Input<inputs.dns.ResponsePolicyGkeCluster>[]>;
/**
* The list of network names specifying networks to which this policy is applied.
* Structure is documented below.
*/
networks?: pulumi.Input<pulumi.Input<inputs.dns.ResponsePolicyNetwork>[]>;
/**
* 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 user assigned name for this Response Policy, such as `myresponsepolicy`.
*/
responsePolicyName: pulumi.Input<string>;
}