Skip to content

Data Source: azurermContainerGroup

Use this data source to access information about an existing Container Group instance.

Example Usage

import * as cdktf from "cdktf";
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const dataAzurermContainerGroupExample =
  new azurerm.dataAzurermContainerGroup.DataAzurermContainerGroup(
    this,
    "example",
    {
      name: "existing",
      resource_group_name: "existing",
    }
  );
new cdktf.TerraformOutput(this, "fqdn", {
  value: dataAzurermContainerGroupExample.fqdn,
});
new cdktf.TerraformOutput(this, "id", {
  value: dataAzurermContainerGroupExample.id,
});
new cdktf.TerraformOutput(this, "ip_address", {
  value: dataAzurermContainerGroupExample.ipAddress,
});

Arguments Reference

The following arguments are supported:

  • name - (Required) The name of this Container Group instance.

  • resourceGroupName - (Required) The name of the Resource Group where the Container Group instance exists.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Container Group instance.

  • ipAddress - The IP address allocated to the Container Group instance.

  • fqdn - The FQDN of the Container Group instance derived from dnsNameLabel.

  • location - The Azure Region where the Container Group instance exists.

  • identity - A identity block as defined below.

  • subnetIds - The subnet resource IDs for a container group.

  • zones - A list of Availability Zones in which this Container Group is located.

  • tags - A mapping of tags assigned to the Container Group instance.


A identity block exports the following:

  • type - Type of Managed Service Identity configured on this Container Group.

  • principalId - The Principal ID of the System Assigned Managed Service Identity that is configured on this Container Group.

  • tenantId - The Tenant ID of the System Assigned Managed Service Identity that is configured on this Container Group.

  • identityIds - The list of User Assigned Managed Identity IDs assigned to this Container Group.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • read - (Defaults to 5 minutes) Used when retrieving the Container Group instance.