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_maintenance_window_target: name and description are optional #9165

Merged
merged 1 commit into from
Jun 27, 2019

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Jun 27, 2019

Fixes: #8791

the name ane description fields were optional but we never implemented
the d.GetOk(fieldName) on them. This just changes that to remove the
validation errors

The docs and the schema were already correct so this is a very simple
change

▶ acctests aws TestAccAWSSSMMaintenanceWindowTarget_
=== RUN   TestAccAWSSSMMaintenanceWindowTarget_basic
=== PAUSE TestAccAWSSSMMaintenanceWindowTarget_basic
=== RUN   TestAccAWSSSMMaintenanceWindowTarget_noNameOrDescription
=== PAUSE TestAccAWSSSMMaintenanceWindowTarget_noNameOrDescription
=== RUN   TestAccAWSSSMMaintenanceWindowTarget_validation
=== PAUSE TestAccAWSSSMMaintenanceWindowTarget_validation
=== RUN   TestAccAWSSSMMaintenanceWindowTarget_update
=== PAUSE TestAccAWSSSMMaintenanceWindowTarget_update
=== CONT  TestAccAWSSSMMaintenanceWindowTarget_basic
=== CONT  TestAccAWSSSMMaintenanceWindowTarget_update
=== CONT  TestAccAWSSSMMaintenanceWindowTarget_validation
=== CONT  TestAccAWSSSMMaintenanceWindowTarget_noNameOrDescription
--- PASS: TestAccAWSSSMMaintenanceWindowTarget_validation (4.60s)
--- PASS: TestAccAWSSSMMaintenanceWindowTarget_noNameOrDescription (34.75s)
--- PASS: TestAccAWSSSMMaintenanceWindowTarget_basic (34.95s)
--- PASS: TestAccAWSSSMMaintenanceWindowTarget_update (51.77s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	51.842s

optional

Fixes: hashicorp#8791

the name ane description fields were optional but we never implemented
the d.GetOk(fieldName) on them. This just changes that to remove the
validation errors

The docs and the schema were already correct so this is a very simple
change

```
▶ acctests aws TestAccAWSSSMMaintenanceWindowTarget_
=== RUN   TestAccAWSSSMMaintenanceWindowTarget_basic
=== PAUSE TestAccAWSSSMMaintenanceWindowTarget_basic
=== RUN   TestAccAWSSSMMaintenanceWindowTarget_noNameOrDescription
=== PAUSE TestAccAWSSSMMaintenanceWindowTarget_noNameOrDescription
=== RUN   TestAccAWSSSMMaintenanceWindowTarget_validation
=== PAUSE TestAccAWSSSMMaintenanceWindowTarget_validation
=== RUN   TestAccAWSSSMMaintenanceWindowTarget_update
=== PAUSE TestAccAWSSSMMaintenanceWindowTarget_update
=== CONT  TestAccAWSSSMMaintenanceWindowTarget_basic
=== CONT  TestAccAWSSSMMaintenanceWindowTarget_update
=== CONT  TestAccAWSSSMMaintenanceWindowTarget_validation
=== CONT  TestAccAWSSSMMaintenanceWindowTarget_noNameOrDescription
--- PASS: TestAccAWSSSMMaintenanceWindowTarget_validation (4.60s)
--- PASS: TestAccAWSSSMMaintenanceWindowTarget_noNameOrDescription (34.75s)
--- PASS: TestAccAWSSSMMaintenanceWindowTarget_basic (34.95s)
--- PASS: TestAccAWSSSMMaintenanceWindowTarget_update (51.77s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	51.842s
```
@stack72 stack72 requested a review from a team June 27, 2019 13:51
@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. labels Jun 27, 2019
@stack72
Copy link
Contributor Author

stack72 commented Jun 27, 2019

@bflad without this change in place, the ssm_maintenance_window_target resource is actually broken :( This would be a welcome addition to have fixed

@bflad bflad added the bug Addresses a defect in current functionality. label Jun 27, 2019
@bflad bflad self-assigned this Jun 27, 2019
@bflad bflad added this to the v2.17.0 milestone Jun 27, 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.

LGTM, thanks for fixing this @stack72 -- we may also want to double check that an update that removes name or description also works (since this new update logic would be doing the equivalent of params.Name = aws.String("")), but this fix is important enough to get in on its own for now.

Output from acceptance testing:

--- PASS: TestAccAWSSSMMaintenanceWindowTarget_validation (2.12s)
--- PASS: TestAccAWSSSMMaintenanceWindowTarget_noNameOrDescription (13.89s)
--- PASS: TestAccAWSSSMMaintenanceWindowTarget_basic (13.90s)
--- PASS: TestAccAWSSSMMaintenanceWindowTarget_update (19.48s)

@bflad bflad merged commit c180755 into hashicorp:master Jun 27, 2019
bflad added a commit that referenced this pull request Jun 27, 2019
@bflad
Copy link
Contributor

bflad commented Jun 28, 2019

This has been released in version 2.17.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Nov 3, 2019

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 Nov 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. 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_maintenance_window_target name and description fields not optional
2 participants