-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Add Support for aws_cloudwatch_metric_alarm extended statistic #11193
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.
Couple of minor changes, LGTM otherwise
if v, ok := d.GetOk("extended_statistic"); ok { | ||
params.ExtendedStatistic = aws.String(v.(string)) | ||
} | ||
|
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.
If one or the other has to be set, should probably check for that here, and verify that at least one but not both have been set.
@@ -67,7 +67,7 @@ The following arguments are supported: | |||
* `namespace` - (Required) The namespace for the alarm's associated metric. See docs for the [list of namespaces](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/aws-namespaces.html). | |||
See docs for [supported metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html). | |||
* `period` - (Required) The period in seconds over which the specified `statistic` is applied. | |||
* `statistic` - (Required) The statistic to apply to the alarm's associated metric. | |||
* `statistic` - (Optional) The statistic to apply to the alarm's associated metric. |
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.
Add in documentation here specifying that you can only have one of statistic
or extended_statistic
statistic Fixes: #11189 This introduces a new parameter and makes an existing parameter from `required` to `optional` as both cannot be specified together ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCloudWatchMetricAlarm_' 2 ↵ ✹ ✭ ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/01/13 11:25:24 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSCloudWatchMetricAlarm_ -timeout 120m === RUN TestAccAWSCloudWatchMetricAlarm_importBasic --- PASS: TestAccAWSCloudWatchMetricAlarm_importBasic (19.80s) === RUN TestAccAWSCloudWatchMetricAlarm_basic --- PASS: TestAccAWSCloudWatchMetricAlarm_basic (20.42s) === RUN TestAccAWSCloudWatchMetricAlarm_extendedStatistic --- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (18.92s) PASS ```
420b7b4
to
43c8366
Compare
Nice review @grubernaut :) Added the changes and an extra test to show the failure if you don't specify either config value
|
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Fixes: #11189
This introduces a new parameter and makes an existing parameter from
required
tooptional
as both cannot be specified together