Skip to content

azurermIotTimeSeriesInsightsAccessPolicy

Manages an Azure IoT Time Series Insights Access Policy.

Example Usage

/*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 azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermIotTimeSeriesInsightsStandardEnvironmentExample =
  new azurerm.iotTimeSeriesInsightsStandardEnvironment.IotTimeSeriesInsightsStandardEnvironment(
    this,
    "example_1",
    {
      data_retention_time: "P30D",
      location: azurermResourceGroupExample.location,
      name: "example",
      resource_group_name: azurermResourceGroupExample.name,
      sku_name: "S1_1",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermIotTimeSeriesInsightsStandardEnvironmentExample.overrideLogicalId(
  "example"
);
const azurermIotTimeSeriesInsightsAccessPolicyExample =
  new azurerm.iotTimeSeriesInsightsAccessPolicy.IotTimeSeriesInsightsAccessPolicy(
    this,
    "example_2",
    {
      name: "example",
      principal_object_id: "aGUID",
      roles: ["Reader"],
      time_series_insights_environment_id:
        azurermIotTimeSeriesInsightsStandardEnvironmentExample.name,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermIotTimeSeriesInsightsAccessPolicyExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.

  • timeSeriesInsightsEnvironmentId - (Required) The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.

  • principalObjectId - (Required) The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.

  • roles - (Required) A list of roles to apply to the Access Policy. Valid values include contributor and reader.

  • description - (Optional) The description of the Azure IoT Time Series Insights Access Policy.

Attributes Reference

The following attributes are exported:

  • id - The ID of the IoT Time Series Insights Access Policy.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the IoT Time Series Insights Access Policy.
  • update - (Defaults to 30 minutes) Used when updating the IoT Time Series Insights Access Policy.
  • read - (Defaults to 5 minutes) Used when retrieving the IoT Time Series Insights Access Policy.
  • delete - (Defaults to 30 minutes) Used when deleting the IoT Time Series Insights Access Policy.

Import

Azure IoT Time Series Insights Access Policy can be imported using the resourceId, e.g.

terraform import azurerm_iot_time_series_insights_access_policy.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.TimeSeriesInsights/environments/environment1/accessPolicies/example