provider/aws: set default SG description

because requiring a SG description is annoying
This commit is contained in:
Paul Hinze 2015-04-22 13:27:20 -05:00
parent 92ebb60293
commit 079856620a
2 changed files with 4 additions and 3 deletions

View File

@ -31,7 +31,8 @@ func resourceAwsSecurityGroup() *schema.Resource {
"description": &schema.Schema{
Type: schema.TypeString,
Required: true,
Optional: true,
Default: "Managed by Terraform",
},
"vpc_id": &schema.Schema{

View File

@ -197,6 +197,8 @@ func TestAccAWSSecurityGroup_generatedName(t *testing.T) {
Config: testAccAWSSecurityGroupConfig_generatedName,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group),
resource.TestCheckResourceAttr(
"aws_security_group.web", "description", "Managed by Terraform"),
func(s *terraform.State) error {
if group.GroupName == nil {
return fmt.Errorf("bad: No SG name")
@ -549,8 +551,6 @@ resource "aws_security_group" "foo" {
const testAccAWSSecurityGroupConfig_generatedName = `
resource "aws_security_group" "web" {
description = "Used in the terraform acceptance tests"
ingress {
protocol = "tcp"
from_port = 80