Skip to content

Data Source: azurermStorageManagementPolicy

Use this data source to access information about an existing Storage Management 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 dataAzurermStorageAccountExample =
  new azurerm.dataAzurermStorageAccount.DataAzurermStorageAccount(
    this,
    "example",
    {
      name: "storageaccountname",
      resource_group_name: "resourcegroupname",
    }
  );
const dataAzurermStorageManagementPolicyExample =
  new azurerm.dataAzurermStorageManagementPolicy.DataAzurermStorageManagementPolicy(
    this,
    "example_1",
    {
      storage_account_id: dataAzurermStorageAccountExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAzurermStorageManagementPolicyExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • storageAccountId - Specifies the id of the storage account to retrieve the management policy for.

Attributes Reference

  • id - The ID of the Management Policy.
  • rule - A rule block as documented below.

  • rule supports the following:

  • name - A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.

  • enabled - Boolean to specify whether the rule is enabled.

  • filters - A filter block as documented below.

  • actions - An actions block as documented below.


filters supports the following:

  • prefixMatch - An array of strings for prefixes to be matched.
  • blobTypes - An array of predefined values. Valid options are blockBlob and appendBlob.
  • matchBlobIndexTag - A matchBlobIndexTag block as defined below. The block defines the blob index tag based filtering for blob objects.

actions supports the following:

  • baseBlob - A baseBlob block as documented below.
  • snapshot - A snapshot block as documented below.
  • version - A version block as documented below.

baseBlob supports the following:

  • tierToCoolAfterDaysSinceModificationGreaterThan - The age in days after last modification to tier blobs to cool storage. Supports blob currently at Hot tier.
  • tierToCoolAfterDaysSinceLastAccessTimeGreaterThan - The age in days after last access time to tier blobs to cool storage. Supports blob currently at Hot tier.
  • tierToCoolAfterDaysSinceCreationGreaterThan - Optional The age in days after creation to cool storage. Supports blob currently at Hot tier.
  • autoTierToHotFromCoolEnabled - Whether a blob should automatically be tiered from cool back to hot if it's accessed again after being tiered to cool.
  • tierToArchiveAfterDaysSinceModificationGreaterThan - The age in days after last modification to tier blobs to archive storage.
  • tierToArchiveAfterDaysSinceLastAccessTimeGreaterThan - The age in days after last access time to tier blobs to archive storage.
  • tierToArchiveAfterDaysSinceCreationGreaterThan - The age in days after creation to archive storage.
  • tierToArchiveAfterDaysSinceLastTierChangeGreaterThan - The age in days after last tier change to the blobs to skip to be archved.
  • deleteAfterDaysSinceModificationGreaterThan - The age in days after last modification to delete the blob.
  • deleteAfterDaysSinceLastAccessTimeGreaterThan - The age in days after last access time to delete the blob.
  • deleteAfterDaysSinceCreationGreaterThan - The age in days after creation to delete the blob.

snapshot supports the following:

  • changeTierToArchiveAfterDaysSinceCreation - The age in days after creation to tier blob snapshot to archive storage.
  • tierToArchiveAfterDaysSinceLastTierChangeGreaterThan - The age in days after last tier change to the blobs to skip to be archived.
  • changeTierToCoolAfterDaysSinceCreation - The age in days after creation to tier blob snapshot to cool storage.
  • deleteAfterDaysSinceCreationGreaterThan - The age in days after creation to delete the blob snapshot.

version supports the following:

  • changeTierToArchiveAfterDaysSinceCreation - The age in days after creation to tier blob version to archive storage.
  • tierToArchiveAfterDaysSinceLastTierChangeGreaterThan - The age in days after last tier change to the blobs to skip to be archived.
  • changeTierToCoolAfterDaysSinceCreation - The age in days after creation to tier blob version to cool storage.
  • deleteAfterDaysSinceCreation - The age in days after creation to delete the blob version.

matchBlobIndexTag supports the following:

  • name - The filter tag name used for tag based filtering for blob objects.
  • operation - The comparison operator which is used for object comparison and filtering. Possible value is ==. Defaults to ==.
  • value - The filter tag value used for tag based filtering for blob objects.

Timeouts

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

  • read - (Defaults to 5 minutes) Used when retrieving the Storage Management Policy.