Skip to content

Commit

Permalink
Remove property
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartleeks committed Oct 2, 2019
1 parent 5959707 commit d538c85
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 25 deletions.
4 changes: 0 additions & 4 deletions azurerm/data_source_storage_management_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ func dataSourceArmStorageManagementPolicy() *schema.Resource {
Type: schema.TypeBool,
Computed: true,
},
"type": {
Type: schema.TypeString,
Computed: true,
},
"filters": {
Type: schema.TypeList,
Computed: true,
Expand Down
2 changes: 0 additions & 2 deletions azurerm/data_source_storage_management_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ func TestAccDataSourceAzureRMStorageManagementPolicy_basic(t *testing.T) {
resource.TestCheckResourceAttr(dataSourceName, "rule.#", "1"),
resource.TestCheckResourceAttr(dataSourceName, "rule.0.name", "rule1"),
resource.TestCheckResourceAttr(dataSourceName, "rule.0.enabled", "true"),
resource.TestCheckResourceAttr(dataSourceName, "rule.0.type", "Lifecycle"),
resource.TestCheckResourceAttr(dataSourceName, "rule.0.filters.#", "1"),
resource.TestCheckResourceAttr(dataSourceName, "rule.0.filters.0.prefix_match.#", "1"),
resource.TestCheckResourceAttr(dataSourceName, "rule.0.filters.0.prefix_match.3439697764", "container1/prefix1"),
Expand Down Expand Up @@ -69,7 +68,6 @@ resource "azurerm_storage_management_policy" "testpolicy" {
rule {
name = "rule1"
enabled = true
type = "Lifecycle"
filters {
prefix_match = [ "container1/prefix1" ]
blob_types = [ "blockBlob" ]
Expand Down
10 changes: 1 addition & 9 deletions azurerm/resource_arm_storage_management_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ func resourceArmStorageManagementPolicy() *schema.Resource {
Type: schema.TypeBool,
Required: true,
},
"type": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{"Lifecycle"}, false),
},
"filters": {
Type: schema.TypeList,
Optional: true,
Expand Down Expand Up @@ -239,7 +234,7 @@ func expandStorageManagementPolicyRule(ref map[string]interface{}) (*storage.Man

name := ref["name"].(string)
enabled := ref["enabled"].(bool)
typeVal := ref["type"].(string)
typeVal := "Lifecycle"

definition := storage.ManagementPolicyDefinition{
Filters: &storage.ManagementPolicyFilter{},
Expand Down Expand Up @@ -320,9 +315,6 @@ func flattenStorageManagementPolicyRules(armRules *[]storage.ManagementPolicyRul
if armRule.Name != nil {
rule["name"] = *armRule.Name
}
if armRule.Type != nil {
rule["type"] = *armRule.Type
}
if armRule.Enabled != nil {
rule["enabled"] = *armRule.Enabled
}
Expand Down
6 changes: 0 additions & 6 deletions azurerm/resource_arm_storage_management_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ func TestAccAzureRMStorageManagementPolicy_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "rule.#", "1"),
resource.TestCheckResourceAttr(resourceName, "rule.0.name", "rule1"),
resource.TestCheckResourceAttr(resourceName, "rule.0.enabled", "true"),
resource.TestCheckResourceAttr(resourceName, "rule.0.type", "Lifecycle"),
resource.TestCheckResourceAttr(resourceName, "rule.0.filters.#", "1"),
resource.TestCheckResourceAttr(resourceName, "rule.0.filters.0.prefix_match.#", "1"),
resource.TestCheckResourceAttr(resourceName, "rule.0.filters.0.prefix_match.3439697764", "container1/prefix1"),
Expand Down Expand Up @@ -65,7 +64,6 @@ func TestAccAzureRMStorageManagementPolicy_multipleRule(t *testing.T) {
// Rule1
resource.TestCheckResourceAttr(resourceName, "rule.0.name", "rule1"),
resource.TestCheckResourceAttr(resourceName, "rule.0.enabled", "true"),
resource.TestCheckResourceAttr(resourceName, "rule.0.type", "Lifecycle"),
resource.TestCheckResourceAttr(resourceName, "rule.0.filters.#", "1"),
resource.TestCheckResourceAttr(resourceName, "rule.0.filters.0.prefix_match.#", "1"),
resource.TestCheckResourceAttr(resourceName, "rule.0.filters.0.prefix_match.3439697764", "container1/prefix1"),
Expand All @@ -82,7 +80,6 @@ func TestAccAzureRMStorageManagementPolicy_multipleRule(t *testing.T) {
// Rule2
resource.TestCheckResourceAttr(resourceName, "rule.1.name", "rule2"),
resource.TestCheckResourceAttr(resourceName, "rule.1.enabled", "false"),
resource.TestCheckResourceAttr(resourceName, "rule.1.type", "Lifecycle"),
resource.TestCheckResourceAttr(resourceName, "rule.1.filters.#", "1"),
resource.TestCheckResourceAttr(resourceName, "rule.1.filters.0.prefix_match.#", "2"),
resource.TestCheckResourceAttr(resourceName, "rule.1.filters.0.prefix_match.4102595489", "container2/prefix1"),
Expand Down Expand Up @@ -124,7 +121,6 @@ resource "azurerm_storage_management_policy" "testpolicy" {
rule {
name = "rule1"
enabled = true
type = "Lifecycle"
filters {
prefix_match = [ "container1/prefix1" ]
blob_types = [ "blockBlob" ]
Expand Down Expand Up @@ -167,7 +163,6 @@ resource "azurerm_storage_management_policy" "testpolicy" {
rule {
name = "rule1"
enabled = true
type = "Lifecycle"
filters {
prefix_match = [ "container1/prefix1" ]
blob_types = [ "blockBlob" ]
Expand All @@ -186,7 +181,6 @@ resource "azurerm_storage_management_policy" "testpolicy" {
rule {
name = "rule2"
enabled = false
type = "Lifecycle"
filters {
prefix_match = [ "container2/prefix1", "container2/prefix2" ]
blob_types = [ "blockBlob" ]
Expand Down
1 change: 0 additions & 1 deletion website/docs/d/storage_management_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ The following arguments are supported:

* `name` - (Required) A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
* `enabled` - (Required) Boolean to specify whether the rule is enabled.
* `type` - (Required) Must be set to `Lifecycle`.
* `filters` - A `filter` block as documented below.
* `actions` - An `actions` block as documented below.

Expand Down
3 changes: 0 additions & 3 deletions website/docs/r/storage_management_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ resource "azurerm_storage_management_policy" "testpolicy" {
rule {
name = "rule1"
enabled = true
type = "Lifecycle"
filters {
prefix_match = [ "container1/prefix1" ]
blob_types = [ "blockBlob" ]
Expand All @@ -53,7 +52,6 @@ resource "azurerm_storage_management_policy" "testpolicy" {
rule {
name = "rule2"
enabled = false
type = "Lifecycle"
filters {
prefix_match = [ "container2/prefix1", "container2/prefix2" ]
blob_types = [ "blockBlob" ]
Expand Down Expand Up @@ -86,7 +84,6 @@ The following arguments are supported:

* `name` - (Required) A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
* `enabled` - (Required) Boolean to specify whether the rule is enabled.
* `type` - (Required) Must be set to `Lifecycle`.
* `filters` - A `filter` block as documented below.
* `actions` - An `actions` block as documented below.

Expand Down

0 comments on commit d538c85

Please sign in to comment.