1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getForwardingRule
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

gcp.compute.getForwardingRule

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

    Get a forwarding rule within GCE from its name.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const my-forwarding-rule = gcp.compute.getForwardingRule({
        name: "forwarding-rule-us-east1",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_forwarding_rule = gcp.compute.get_forwarding_rule(name="forwarding-rule-us-east1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.LookupForwardingRule(ctx, &compute.LookupForwardingRuleArgs{
    			Name: "forwarding-rule-us-east1",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var my_forwarding_rule = Gcp.Compute.GetForwardingRule.Invoke(new()
        {
            Name = "forwarding-rule-us-east1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.ComputeFunctions;
    import com.pulumi.gcp.compute.inputs.GetForwardingRuleArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var my-forwarding-rule = ComputeFunctions.getForwardingRule(GetForwardingRuleArgs.builder()
                .name("forwarding-rule-us-east1")
                .build());
    
        }
    }
    
    variables:
      my-forwarding-rule:
        fn::invoke:
          Function: gcp:compute:getForwardingRule
          Arguments:
            name: forwarding-rule-us-east1
    

    Using getForwardingRule

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getForwardingRule(args: GetForwardingRuleArgs, opts?: InvokeOptions): Promise<GetForwardingRuleResult>
    function getForwardingRuleOutput(args: GetForwardingRuleOutputArgs, opts?: InvokeOptions): Output<GetForwardingRuleResult>
    def get_forwarding_rule(name: Optional[str] = None,
                            project: Optional[str] = None,
                            region: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetForwardingRuleResult
    def get_forwarding_rule_output(name: Optional[pulumi.Input[str]] = None,
                            project: Optional[pulumi.Input[str]] = None,
                            region: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetForwardingRuleResult]
    func LookupForwardingRule(ctx *Context, args *LookupForwardingRuleArgs, opts ...InvokeOption) (*LookupForwardingRuleResult, error)
    func LookupForwardingRuleOutput(ctx *Context, args *LookupForwardingRuleOutputArgs, opts ...InvokeOption) LookupForwardingRuleResultOutput

    > Note: This function is named LookupForwardingRule in the Go SDK.

    public static class GetForwardingRule 
    {
        public static Task<GetForwardingRuleResult> InvokeAsync(GetForwardingRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetForwardingRuleResult> Invoke(GetForwardingRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetForwardingRuleResult> getForwardingRule(GetForwardingRuleArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:compute/getForwardingRule:getForwardingRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the forwarding rule.


    Project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    The region in which the resource belongs. If it is not provided, the project region is used.
    Name string
    The name of the forwarding rule.


    Project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    The region in which the resource belongs. If it is not provided, the project region is used.
    name String
    The name of the forwarding rule.


    project String
    The project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    The region in which the resource belongs. If it is not provided, the project region is used.
    name string
    The name of the forwarding rule.


    project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    The region in which the resource belongs. If it is not provided, the project region is used.
    name str
    The name of the forwarding rule.


    project str
    The project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    The region in which the resource belongs. If it is not provided, the project region is used.
    name String
    The name of the forwarding rule.


    project String
    The project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    The region in which the resource belongs. If it is not provided, the project region is used.

    getForwardingRule Result

    The following output properties are available:

    AllPorts bool
    AllowGlobalAccess bool
    AllowPscGlobalAccess bool
    BackendService string
    BaseForwardingRule string
    CreationTimestamp string
    Description string
    EffectiveLabels Dictionary<string, string>
    ForwardingRuleId int
    Id string
    The provider-assigned unique ID for this managed resource.
    IpAddress string
    IpProtocol string
    IpVersion string
    IsMirroringCollector bool
    LabelFingerprint string
    Labels Dictionary<string, string>
    LoadBalancingScheme string
    Name string
    Network string
    NetworkTier string
    NoAutomateDnsZone bool
    PortRange string
    Ports List<string>
    PscConnectionId string
    PscConnectionStatus string
    PulumiLabels Dictionary<string, string>
    RecreateClosedPsc bool
    SelfLink string
    ServiceDirectoryRegistrations List<GetForwardingRuleServiceDirectoryRegistration>
    ServiceLabel string
    ServiceName string
    SourceIpRanges List<string>
    Subnetwork string
    Target string
    Project string
    Region string
    AllPorts bool
    AllowGlobalAccess bool
    AllowPscGlobalAccess bool
    BackendService string
    BaseForwardingRule string
    CreationTimestamp string
    Description string
    EffectiveLabels map[string]string
    ForwardingRuleId int
    Id string
    The provider-assigned unique ID for this managed resource.
    IpAddress string
    IpProtocol string
    IpVersion string
    IsMirroringCollector bool
    LabelFingerprint string
    Labels map[string]string
    LoadBalancingScheme string
    Name string
    Network string
    NetworkTier string
    NoAutomateDnsZone bool
    PortRange string
    Ports []string
    PscConnectionId string
    PscConnectionStatus string
    PulumiLabels map[string]string
    RecreateClosedPsc bool
    SelfLink string
    ServiceDirectoryRegistrations []GetForwardingRuleServiceDirectoryRegistration
    ServiceLabel string
    ServiceName string
    SourceIpRanges []string
    Subnetwork string
    Target string
    Project string
    Region string
    allPorts Boolean
    allowGlobalAccess Boolean
    allowPscGlobalAccess Boolean
    backendService String
    baseForwardingRule String
    creationTimestamp String
    description String
    effectiveLabels Map<String,String>
    forwardingRuleId Integer
    id String
    The provider-assigned unique ID for this managed resource.
    ipAddress String
    ipProtocol String
    ipVersion String
    isMirroringCollector Boolean
    labelFingerprint String
    labels Map<String,String>
    loadBalancingScheme String
    name String
    network String
    networkTier String
    noAutomateDnsZone Boolean
    portRange String
    ports List<String>
    pscConnectionId String
    pscConnectionStatus String
    pulumiLabels Map<String,String>
    recreateClosedPsc Boolean
    selfLink String
    serviceDirectoryRegistrations List<GetForwardingRuleServiceDirectoryRegistration>
    serviceLabel String
    serviceName String
    sourceIpRanges List<String>
    subnetwork String
    target String
    project String
    region String
    allPorts boolean
    allowGlobalAccess boolean
    allowPscGlobalAccess boolean
    backendService string
    baseForwardingRule string
    creationTimestamp string
    description string
    effectiveLabels {[key: string]: string}
    forwardingRuleId number
    id string
    The provider-assigned unique ID for this managed resource.
    ipAddress string
    ipProtocol string
    ipVersion string
    isMirroringCollector boolean
    labelFingerprint string
    labels {[key: string]: string}
    loadBalancingScheme string
    name string
    network string
    networkTier string
    noAutomateDnsZone boolean
    portRange string
    ports string[]
    pscConnectionId string
    pscConnectionStatus string
    pulumiLabels {[key: string]: string}
    recreateClosedPsc boolean
    selfLink string
    serviceDirectoryRegistrations GetForwardingRuleServiceDirectoryRegistration[]
    serviceLabel string
    serviceName string
    sourceIpRanges string[]
    subnetwork string
    target string
    project string
    region string
    all_ports bool
    allow_global_access bool
    allow_psc_global_access bool
    backend_service str
    base_forwarding_rule str
    creation_timestamp str
    description str
    effective_labels Mapping[str, str]
    forwarding_rule_id int
    id str
    The provider-assigned unique ID for this managed resource.
    ip_address str
    ip_protocol str
    ip_version str
    is_mirroring_collector bool
    label_fingerprint str
    labels Mapping[str, str]
    load_balancing_scheme str
    name str
    network str
    network_tier str
    no_automate_dns_zone bool
    port_range str
    ports Sequence[str]
    psc_connection_id str
    psc_connection_status str
    pulumi_labels Mapping[str, str]
    recreate_closed_psc bool
    self_link str
    service_directory_registrations Sequence[GetForwardingRuleServiceDirectoryRegistration]
    service_label str
    service_name str
    source_ip_ranges Sequence[str]
    subnetwork str
    target str
    project str
    region str
    allPorts Boolean
    allowGlobalAccess Boolean
    allowPscGlobalAccess Boolean
    backendService String
    baseForwardingRule String
    creationTimestamp String
    description String
    effectiveLabels Map<String>
    forwardingRuleId Number
    id String
    The provider-assigned unique ID for this managed resource.
    ipAddress String
    ipProtocol String
    ipVersion String
    isMirroringCollector Boolean
    labelFingerprint String
    labels Map<String>
    loadBalancingScheme String
    name String
    network String
    networkTier String
    noAutomateDnsZone Boolean
    portRange String
    ports List<String>
    pscConnectionId String
    pscConnectionStatus String
    pulumiLabels Map<String>
    recreateClosedPsc Boolean
    selfLink String
    serviceDirectoryRegistrations List<Property Map>
    serviceLabel String
    serviceName String
    sourceIpRanges List<String>
    subnetwork String
    target String
    project String
    region String

    Supporting Types

    GetForwardingRuleServiceDirectoryRegistration

    Namespace string
    Service Directory namespace to register the forwarding rule under.
    Service string
    Service Directory service to register the forwarding rule under.
    Namespace string
    Service Directory namespace to register the forwarding rule under.
    Service string
    Service Directory service to register the forwarding rule under.
    namespace String
    Service Directory namespace to register the forwarding rule under.
    service String
    Service Directory service to register the forwarding rule under.
    namespace string
    Service Directory namespace to register the forwarding rule under.
    service string
    Service Directory service to register the forwarding rule under.
    namespace str
    Service Directory namespace to register the forwarding rule under.
    service str
    Service Directory service to register the forwarding rule under.
    namespace String
    Service Directory namespace to register the forwarding rule under.
    service String
    Service Directory service to register the forwarding rule under.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi