mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provider/aws: set default SG description
because requiring a SG description is annoying
This commit is contained in:
parent
92ebb60293
commit
079856620a
@ -31,7 +31,8 @@ func resourceAwsSecurityGroup() *schema.Resource {
|
|||||||
|
|
||||||
"description": &schema.Schema{
|
"description": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Optional: true,
|
||||||
|
Default: "Managed by Terraform",
|
||||||
},
|
},
|
||||||
|
|
||||||
"vpc_id": &schema.Schema{
|
"vpc_id": &schema.Schema{
|
||||||
|
@ -197,6 +197,8 @@ func TestAccAWSSecurityGroup_generatedName(t *testing.T) {
|
|||||||
Config: testAccAWSSecurityGroupConfig_generatedName,
|
Config: testAccAWSSecurityGroupConfig_generatedName,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group),
|
testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group),
|
||||||
|
resource.TestCheckResourceAttr(
|
||||||
|
"aws_security_group.web", "description", "Managed by Terraform"),
|
||||||
func(s *terraform.State) error {
|
func(s *terraform.State) error {
|
||||||
if group.GroupName == nil {
|
if group.GroupName == nil {
|
||||||
return fmt.Errorf("bad: No SG name")
|
return fmt.Errorf("bad: No SG name")
|
||||||
@ -549,8 +551,6 @@ resource "aws_security_group" "foo" {
|
|||||||
|
|
||||||
const testAccAWSSecurityGroupConfig_generatedName = `
|
const testAccAWSSecurityGroupConfig_generatedName = `
|
||||||
resource "aws_security_group" "web" {
|
resource "aws_security_group" "web" {
|
||||||
description = "Used in the terraform acceptance tests"
|
|
||||||
|
|
||||||
ingress {
|
ingress {
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
from_port = 80
|
from_port = 80
|
||||||
|
Loading…
Reference in New Issue
Block a user