import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages an Azure Storage Account Management Policy. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "resourceGroupName", * location: "West Europe", * }); * const exampleAccount = new azure.storage.Account("example", { * name: "storageaccountname", * resourceGroupName: example.name, * location: example.location, * accountTier: "Standard", * accountReplicationType: "LRS", * accountKind: "BlobStorage", * }); * const exampleManagementPolicy = new azure.storage.ManagementPolicy("example", { * storageAccountId: exampleAccount.id, * rules: [ * { * name: "rule1", * enabled: true, * filters: { * prefixMatches: ["container1/prefix1"], * blobTypes: ["blockBlob"], * matchBlobIndexTags: [{ * name: "tag1", * operation: "==", * value: "val1", * }], * }, * actions: { * baseBlob: { * tierToCoolAfterDaysSinceModificationGreaterThan: 10, * tierToArchiveAfterDaysSinceModificationGreaterThan: 50, * deleteAfterDaysSinceModificationGreaterThan: 100, * }, * snapshot: { * deleteAfterDaysSinceCreationGreaterThan: 30, * }, * }, * }, * { * name: "rule2", * enabled: false, * filters: { * prefixMatches: [ * "container2/prefix1", * "container2/prefix2", * ], * blobTypes: ["blockBlob"], * }, * actions: { * baseBlob: { * tierToCoolAfterDaysSinceModificationGreaterThan: 11, * tierToArchiveAfterDaysSinceModificationGreaterThan: 51, * deleteAfterDaysSinceModificationGreaterThan: 101, * }, * snapshot: { * changeTierToArchiveAfterDaysSinceCreation: 90, * changeTierToCoolAfterDaysSinceCreation: 23, * deleteAfterDaysSinceCreationGreaterThan: 31, * }, * version: { * changeTierToArchiveAfterDaysSinceCreation: 9, * changeTierToCoolAfterDaysSinceCreation: 90, * deleteAfterDaysSinceCreation: 3, * }, * }, * }, * ], * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.Storage` - 2025-06-01 * * ## Import * * Storage Account Management Policies can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:storage/managementPolicy:ManagementPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Storage/storageAccounts/myaccountname/managementPolicies/default * ``` */ export declare class ManagementPolicy extends pulumi.CustomResource { /** * Get an existing ManagementPolicy resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: ManagementPolicyState, opts?: pulumi.CustomResourceOptions): ManagementPolicy; /** * Returns true if the given object is an instance of ManagementPolicy. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is ManagementPolicy; /** * A `rule` block as documented below. */ readonly rules: pulumi.Output; /** * Specifies the id of the storage account to apply the management policy to. Changing this forces a new resource to be created. */ readonly storageAccountId: pulumi.Output; /** * Create a ManagementPolicy resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ManagementPolicyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ManagementPolicy resources. */ export interface ManagementPolicyState { /** * A `rule` block as documented below. */ rules?: pulumi.Input[]>; /** * Specifies the id of the storage account to apply the management policy to. Changing this forces a new resource to be created. */ storageAccountId?: pulumi.Input; } /** * The set of arguments for constructing a ManagementPolicy resource. */ export interface ManagementPolicyArgs { /** * A `rule` block as documented below. */ rules?: pulumi.Input[]>; /** * Specifies the id of the storage account to apply the management policy to. Changing this forces a new resource to be created. */ storageAccountId: pulumi.Input; }