Google Cloud (GCP) Classic

v6.39.0 published on Wednesday, Sep 28, 2022 by Pulumi

getGlobalForwardingRule

Get a global forwarding rule within GCE from its name.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var my_forwarding_rule = Gcp.Compute.GetGlobalForwardingRule.Invoke(new()
    {
        Name = "forwarding-rule-global",
    });

});
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.LookupGlobalForwardingRule(ctx, &compute.LookupGlobalForwardingRuleArgs{
			Name: "forwarding-rule-global",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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.GetGlobalForwardingRuleArgs;
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.getGlobalForwardingRule(GetGlobalForwardingRuleArgs.builder()
            .name("forwarding-rule-global")
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

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

const my_forwarding_rule = pulumi.output(gcp.compute.getGlobalForwardingRule({
    name: "forwarding-rule-global",
}));
variables:
  my-forwarding-rule:
    Fn::Invoke:
      Function: gcp:compute:getGlobalForwardingRule
      Arguments:
        name: forwarding-rule-global

Using getGlobalForwardingRule

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 getGlobalForwardingRule(args: GetGlobalForwardingRuleArgs, opts?: InvokeOptions): Promise<GetGlobalForwardingRuleResult>
function getGlobalForwardingRuleOutput(args: GetGlobalForwardingRuleOutputArgs, opts?: InvokeOptions): Output<GetGlobalForwardingRuleResult>
def get_global_forwarding_rule(name: Optional[str] = None,
                               project: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetGlobalForwardingRuleResult
def get_global_forwarding_rule_output(name: Optional[pulumi.Input[str]] = None,
                               project: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetGlobalForwardingRuleResult]
func LookupGlobalForwardingRule(ctx *Context, args *LookupGlobalForwardingRuleArgs, opts ...InvokeOption) (*LookupGlobalForwardingRuleResult, error)
func LookupGlobalForwardingRuleOutput(ctx *Context, args *LookupGlobalForwardingRuleOutputArgs, opts ...InvokeOption) LookupGlobalForwardingRuleResultOutput

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

public static class GetGlobalForwardingRule 
{
    public static Task<GetGlobalForwardingRuleResult> InvokeAsync(GetGlobalForwardingRuleArgs args, InvokeOptions? opts = null)
    public static Output<GetGlobalForwardingRuleResult> Invoke(GetGlobalForwardingRuleInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetGlobalForwardingRuleResult> getGlobalForwardingRule(GetGlobalForwardingRuleArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: gcp:compute/getGlobalForwardingRule:getGlobalForwardingRule
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Name string

The name of the global forwarding rule.

Project string

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

Name string

The name of the global forwarding rule.

Project string

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

name String

The name of the global forwarding rule.

project String

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

name string

The name of the global forwarding rule.

project string

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

name str

The name of the global forwarding rule.

project str

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

name String

The name of the global forwarding rule.

project String

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

getGlobalForwardingRule Result

The following output properties are available:

Description string
Id string

The provider-assigned unique ID for this managed resource.

IpAddress string
IpProtocol string
IpVersion string
LabelFingerprint string
Labels Dictionary<string, string>
LoadBalancingScheme string
MetadataFilters List<GetGlobalForwardingRuleMetadataFilter>
Name string
Network string
PortRange string
PscConnectionId string
PscConnectionStatus string
SelfLink string
Target string
Project string
Description string
Id string

The provider-assigned unique ID for this managed resource.

IpAddress string
IpProtocol string
IpVersion string
LabelFingerprint string
Labels map[string]string
LoadBalancingScheme string
MetadataFilters []GetGlobalForwardingRuleMetadataFilter
Name string
Network string
PortRange string
PscConnectionId string
PscConnectionStatus string
SelfLink string
Target string
Project string
description String
id String

The provider-assigned unique ID for this managed resource.

ipAddress String
ipProtocol String
ipVersion String
labelFingerprint String
labels Map<String,String>
loadBalancingScheme String
metadataFilters List<GetGlobalForwardingRuleMetadataFilter>
name String
network String
portRange String
pscConnectionId String
pscConnectionStatus String
selfLink String
target String
project String
description string
id string

The provider-assigned unique ID for this managed resource.

ipAddress string
ipProtocol string
ipVersion string
labelFingerprint string
labels {[key: string]: string}
loadBalancingScheme string
metadataFilters GetGlobalForwardingRuleMetadataFilter[]
name string
network string
portRange string
pscConnectionId string
pscConnectionStatus string
selfLink string
target string
project string
description String
id String

The provider-assigned unique ID for this managed resource.

ipAddress String
ipProtocol String
ipVersion String
labelFingerprint String
labels Map<String>
loadBalancingScheme String
metadataFilters List<Property Map>
name String
network String
portRange String
pscConnectionId String
pscConnectionStatus String
selfLink String
target String
project String

Supporting Types

GetGlobalForwardingRuleMetadataFilter

GetGlobalForwardingRuleMetadataFilterFilterLabel

Name string

The name of the global forwarding rule.

Value string
Name string

The name of the global forwarding rule.

Value string
name String

The name of the global forwarding rule.

value String
name string

The name of the global forwarding rule.

value string
name str

The name of the global forwarding rule.

value str
name String

The name of the global forwarding rule.

value 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.