@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
322 lines • 11.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* A Named Set is a collection of IP addresses or ranges (for PREFIX type) or
* BGP communities (for COMMUNITY type) that can be used in route policies.
*
* > **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
* See Provider Versions for more details on beta resources.
*
* To get more information about RouterNamedSet, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/routers)
* * How-to Guides
* * [Google Cloud Router](https://cloud.google.com/router/docs/)
*
* ## Example Usage
*
* ### Router Named Set Route Policy
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const myNetwork = new gcp.compute.Network("my_network", {
* name: "my-network",
* autoCreateSubnetworks: false,
* });
* const myRouter = new gcp.compute.Router("my_router", {
* name: "my-router",
* network: myNetwork.name,
* region: "us-central1",
* bgp: {
* asn: 64514,
* },
* });
* const myPrefixSet = new gcp.compute.RouterNamedSet("my_prefix_set", {
* name: "prefix-set-name",
* router: myRouter.name,
* region: myRouter.region,
* description: "My example prefix named set",
* type: "NAMED_SET_TYPE_PREFIX",
* elements: [
* {
* expression: "'10.0.0.0/8'",
* title: "private-range",
* },
* {
* expression: "'172.16.0.0/12'",
* },
* {
* expression: "prefix('192.168.10.0/24').orLonger()",
* title: "or-longer-example",
* },
* ],
* });
* const myRoutePolicy = new gcp.compute.RouterRoutePolicy("my_route_policy", {
* name: "policy-name",
* router: myRouter.name,
* region: myRouter.region,
* type: "ROUTE_POLICY_TYPE_EXPORT",
* terms: [{
* priority: 1,
* match: {
* expression: pulumi.interpolate`destination.inAnyRange(prefixSets('${myPrefixSet.name}'))`,
* },
* actions: [{
* expression: "accept()",
* }],
* }],
* });
* ```
* ### Router Named Set Prefix
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const net = new gcp.compute.Network("net", {
* name: "my-network",
* autoCreateSubnetworks: false,
* });
* const router = new gcp.compute.Router("router", {
* name: "my-router",
* network: net.name,
* region: "us-central1",
* });
* const prefixSet = new gcp.compute.RouterNamedSet("prefix_set", {
* name: "my-prefix-set",
* router: router.name,
* region: "us-central1",
* description: "A sample prefix named set",
* type: "NAMED_SET_TYPE_PREFIX",
* elements: [
* {
* expression: "'10.0.0.0/8'",
* title: "ten-slash-eight",
* description: "A sample IPv4 prefix",
* },
* {
* expression: "'172.16.0.0/12'",
* title: "seventeen-two-slash-sixteen",
* },
* ],
* });
* ```
* ### Router Named Set Community
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const net = new gcp.compute.Network("net", {
* name: "my-network",
* autoCreateSubnetworks: false,
* });
* const router = new gcp.compute.Router("router", {
* name: "my-router",
* network: net.name,
* region: "us-central1",
* });
* const communitySet = new gcp.compute.RouterNamedSet("community_set", {
* name: "my-community-set",
* router: router.name,
* region: "us-central1",
* description: "A sample community named set",
* type: "NAMED_SET_TYPE_COMMUNITY",
* elements: [{
* expression: "'65512:100'",
* title: "community-one",
* description: "A sample BGP community",
* }],
* });
* ```
*
* ## Import
*
* RouterNamedSet can be imported using any of these accepted formats:
*
* * `{{project}}/{{region}}/{{router}}/namedSets/{{name}}`
* * `{{project}}/{{region}}/{{router}}/{{name}}`
* * `{{region}}/{{router}}/{{name}}`
* * `{{router}}/{{name}}`
*
* When using the `pulumi import` command, RouterNamedSet can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/routerNamedSet:RouterNamedSet default {{project}}/{{region}}/{{router}}/namedSets/{{name}}
* $ pulumi import gcp:compute/routerNamedSet:RouterNamedSet default {{project}}/{{region}}/{{router}}/{{name}}
* $ pulumi import gcp:compute/routerNamedSet:RouterNamedSet default {{region}}/{{router}}/{{name}}
* $ pulumi import gcp:compute/routerNamedSet:RouterNamedSet default {{router}}/{{name}}
* ```
*/
export declare class RouterNamedSet extends pulumi.CustomResource {
/**
* Get an existing RouterNamedSet 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?: RouterNamedSetState, opts?: pulumi.CustomResourceOptions): RouterNamedSet;
/**
* Returns true if the given object is an instance of RouterNamedSet. 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 RouterNamedSet;
/**
* 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>;
/**
* An optional description of the Named Set.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* CEL expressions that are comparable to constructs of this set's type.
* Structure is documented below.
*/
readonly elements: pulumi.Output<outputs.compute.RouterNamedSetElement[] | undefined>;
/**
* The fingerprint used for optimistic locking of this resource. Used
* internally during updates.
*/
readonly fingerprint: pulumi.Output<string>;
/**
* The name of the Named Set, which must be a resource ID segment and unique
* within all named sets owned by the Router.
*/
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>;
/**
* Region where the router resides.
*/
readonly region: pulumi.Output<string>;
/**
* The name of the Cloud Router in which this Named Set will be configured.
*/
readonly router: pulumi.Output<string>;
/**
* The type of the Named Set.
* Possible values are: `NAMED_SET_TYPE_PREFIX`, `NAMED_SET_TYPE_COMMUNITY`.
*/
readonly type: pulumi.Output<string>;
/**
* Create a RouterNamedSet 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: RouterNamedSetArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering RouterNamedSet resources.
*/
export interface RouterNamedSetState {
/**
* 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>;
/**
* An optional description of the Named Set.
*/
description?: pulumi.Input<string | undefined>;
/**
* CEL expressions that are comparable to constructs of this set's type.
* Structure is documented below.
*/
elements?: pulumi.Input<pulumi.Input<inputs.compute.RouterNamedSetElement>[] | undefined>;
/**
* The fingerprint used for optimistic locking of this resource. Used
* internally during updates.
*/
fingerprint?: pulumi.Input<string | undefined>;
/**
* The name of the Named Set, which must be a resource ID segment and unique
* within all named sets owned by the Router.
*/
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>;
/**
* Region where the router resides.
*/
region?: pulumi.Input<string | undefined>;
/**
* The name of the Cloud Router in which this Named Set will be configured.
*/
router?: pulumi.Input<string | undefined>;
/**
* The type of the Named Set.
* Possible values are: `NAMED_SET_TYPE_PREFIX`, `NAMED_SET_TYPE_COMMUNITY`.
*/
type?: pulumi.Input<string | undefined>;
}
/**
* The set of arguments for constructing a RouterNamedSet resource.
*/
export interface RouterNamedSetArgs {
/**
* 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>;
/**
* An optional description of the Named Set.
*/
description?: pulumi.Input<string | undefined>;
/**
* CEL expressions that are comparable to constructs of this set's type.
* Structure is documented below.
*/
elements?: pulumi.Input<pulumi.Input<inputs.compute.RouterNamedSetElement>[] | undefined>;
/**
* The name of the Named Set, which must be a resource ID segment and unique
* within all named sets owned by the Router.
*/
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>;
/**
* Region where the router resides.
*/
region?: pulumi.Input<string | undefined>;
/**
* The name of the Cloud Router in which this Named Set will be configured.
*/
router: pulumi.Input<string>;
/**
* The type of the Named Set.
* Possible values are: `NAMED_SET_TYPE_PREFIX`, `NAMED_SET_TYPE_COMMUNITY`.
*/
type: pulumi.Input<string>;
}
//# sourceMappingURL=routerNamedSet.d.ts.map