-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
r/cloudwatch_log_group: Use ID as name #2190
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems good :)
Just left 2 things to fix before testing & merging.
Thanks for the work! 👍 😄
func testAccAWSCloudWatchLogGroup_namePrefix_retention(rName string) string { | ||
return fmt.Sprintf(` | ||
resource "aws_cloudwatch_log_group" "test" { | ||
name_prefix = "tf-test-%s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the indentation to use 2 spaces?
testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.test", &lg), | ||
resource.TestMatchResourceAttr("aws_cloudwatch_log_group.test", "name", regexp.MustCompile("^tf-test-")), | ||
), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add another section, so that the first one is a creation, and the second one an update?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thanks for the work here! :)
$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudWatchLogGroup_namePrefix_retention'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCloudWatchLogGroup_namePrefix_retention -timeout 120m
=== RUN TestAccAWSCloudWatchLogGroup_namePrefix_retention
--- PASS: TestAccAWSCloudWatchLogGroup_namePrefix_retention (66.50s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 66.536s
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
#1752
In
resourceAwsCloudWatchLogGroupUpdate
, d.Get("name") is required but when usingname_prefix
, it becomes empty.Other tests passed.