getGlobalAddress

Get the IP address from a static address reserved for a Global Forwarding Rule which are only used for HTTP load balancing. For more information see the official API documentation.

Example Usage

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.GetGlobalAddressArgs;
import com.pulumi.gcp.dns.ManagedZone;
import com.pulumi.gcp.dns.ManagedZoneArgs;
import com.pulumi.gcp.dns.RecordSet;
import com.pulumi.gcp.dns.RecordSetArgs;
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 myAddress = ComputeFunctions.getGlobalAddress(GetGlobalAddressArgs.builder()
.name("foobar")
.build());
var prod = new ManagedZone("prod", ManagedZoneArgs.builder()
.dnsName("prod.mydomain.com.")
.build());
var frontend = new RecordSet("frontend", RecordSetArgs.builder()
.name(prod.dnsName().applyValue(dnsName -> String.format("lb.%s", dnsName)))
.type("A")
.ttl(300)
.managedZone(prod.name())
.rrdatas(myAddress.applyValue(getGlobalAddressResult -> getGlobalAddressResult.address()))
.build());
}
}

Return

A collection of values returned by getGlobalAddress.

Parameters

argument

A collection of arguments for invoking getGlobalAddress.


suspend fun getGlobalAddress(name: String, project: String? = null): GetGlobalAddressResult

Return

A collection of values returned by getGlobalAddress.

Parameters

name

A unique name for the resource, required by GCE.

project

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

See also


Return

A collection of values returned by getGlobalAddress.

Parameters

argument

Builder for com.pulumi.gcp.compute.kotlin.inputs.GetGlobalAddressPlainArgs.

See also