Skip to content
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

Merged
merged 3 commits into from
Mar 18, 2019

Conversation

atsushi-ishibashi
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #6258

Changes proposed in this pull request:

  • Support max_concurrency and max_errors

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSSSMAssociation_rateControl'
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSSSMAssociation_rateControl -timeout 120m
=== RUN   TestAccAWSSSMAssociation_rateControl
=== PAUSE TestAccAWSSSMAssociation_rateControl
=== CONT  TestAccAWSSSMAssociation_rateControl
--- PASS: TestAccAWSSSMAssociation_rateControl (68.12s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	68.165s

@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/ssm Issues and PRs that pertain to the ssm service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. labels Mar 16, 2019
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Mar 17, 2019
Copy link
Contributor

@bflad bflad left a 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.

"max_concurrency": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: func(v interface{}, k string) (ws []string, es []error) {
Copy link
Contributor

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%)"),

"max_errors": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: func(v interface{}, k string) (ws []string, es []error) {
Copy link
Contributor

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.
Copy link
Contributor

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 👍

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Mar 17, 2019
Co-Authored-By: atsushi-ishibashi <atsushi.ishibashi@finatext.com>
@bflad bflad added this to the v2.3.0 milestone Mar 18, 2019
@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Mar 18, 2019
Copy link
Contributor

@bflad bflad left a 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)

@bflad bflad merged commit 099a05a into hashicorp:master Mar 18, 2019
bflad added a commit that referenced this pull request Mar 18, 2019
@bflad
Copy link
Contributor

bflad commented Mar 21, 2019

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.

@ghost
Copy link

ghost commented Mar 30, 2020

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!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/ssm Issues and PRs that pertain to the ssm service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_ssm_association resource support for rate controle
2 participants