pulumi_wasm_providers_azure_mini::storage

Module blob_inventory_policy

source
Expand description

Manages a Storage Blob Inventory Policy.

§Example Usage

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let example = resource_group::create(
        "example",
        ResourceGroupArgs::builder()
            .location("West Europe")
            .name("example-resources")
            .build_struct(),
    );
    let exampleAccount = account::create(
        "exampleAccount",
        AccountArgs::builder()
            .account_replication_type("LRS")
            .account_tier("Standard")
            .blob_properties(
                AccountBlobProperties::builder().versioningEnabled(true).build_struct(),
            )
            .location("${example.location}")
            .name("examplestoracc")
            .resource_group_name("${example.name}")
            .build_struct(),
    );
    let exampleBlobInventoryPolicy = blob_inventory_policy::create(
        "exampleBlobInventoryPolicy",
        BlobInventoryPolicyArgs::builder()
            .rules(
                vec![
                    BlobInventoryPolicyRule::builder().format("Csv").name("rule1")
                    .schedule("Daily").schemaFields(vec!["Name", "Last-Modified",])
                    .scope("Container").storageContainerName("${exampleContainer.name}")
                    .build_struct(),
                ],
            )
            .storage_account_id("${exampleAccount.id}")
            .build_struct(),
    );
    let exampleContainer = container::create(
        "exampleContainer",
        ContainerArgs::builder()
            .container_access_type("private")
            .name("examplecontainer")
            .storage_account_name("${exampleAccount.name}")
            .build_struct(),
    );
}

§Import

Storage Blob Inventory Policies can be imported using the resource id, e.g.

$ pulumi import azure:storage/blobInventoryPolicy:BlobInventoryPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Storage/storageAccounts/storageAccount1

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments