UNPKG

@pulumi/hcloud

Version:

A Pulumi package for creating and managing hcloud cloud resources.

130 lines (129 loc) 4.39 kB
import * as pulumi from "@pulumi/pulumi"; /** * Attaches resource to a Hetzner Cloud Firewall. * * _Note_: only one `hcloud.FirewallAttachment` per Firewall is allowed. * Any resources that should be attached to that Firewall need to be * specified in that `hcloud.FirewallAttachment`. * * ## Example Usage * * ### Attach Servers * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as hcloud from "@pulumi/hcloud"; * * const testServer = new hcloud.Server("test_server", { * name: "test-server", * serverType: "cx22", * image: "ubuntu-20.04", * }); * const basicFirewall = new hcloud.Firewall("basic_firewall", {name: "basic_firewall"}); * const fwRef = new hcloud.FirewallAttachment("fw_ref", { * firewallId: basicFirewall.id, * serverIds: [testServer.id], * }); * ``` * * ### Attach Label Selectors * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as hcloud from "@pulumi/hcloud"; * * const testServer = new hcloud.Server("test_server", { * name: "test-server", * serverType: "cx22", * image: "ubuntu-20.04", * labels: { * "firewall-attachment": "test-server", * }, * }); * const basicFirewall = new hcloud.Firewall("basic_firewall", {name: "basic_firewall"}); * const fwRef = new hcloud.FirewallAttachment("fw_ref", { * firewallId: basicFirewall.id, * labelSelectors: ["firewall-attachment=test-server"], * }); * ``` */ export declare class FirewallAttachment extends pulumi.CustomResource { /** * Get an existing FirewallAttachment 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?: FirewallAttachmentState, opts?: pulumi.CustomResourceOptions): FirewallAttachment; /** * Returns true if the given object is an instance of FirewallAttachment. 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 FirewallAttachment; /** * ID of the firewall the resources * should be attached to. */ readonly firewallId: pulumi.Output<number>; /** * List of label selectors used to * select resources to attach to the firewall. */ readonly labelSelectors: pulumi.Output<string[] | undefined>; /** * List of Server IDs to attach to the * firewall. */ readonly serverIds: pulumi.Output<number[] | undefined>; /** * Create a FirewallAttachment 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: FirewallAttachmentArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FirewallAttachment resources. */ export interface FirewallAttachmentState { /** * ID of the firewall the resources * should be attached to. */ firewallId?: pulumi.Input<number>; /** * List of label selectors used to * select resources to attach to the firewall. */ labelSelectors?: pulumi.Input<pulumi.Input<string>[]>; /** * List of Server IDs to attach to the * firewall. */ serverIds?: pulumi.Input<pulumi.Input<number>[]>; } /** * The set of arguments for constructing a FirewallAttachment resource. */ export interface FirewallAttachmentArgs { /** * ID of the firewall the resources * should be attached to. */ firewallId: pulumi.Input<number>; /** * List of label selectors used to * select resources to attach to the firewall. */ labelSelectors?: pulumi.Input<pulumi.Input<string>[]>; /** * List of Server IDs to attach to the * firewall. */ serverIds?: pulumi.Input<pulumi.Input<number>[]>; }