use a log group resourcE
This commit is contained in:
parent
cf5b32617b
commit
9eb46c28b2
|
@ -2,7 +2,6 @@ package aws
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
|
@ -13,7 +12,6 @@ import (
|
|||
|
||||
func TestAccAWSFlowLog_basic(t *testing.T) {
|
||||
var flowLog ec2.FlowLog
|
||||
lgn := os.Getenv("LOG_GROUP_NAME")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
|
@ -21,7 +19,7 @@ func TestAccAWSFlowLog_basic(t *testing.T) {
|
|||
CheckDestroy: testAccCheckFlowLogDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: fmt.Sprintf(testAccFlowLogConfig_basic, lgn),
|
||||
Config: testAccFlowLogConfig_basic,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckFlowLogExists("aws_flow_log.test_flow_log", &flowLog),
|
||||
testAccCheckAWSFlowLogAttributes(&flowLog),
|
||||
|
@ -142,6 +140,9 @@ resource "aws_iam_role" "test_role" {
|
|||
EOF
|
||||
}
|
||||
|
||||
resource "aws_cloudwatch_log_group" "foobar" {
|
||||
name = "foo-bar"
|
||||
}
|
||||
resource "aws_flow_log" "test_flow_log" {
|
||||
# log_group_name needs to exist before hand
|
||||
# until we have a CloudWatch Log Group Resource
|
||||
|
@ -154,7 +155,7 @@ resource "aws_flow_log" "test_flow_log" {
|
|||
resource "aws_flow_log" "test_flow_log_subnet" {
|
||||
# log_group_name needs to exist before hand
|
||||
# until we have a CloudWatch Log Group Resource
|
||||
log_group_name = "%s"
|
||||
log_group_name = "${aws_cloudwatch_log_group.foobar.name}"
|
||||
iam_role_arn = "${aws_iam_role.test_role.arn}"
|
||||
subnet_id = "${aws_subnet.test_subnet.id}"
|
||||
traffic_type = "ALL"
|
||||
|
|
Loading…
Reference in New Issue