GetPolicy
Use this data source to access information about an existing Storage Management Policy.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleAccount = Output.Create(Azure.Storage.GetAccount.InvokeAsync(new Azure.Storage.GetAccountArgs
{
Name = "storageaccountname",
ResourceGroupName = "resourcegroupname",
}));
var examplePolicy = Output.Create(Azure.Storage.GetPolicy.InvokeAsync(new Azure.Storage.GetPolicyArgs
{
StorageAccountId = azurerm_storage_account.Example.Id,
}));
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
opt0 := "resourcegroupname"
_, err := storage.LookupAccount(ctx, &storage.LookupAccountArgs{
Name: "storageaccountname",
ResourceGroupName: &opt0,
}, nil)
if err != nil {
return err
}
_, err := storage.GetPolicy(ctx, &storage.GetPolicyArgs{
StorageAccountId: azurerm_storage_account.Example.Id,
}, nil)
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_azure as azure
example_account = azure.storage.get_account(name="storageaccountname",
resource_group_name="resourcegroupname")
example_policy = azure.storage.get_policy(storage_account_id=azurerm_storage_account["example"]["id"])import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleAccount = azure.storage.getAccount({
name: "storageaccountname",
resourceGroupName: "resourcegroupname",
});
const examplePolicy = azure.storage.getPolicy({
storageAccountId: azurerm_storage_account.example.id,
});Using GetPolicy
function getPolicy(args: GetPolicyArgs, opts?: InvokeOptions): Promise<GetPolicyResult>function get_policy(storage_account_id=None, opts=None)func GetPolicy(ctx *Context, args *GetPolicyArgs, opts ...InvokeOption) (*GetPolicyResult, error)public static class GetPolicy {
public static Task<GetPolicyResult> InvokeAsync(GetPolicyArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Storage
Account stringId Specifies the id of the storage account to retrieve the management policy for.
- Storage
Account stringId Specifies the id of the storage account to retrieve the management policy for.
- storage
Account stringId Specifies the id of the storage account to retrieve the management policy for.
- storage_
account_ strid Specifies the id of the storage account to retrieve the management policy for.
GetPolicy Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Rules
List<Get
Policy Rule> A
ruleblock as documented below.- Storage
Account stringId
- Id string
The provider-assigned unique ID for this managed resource.
- Rules
[]Get
Policy Rule A
ruleblock as documented below.- Storage
Account stringId
- id string
The provider-assigned unique ID for this managed resource.
- rules
Get
Policy Rule[] A
ruleblock as documented below.- storage
Account stringId
- id str
The provider-assigned unique ID for this managed resource.
- rules
List[Get
Policy Rule] A
ruleblock as documented below.- storage_
account_ strid
Supporting Types
GetPolicyRule
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Actions
List<Get
Policy Rule Action Args> An
actionsblock as documented below.- Enabled bool
Boolean to specify whether the rule is enabled.
- Filters
List<Get
Policy Rule Filter Args> A
filterblock as documented below.- Name string
A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
- Actions
[]Get
Policy Rule Action An
actionsblock as documented below.- Enabled bool
Boolean to specify whether the rule is enabled.
- Filters
[]Get
Policy Rule Filter A
filterblock as documented below.- Name string
A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
- actions
Get
Policy Rule Action[] An
actionsblock as documented below.- enabled boolean
Boolean to specify whether the rule is enabled.
- filters
Get
Policy Rule Filter[] A
filterblock as documented below.- name string
A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
- actions
List[Get
Policy Rule Action] An
actionsblock as documented below.- enabled bool
Boolean to specify whether the rule is enabled.
- filters
List[Get
Policy Rule Filter] A
filterblock as documented below.- name str
A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
GetPolicyRuleAction
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Base
Blobs List<GetPolicy Rule Action Base Blob Args> A
base_blobblock as documented below.- Snapshots
List<Get
Policy Rule Action Snapshot Args> A
snapshotblock as documented below.
- Base
Blobs []GetPolicy Rule Action Base Blob A
base_blobblock as documented below.- Snapshots
[]Get
Policy Rule Action Snapshot A
snapshotblock as documented below.
- base
Blobs GetPolicy Rule Action Base Blob[] A
base_blobblock as documented below.- snapshots
Get
Policy Rule Action Snapshot[] A
snapshotblock as documented below.
- base
Blobs List[GetPolicy Rule Action Base Blob] A
base_blobblock as documented below.- snapshots
List[Get
Policy Rule Action Snapshot] A
snapshotblock as documented below.
GetPolicyRuleActionBaseBlob
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Delete
After intDays Since Modification Greater Than The age in days after last modification to delete the blob.
- Tier
To intArchive After Days Since Modification Greater Than The age in days after last modification to tier blobs to archive storage. Supports blob currently at Hot or Cool tier.
- Tier
To intCool After Days Since Modification Greater Than The age in days after last modification to tier blobs to cool storage. Supports blob currently at Hot tier.
- Delete
After intDays Since Modification Greater Than The age in days after last modification to delete the blob.
- Tier
To intArchive After Days Since Modification Greater Than The age in days after last modification to tier blobs to archive storage. Supports blob currently at Hot or Cool tier.
- Tier
To intCool After Days Since Modification Greater Than The age in days after last modification to tier blobs to cool storage. Supports blob currently at Hot tier.
- delete
After numberDays Since Modification Greater Than The age in days after last modification to delete the blob.
- tier
To numberArchive After Days Since Modification Greater Than The age in days after last modification to tier blobs to archive storage. Supports blob currently at Hot or Cool tier.
- tier
To numberCool After Days Since Modification Greater Than The age in days after last modification to tier blobs to cool storage. Supports blob currently at Hot tier.
- delete
After floatDays Since Modification Greater Than The age in days after last modification to delete the blob.
- tier
To floatArchive After Days Since Modification Greater Than The age in days after last modification to tier blobs to archive storage. Supports blob currently at Hot or Cool tier.
- tier
To floatCool After Days Since Modification Greater Than The age in days after last modification to tier blobs to cool storage. Supports blob currently at Hot tier.
GetPolicyRuleActionSnapshot
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Delete
After intDays Since Creation Greater Than The age in days after create to delete the snaphot.
- Delete
After intDays Since Creation Greater Than The age in days after create to delete the snaphot.
- delete
After numberDays Since Creation Greater Than The age in days after create to delete the snaphot.
- delete
After floatDays Since Creation Greater Than The age in days after create to delete the snaphot.
GetPolicyRuleFilter
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Blob
Types List<string> An array of predefined values. Only
blockBlobis supported.- Prefix
Matches List<string> An array of strings for prefixes to be matched.
- Blob
Types []string An array of predefined values. Only
blockBlobis supported.- Prefix
Matches []string An array of strings for prefixes to be matched.
- blob
Types string[] An array of predefined values. Only
blockBlobis supported.- prefix
Matches string[] An array of strings for prefixes to be matched.
- blob
Types List[str] An array of predefined values. Only
blockBlobis supported.- prefix
Matches List[str] An array of strings for prefixes to be matched.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.