Merge pull request #638 from snehaso/tag_for_acl

[AWS] added tags for aws_network_acl
This commit is contained in:
Armon Dadgar 2014-12-10 12:59:22 -08:00
commit 633a08230e
2 changed files with 13 additions and 0 deletions

View File

@ -101,6 +101,7 @@ func resourceAwsNetworkAcl() *schema.Resource {
},
Set: resourceAwsNetworkAclEntryHash,
},
"tags": tagsSchema(),
},
}
}
@ -157,6 +158,7 @@ func resourceAwsNetworkAclRead(d *schema.ResourceData, meta interface{}) error {
d.Set("vpc_id", networkAcl.VpcId)
d.Set("ingress", ingressEntries)
d.Set("egress", egressEntries)
d.Set("tags", tagsToMap(networkAcl.Tags))
return nil
}
@ -194,6 +196,12 @@ func resourceAwsNetworkAclUpdate(d *schema.ResourceData, meta interface{}) error
}
}
if err := setTags(ec2conn, d); err != nil {
return err
} else {
d.SetPartial("tags")
}
d.Partial(false)
return resourceAwsNetworkAclRead(d, meta)
}

View File

@ -203,6 +203,7 @@ func TestAccAWSNetworkAclsOnlyEgressRules(t *testing.T) {
Config: testAccAWSNetworkAclEgressConfig,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSNetworkAclExists("aws_network_acl.bond", &networkAcl),
testAccCheckTags(&networkAcl.Tags, "foo", "bar"),
),
},
},
@ -392,6 +393,10 @@ resource "aws_network_acl" "bond" {
from_port = 22
to_port = 22
}
tags {
foo = "bar"
}
}
`