Skip to content

Commit

Permalink
New features in azurerm_storage_management_policy (#11163)
Browse files Browse the repository at this point in the history
  • Loading branch information
yupwei68 authored Apr 27, 2021
1 parent 22be74a commit e98b0fb
Show file tree
Hide file tree
Showing 7 changed files with 758 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@ func dataSourceStorageManagementPolicy() *schema.Resource {
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
},

"match_blob_index_tag": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Computed: true,
},

"operation": {
Type: schema.TypeString,
Computed: true,
},

"value": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
},
},
},
Expand Down Expand Up @@ -86,13 +109,42 @@ func dataSourceStorageManagementPolicy() *schema.Resource {
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"change_tier_to_archive_after_days_since_creation": {
Type: schema.TypeInt,
Computed: true,
},
"change_tier_to_cool_after_days_since_creation": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
},
"delete_after_days_since_creation_greater_than": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
"version": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"change_tier_to_archive_after_days_since_creation": {
Type: schema.TypeInt,
Computed: true,
},
"change_tier_to_cool_after_days_since_creation": {
Type: schema.TypeInt,
Computed: true,
},
"delete_after_days_since_creation": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
},
},
},
Expand Down Expand Up @@ -123,11 +175,10 @@ func dataSourceStorageManagementPolicyRead(d *schema.ResourceData, meta interfac
}
d.SetId(*result.ID)

if result.Policy != nil {
policy := result.Policy
if policy.Rules != nil {
if props := result.ManagementPolicyProperties; props != nil {
if policy := props.Policy; policy != nil {
if err := d.Set("rule", flattenStorageManagementPolicyRules(policy.Rules)); err != nil {
return fmt.Errorf("Error flattening `rule`: %+v", err)
return fmt.Errorf("flattening `rule`: %+v", err)
}
}
}
Expand Down
Loading

0 comments on commit e98b0fb

Please sign in to comment.