Skip to content

googleComputeAddress

Get the IP address from a static address. For more information see the official API documentation.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleDnsManagedZoneProd = new google.dnsManagedZone.DnsManagedZone(
  this,
  "prod",
  {
    dns_name: "prod.mydomain.com.",
    name: "prod-zone",
  }
);
const dataGoogleComputeAddressMyAddress =
  new google.dataGoogleComputeAddress.DataGoogleComputeAddress(
    this,
    "my_address",
    {
      name: "foobar",
    }
  );
new google.dnsRecordSet.DnsRecordSet(this, "frontend", {
  managed_zone: googleDnsManagedZoneProd.name,
  name: `frontend.\${${googleDnsManagedZoneProd.dnsName}}`,
  rrdatas: [dataGoogleComputeAddressMyAddress.address],
  ttl: 300,
  type: "A",
});

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.

  • region - (Optional) The Region in which the created address reside. If it is not provided, the provider region is used.

Attributes Reference

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

  • selfLink - 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.