-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
resource/ssm_association: Support MaxConcurrency and MaxErrors #7970
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.
Hi again @atsushi-ishibashi 👋 Thanks so much for this contribution. It looks like merging #7852 just now caused conflicts here. Sorry about that. 😖 Should be safe to add both the old and new differences. Other than that a few minor things below and should be good to go.
aws/resource_aws_ssm_association.go
Outdated
"max_concurrency": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { |
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 can be simplified with validation.StringMatch()
. It looks like this regular expression might also be slightly different than the max errors one according to the SSM API Reference 👍
e.g.
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^([1-9][0-9]*|[1-9][0-9]%|[1-9]%|100%)$`), "must be a valid number (e.g. 10) or percentage including the percent sign (e.g. 10%)"),
aws/resource_aws_ssm_association.go
Outdated
"max_errors": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { |
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.
Same here 😄
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^([1-9][0-9]*|[0]|[1-9][0-9]%|[0-9]%|100%)$`), "must be a valid number (e.g. 10) or percentage including the percent sign (e.g. 10%)"),
@@ -35,6 +35,8 @@ The following arguments are supported: | |||
* `parameters` - (Optional) A block of arbitrary string parameters to pass to the SSM document. | |||
* `schedule_expression` - (Optional) A cron expression when the association will be applied to the target(s). | |||
* `targets` - (Optional) A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets. | |||
* `max_concurrency` - (Optional) The maximum number of targets allowed to run the association at the same time. |
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.
I'd recommend adding here and to max errors documentation below that it accepts a number or percentage with percent sign 👍
beabb25
to
9066433
Compare
Co-Authored-By: atsushi-ishibashi <atsushi.ishibashi@finatext.com>
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.
Thanks so much, @atsushi-ishibashi! 🚀 (TravisCI failures related to #7993 and nothing to do with this PR)
--- PASS: TestAccAWSSSMAssociation_withDocumentVersion (19.88s)
--- PASS: TestAccAWSSSMAssociation_withComplianceSeverity (31.31s)
--- PASS: TestAccAWSSSMAssociation_withParameters (31.32s)
--- PASS: TestAccAWSSSMAssociation_rateControl (33.89s)
--- PASS: TestAccAWSSSMAssociation_withTargets (33.91s)
--- PASS: TestAccAWSSSMAssociation_withAssociationNameAndScheduleExpression (38.75s)
--- PASS: TestAccAWSSSMAssociation_withAssociationName (47.95s)
--- PASS: TestAccAWSSSMAssociation_withScheduleExpression (50.13s)
--- PASS: TestAccAWSSSMAssociation_withOutputLocation (67.80s)
--- PASS: TestAccAWSSSMAssociation_basic (160.16s)
This has been released in version 2.3.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Community Note
Closes #6258
Changes proposed in this pull request:
max_concurrency
andmax_errors
Output from acceptance testing: