terraform-provider-google/website/docs/d/datasource_compute_global_address.html.markdown
thomas 8ee14c4424 Add the "google_compute_global_address" datasource (#759)
* Add the "compute_global_address" datasource

* Add a basic test for the "compute_global_address" datasource

* Include the "compute_global_address" in the provider

* Add docs for the "compute_global_address" datasource
2017-11-17 11:22:37 -08:00

1.5 KiB

layout page_title sidebar_current description
google Google: google_compute_global_address docs-google-datasource-compute-global-address Get the IP address from a static address reserved for a Global Forwarding Rule.

google_compute_global_address

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

data "google_compute_global_address" "my_address" {
  name = "foobar"
}

resource "google_dns_record_set" "frontend" {
  name = "lb.${google_dns_managed_zone.prod.dns_name}"
  type = "A"
  ttl  = 300

  managed_zone = "${google_dns_managed_zone.prod.name}"

  rrdatas = ["${data.google_compute_global_address.my_address.address}"]
}

resource "google_dns_managed_zone" "prod" {
  name     = "prod-zone"
  dns_name = "prod.mydomain.com."
}

Argument Reference

The following arguments are supported:

  • name - (Required) A unique name for the resource, required by GCE.

  • project - (Optional) The project in which the resource belongs. If it is not provided, the provider project is used.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • self_link - The URI of the created resource.
  • address - The IP of the created resource.
  • status - Indicates if the address is used. Possible values are: RESERVED or IN_USE.