pulumi_wasm_providers_azure_mini::storage

Module object_replication

source
Expand description

Manages a Storage Object Replication.

§Example Usage

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let dst = resource_group::create(
        "dst",
        ResourceGroupArgs::builder()
            .location("East US")
            .name("dstResourceGroupName")
            .build_struct(),
    );
    let dstAccount = account::create(
        "dstAccount",
        AccountArgs::builder()
            .account_replication_type("LRS")
            .account_tier("Standard")
            .blob_properties(
                AccountBlobProperties::builder()
                    .changeFeedEnabled(true)
                    .versioningEnabled(true)
                    .build_struct(),
            )
            .location("${dst.location}")
            .name("dststorageaccount")
            .resource_group_name("${dst.name}")
            .build_struct(),
    );
    let dstContainer = container::create(
        "dstContainer",
        ContainerArgs::builder()
            .container_access_type("private")
            .name("dststrcontainer")
            .storage_account_name("${dstAccount.name}")
            .build_struct(),
    );
    let example = object_replication::create(
        "example",
        ObjectReplicationArgs::builder()
            .destination_storage_account_id("${dstAccount.id}")
            .rules(
                vec![
                    ObjectReplicationRule::builder()
                    .destinationContainerName("${dstContainer.name}")
                    .sourceContainerName("${srcContainer.name}").build_struct(),
                ],
            )
            .source_storage_account_id("${srcAccount.id}")
            .build_struct(),
    );
    let src = resource_group::create(
        "src",
        ResourceGroupArgs::builder()
            .location("West Europe")
            .name("srcResourceGroupName")
            .build_struct(),
    );
    let srcAccount = account::create(
        "srcAccount",
        AccountArgs::builder()
            .account_replication_type("LRS")
            .account_tier("Standard")
            .blob_properties(
                AccountBlobProperties::builder()
                    .changeFeedEnabled(true)
                    .versioningEnabled(true)
                    .build_struct(),
            )
            .location("${src.location}")
            .name("srcstorageaccount")
            .resource_group_name("${src.name}")
            .build_struct(),
    );
    let srcContainer = container::create(
        "srcContainer",
        ContainerArgs::builder()
            .container_access_type("private")
            .name("srcstrcontainer")
            .storage_account_name("${srcAccount.name}")
            .build_struct(),
    );
}

§Import

Storage Object Replication Policies can be imported using the resource id, e.g.

$ pulumi import azure:storage/objectReplication:ObjectReplication example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Storage/storageAccounts/storageAccount1/objectReplicationPolicies/objectReplicationPolicy1;/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group2/providers/Microsoft.Storage/storageAccounts/storageAccount2/objectReplicationPolicies/objectReplicationPolicy2

Structs§

Functions§

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