Viewing docs for Google Cloud v9.16.0
published on Thursday, Mar 19, 2026 by Pulumi
published on Thursday, Mar 19, 2026 by Pulumi
Viewing docs for Google Cloud v9.16.0
published on Thursday, Mar 19, 2026 by Pulumi
published on Thursday, Mar 19, 2026 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/v9/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)
public static Output<GetForwardingRuleResult> getForwardingRule(GetForwardingRuleArgs args, InvokeOptions options)
fn::invoke:
function: gcp:compute/getForwardingRule:getForwardingRule
arguments:
# arguments dictionaryThe following arguments are supported:
getForwardingRule Result
The following output properties are available:
- All
Ports bool - Allow
Global boolAccess - Allow
Psc boolGlobal Access - Backend
Service string - Base
Forwarding stringRule - Creation
Timestamp string - Description string
- Effective
Labels Dictionary<string, string> - Forwarding
Rule intId - Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Address string - Ip
Collection string - Ip
Protocol string - Ip
Version string - Is
Mirroring boolCollector - Label
Fingerprint string - Labels Dictionary<string, string>
- Load
Balancing stringScheme - Name string
- Network string
- Network
Tier string - No
Automate boolDns Zone - Port
Range string - Ports List<string>
- Psc
Connection stringId - Psc
Connection stringStatus - Pulumi
Labels Dictionary<string, string> - Recreate
Closed boolPsc - Self
Link string - Service
Directory List<GetRegistrations Forwarding Rule Service Directory Registration> - Service
Label string - Service
Name string - Source
Ip List<string>Ranges - Subnetwork string
- Target string
- Project string
- Region string
- All
Ports bool - Allow
Global boolAccess - Allow
Psc boolGlobal Access - Backend
Service string - Base
Forwarding stringRule - Creation
Timestamp string - Description string
- Effective
Labels map[string]string - Forwarding
Rule intId - Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Address string - Ip
Collection string - Ip
Protocol string - Ip
Version string - Is
Mirroring boolCollector - Label
Fingerprint string - Labels map[string]string
- Load
Balancing stringScheme - Name string
- Network string
- Network
Tier string - No
Automate boolDns Zone - Port
Range string - Ports []string
- Psc
Connection stringId - Psc
Connection stringStatus - Pulumi
Labels map[string]string - Recreate
Closed boolPsc - Self
Link string - Service
Directory []GetRegistrations Forwarding Rule Service Directory Registration - Service
Label string - Service
Name string - Source
Ip []stringRanges - Subnetwork string
- Target string
- Project string
- Region string
- all
Ports Boolean - allow
Global BooleanAccess - allow
Psc BooleanGlobal Access - backend
Service String - base
Forwarding StringRule - creation
Timestamp String - description String
- effective
Labels Map<String,String> - forwarding
Rule IntegerId - id String
- The provider-assigned unique ID for this managed resource.
- ip
Address String - ip
Collection String - ip
Protocol String - ip
Version String - is
Mirroring BooleanCollector - label
Fingerprint String - labels Map<String,String>
- load
Balancing StringScheme - name String
- network String
- network
Tier String - no
Automate BooleanDns Zone - port
Range String - ports List<String>
- psc
Connection StringId - psc
Connection StringStatus - pulumi
Labels Map<String,String> - recreate
Closed BooleanPsc - self
Link String - service
Directory List<GetRegistrations Forwarding Rule Service Directory Registration> - service
Label String - service
Name String - source
Ip List<String>Ranges - subnetwork String
- target String
- project String
- region String
- all
Ports boolean - allow
Global booleanAccess - allow
Psc booleanGlobal Access - backend
Service string - base
Forwarding stringRule - creation
Timestamp string - description string
- effective
Labels {[key: string]: string} - forwarding
Rule numberId - id string
- The provider-assigned unique ID for this managed resource.
- ip
Address string - ip
Collection string - ip
Protocol string - ip
Version string - is
Mirroring booleanCollector - label
Fingerprint string - labels {[key: string]: string}
- load
Balancing stringScheme - name string
- network string
- network
Tier string - no
Automate booleanDns Zone - port
Range string - ports string[]
- psc
Connection stringId - psc
Connection stringStatus - pulumi
Labels {[key: string]: string} - recreate
Closed booleanPsc - self
Link string - service
Directory GetRegistrations Forwarding Rule Service Directory Registration[] - service
Label string - service
Name string - source
Ip string[]Ranges - subnetwork string
- target string
- project string
- region string
- all_
ports bool - allow_
global_ boolaccess - allow_
psc_ boolglobal_ access - backend_
service str - base_
forwarding_ strrule - creation_
timestamp str - description str
- effective_
labels Mapping[str, str] - forwarding_
rule_ intid - id str
- The provider-assigned unique ID for this managed resource.
- ip_
address str - ip_
collection str - ip_
protocol str - ip_
version str - is_
mirroring_ boolcollector - label_
fingerprint str - labels Mapping[str, str]
- load_
balancing_ strscheme - name str
- network str
- network_
tier str - no_
automate_ booldns_ zone - port_
range str - ports Sequence[str]
- psc_
connection_ strid - psc_
connection_ strstatus - pulumi_
labels Mapping[str, str] - recreate_
closed_ boolpsc - self_
link str - service_
directory_ Sequence[Getregistrations Forwarding Rule Service Directory Registration] - service_
label str - service_
name str - source_
ip_ Sequence[str]ranges - subnetwork str
- target str
- project str
- region str
- all
Ports Boolean - allow
Global BooleanAccess - allow
Psc BooleanGlobal Access - backend
Service String - base
Forwarding StringRule - creation
Timestamp String - description String
- effective
Labels Map<String> - forwarding
Rule NumberId - id String
- The provider-assigned unique ID for this managed resource.
- ip
Address String - ip
Collection String - ip
Protocol String - ip
Version String - is
Mirroring BooleanCollector - label
Fingerprint String - labels Map<String>
- load
Balancing StringScheme - name String
- network String
- network
Tier String - no
Automate BooleanDns Zone - port
Range String - ports List<String>
- psc
Connection StringId - psc
Connection StringStatus - pulumi
Labels Map<String> - recreate
Closed BooleanPsc - self
Link String - service
Directory List<Property Map>Registrations - service
Label String - service
Name String - source
Ip List<String>Ranges - subnetwork String
- target String
- project String
- region String
Supporting Types
GetForwardingRuleServiceDirectoryRegistration
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.
Viewing docs for Google Cloud v9.16.0
published on Thursday, Mar 19, 2026 by Pulumi
published on Thursday, Mar 19, 2026 by Pulumi
