// *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; export class FirewallRule extends pulumi.CustomResource { /** * Get an existing FirewallRule 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. */ public static get(name: string, id: pulumi.Input, state?: FirewallRuleState, opts?: pulumi.CustomResourceOptions): FirewallRule { return new FirewallRule(name, state, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = 'timeweb-cloud:index/firewallRule:FirewallRule'; /** * Returns true if the given object is an instance of FirewallRule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is FirewallRule { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === FirewallRule.__pulumiType; } /** * Rule CIDR */ declare public readonly cidr: pulumi.Output; /** * Description for firewall */ declare public readonly description: pulumi.Output; /** * Rule direction */ declare public readonly direction: pulumi.Output; /** * ID of target firewall */ declare public readonly firewallId: pulumi.Output; declare public readonly firewallRuleId: pulumi.Output; /** * Port when rule protocol is TCP or UDP */ declare public readonly port: pulumi.Output; /** * Rule protocol */ declare public readonly protocol: pulumi.Output; /** * Create a FirewallRule 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: FirewallRuleArgs, opts?: pulumi.CustomResourceOptions) constructor(name: string, argsOrState?: FirewallRuleArgs | FirewallRuleState, opts?: pulumi.CustomResourceOptions) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState as FirewallRuleState | undefined; resourceInputs["cidr"] = state?.cidr; resourceInputs["description"] = state?.description; resourceInputs["direction"] = state?.direction; resourceInputs["firewallId"] = state?.firewallId; resourceInputs["firewallRuleId"] = state?.firewallRuleId; resourceInputs["port"] = state?.port; resourceInputs["protocol"] = state?.protocol; } else { const args = argsOrState as FirewallRuleArgs | undefined; if (args?.direction === undefined && !opts.urn) { throw new Error("Missing required property 'direction'"); } if (args?.firewallId === undefined && !opts.urn) { throw new Error("Missing required property 'firewallId'"); } if (args?.protocol === undefined && !opts.urn) { throw new Error("Missing required property 'protocol'"); } resourceInputs["cidr"] = args?.cidr; resourceInputs["description"] = args?.description; resourceInputs["direction"] = args?.direction; resourceInputs["firewallId"] = args?.firewallId; resourceInputs["firewallRuleId"] = args?.firewallRuleId; resourceInputs["port"] = args?.port; resourceInputs["protocol"] = args?.protocol; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FirewallRule.__pulumiType, name, resourceInputs, opts, false /*dependency*/, utilities.getPackage()); } } /** * Input properties used for looking up and filtering FirewallRule resources. */ export interface FirewallRuleState { /** * Rule CIDR */ cidr?: pulumi.Input; /** * Description for firewall */ description?: pulumi.Input; /** * Rule direction */ direction?: pulumi.Input; /** * ID of target firewall */ firewallId?: pulumi.Input; firewallRuleId?: pulumi.Input; /** * Port when rule protocol is TCP or UDP */ port?: pulumi.Input; /** * Rule protocol */ protocol?: pulumi.Input; } /** * The set of arguments for constructing a FirewallRule resource. */ export interface FirewallRuleArgs { /** * Rule CIDR */ cidr?: pulumi.Input; /** * Description for firewall */ description?: pulumi.Input; /** * Rule direction */ direction: pulumi.Input; /** * ID of target firewall */ firewallId: pulumi.Input; firewallRuleId?: pulumi.Input; /** * Port when rule protocol is TCP or UDP */ port?: pulumi.Input; /** * Rule protocol */ protocol: pulumi.Input; }