Google Cloud (GCP) Classic

Pulumi Official
Package maintained by Pulumi
v6.32.0 published on Wednesday, Jul 20, 2022 by Pulumi

getForwardingRule

Get a forwarding rule within GCE from its name.

Example Usage

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var my_forwarding_rule = Output.Create(Gcp.Compute.GetForwardingRule.InvokeAsync(new Gcp.Compute.GetForwardingRuleArgs
        {
            Name = "forwarding-rule-us-east1",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var my-forwarding-rule = Output.of(ComputeFunctions.getForwardingRule(GetForwardingRuleArgs.builder()
            .name("forwarding-rule-us-east1")
            .build()));

    }
}
import pulumi
import pulumi_gcp as gcp

my_forwarding_rule = gcp.compute.get_forwarding_rule(name="forwarding-rule-us-east1")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const my_forwarding_rule = pulumi.output(gcp.compute.getForwardingRule({
    name: "forwarding-rule-us-east1",
}));
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
BackendService string
CreationTimestamp string
Description string
Id string

The provider-assigned unique ID for this managed resource.

IpAddress string
IpProtocol string
IsMirroringCollector bool
LabelFingerprint string
Labels Dictionary<string, string>
LoadBalancingScheme string
Name string
Network string
NetworkTier string
PortRange string
Ports List<string>
PscConnectionId string
PscConnectionStatus string
SelfLink string
ServiceDirectoryRegistrations List<GetForwardingRuleServiceDirectoryRegistration>
ServiceLabel string
ServiceName string
Subnetwork string
Target string
Project string
Region string
AllPorts bool
AllowGlobalAccess bool
BackendService string
CreationTimestamp string
Description string
Id string

The provider-assigned unique ID for this managed resource.

IpAddress string
IpProtocol string
IsMirroringCollector bool
LabelFingerprint string
Labels map[string]string
LoadBalancingScheme string
Name string
Network string
NetworkTier string
PortRange string
Ports []string
PscConnectionId string
PscConnectionStatus string
SelfLink string
ServiceDirectoryRegistrations []GetForwardingRuleServiceDirectoryRegistration
ServiceLabel string
ServiceName string
Subnetwork string
Target string
Project string
Region string
allPorts Boolean
allowGlobalAccess Boolean
backendService String
creationTimestamp String
description String
id String

The provider-assigned unique ID for this managed resource.

ipAddress String
ipProtocol String
isMirroringCollector Boolean
labelFingerprint String
labels Map<String,String>
loadBalancingScheme String
name String
network String
networkTier String
portRange String
ports List<String>
pscConnectionId String
pscConnectionStatus String
selfLink String
serviceDirectoryRegistrations List<GetForwardingRuleServiceDirectoryRegistration>
serviceLabel String
serviceName String
subnetwork String
target String
project String
region String
allPorts boolean
allowGlobalAccess boolean
backendService string
creationTimestamp string
description string
id string

The provider-assigned unique ID for this managed resource.

ipAddress string
ipProtocol string
isMirroringCollector boolean
labelFingerprint string
labels {[key: string]: string}
loadBalancingScheme string
name string
network string
networkTier string
portRange string
ports string[]
pscConnectionId string
pscConnectionStatus string
selfLink string
serviceDirectoryRegistrations GetForwardingRuleServiceDirectoryRegistration[]
serviceLabel string
serviceName string
subnetwork string
target string
project string
region string
allPorts Boolean
allowGlobalAccess Boolean
backendService String
creationTimestamp String
description String
id String

The provider-assigned unique ID for this managed resource.

ipAddress String
ipProtocol String
isMirroringCollector Boolean
labelFingerprint String
labels Map<String>
loadBalancingScheme String
name String
network String
networkTier String
portRange String
ports List<String>
pscConnectionId String
pscConnectionStatus String
selfLink String
serviceDirectoryRegistrations List<Property Map>
serviceLabel String
serviceName String
subnetwork String
target String
project String
region String

Supporting Types

GetForwardingRuleServiceDirectoryRegistration

Namespace string
Service string
Namespace string
Service string
namespace String
service String
namespace string
service string
namespace String
service String

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.