Skip to content

Conversation

MacoTasu
Copy link

@MacoTasu MacoTasu commented Oct 2, 2025

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Description

This PR adds support for on-call schedule contacts in AWS Systems Manager Incident Manager by implementing the rotation_ids attribute for the aws_ssmcontacts_contact resource.

  • Added rotation_ids attribute to aws_ssmcontacts_contact resource to support ONCALL_SCHEDULE contact type
  • Implemented conditional plan configuration based on contact type:
    • For ONCALL_SCHEDULE contacts: populate plan with rotation IDs
  • Added comprehensive acceptance tests for on-call schedule functionality
  • Updated documentation to include on-call schedule usage examples

Relations

Relates #39758

References

Output from Acceptance Testing

$ make testacc PKG=ssmcontacts TESTS='TestAccSSMContacts_serial/ContactResource/'
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: ESC[1m🌿 f-ssmcontacts-oncall-schedule-39758 🌿ESC[0m...
TF_ACC=1 go1.24.6 test ./internal/service/ssmcontacts/... -v -count 1 -parallel 20 -run='TestAccSSMContacts_serial/ContactResource/'  -timeout 360m -vet=off
2025/10/02 13:22:45 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/02 13:22:45 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccSSMContacts_serial
=== PAUSE TestAccSSMContacts_serial
=== CONT  TestAccSSMContacts_serial
=== RUN   TestAccSSMContacts_serial/ContactResource
=== RUN   TestAccSSMContacts_serial/ContactResource/updateType
=== RUN   TestAccSSMContacts_serial/ContactResource/oncallSchedule
=== RUN   TestAccSSMContacts_serial/ContactResource/basic
=== RUN   TestAccSSMContacts_serial/ContactResource/disappears
=== RUN   TestAccSSMContacts_serial/ContactResource/updateAlias
=== RUN   TestAccSSMContacts_serial/ContactResource/updateDisplayName
=== RUN   TestAccSSMContacts_serial/ContactResource/tags
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_overlapping
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_nullOverlappingResourceTag
    contact_tags_gen_test.go:1586: Resource Contact does not support null tags
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/ComputedTag_OnCreate
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/basic
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/null
    contact_tags_gen_test.go:230: Resource Contact does not support null tags
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/EmptyMap
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/EmptyTag_OnCreate
    contact_tags_gen_test.go:443: Resource Contact does not support empty tags
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_updateToProviderOnly
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_emptyResourceTag
    contact_tags_gen_test.go:1460: Resource Contact does not support empty tags
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_nullNonOverlappingResourceTag
    contact_tags_gen_test.go:1650: Resource Contact does not support null tags
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/ComputedTag_OnUpdate_Replace
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/EmptyTag_OnUpdate_Add
    contact_tags_gen_test.go:534: Resource Contact does not support empty tags
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/EmptyTag_OnUpdate_Replace
    contact_tags_gen_test.go:673: Resource Contact does not support empty tags
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_providerOnly
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_updateToResourceOnly
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/ComputedTag_OnUpdate_Add
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/IgnoreTags_Overlap_DefaultTag
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_nonOverlapping
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/IgnoreTags_Overlap_ResourceTag
=== RUN   TestAccSSMContacts_serial/ContactResource/tags/AddOnUpdate
--- PASS: TestAccSSMContacts_serial (6185.17s)
    --- PASS: TestAccSSMContacts_serial/ContactResource (6185.17s)
        --- PASS: TestAccSSMContacts_serial/ContactResource/updateType (343.59s)
        --- PASS: TestAccSSMContacts_serial/ContactResource/oncallSchedule (317.83s)
        --- PASS: TestAccSSMContacts_serial/ContactResource/basic (375.25s)
        --- PASS: TestAccSSMContacts_serial/ContactResource/disappears (333.48s)
        --- PASS: TestAccSSMContacts_serial/ContactResource/updateAlias (312.04s)
        --- PASS: TestAccSSMContacts_serial/ContactResource/updateDisplayName (311.64s)
        --- PASS: TestAccSSMContacts_serial/ContactResource/tags (4191.33s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_overlapping (325.27s)
            --- SKIP: TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_nullOverlappingResourceTag (0.00s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/ComputedTag_OnCreate (306.34s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/basic (331.80s)
            --- SKIP: TestAccSSMContacts_serial/ContactResource/tags/null (0.00s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/EmptyMap (311.61s)
            --- SKIP: TestAccSSMContacts_serial/ContactResource/tags/EmptyTag_OnCreate (0.00s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_updateToProviderOnly (313.36s)
            --- SKIP: TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_emptyResourceTag (0.00s)
            --- SKIP: TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_nullNonOverlappingResourceTag (0.00s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/ComputedTag_OnUpdate_Replace (313.33s)
            --- SKIP: TestAccSSMContacts_serial/ContactResource/tags/EmptyTag_OnUpdate_Add (0.00s)
            --- SKIP: TestAccSSMContacts_serial/ContactResource/tags/EmptyTag_OnUpdate_Replace (0.00s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_providerOnly (334.95s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_updateToResourceOnly (314.54s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/ComputedTag_OnUpdate_Add (313.31s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/IgnoreTags_Overlap_DefaultTag (318.57s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/DefaultTags_nonOverlapping (324.97s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/IgnoreTags_Overlap_ResourceTag (371.38s)
            --- PASS: TestAccSSMContacts_serial/ContactResource/tags/AddOnUpdate (311.89s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ssmcontacts        6185.260s

append test case TestAccSSMContacts_serial/ContactDataSource/oncallSchedule
bb716df

$ make testacc PKG=ssmcontacts TESTS='TestAccSSMContacts_serial/ContactDataSource'
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: ESC[1m🌿 f-ssmcontacts-oncall-schedule-39758 🌿ESC[0m...
TF_ACC=1 go1.24.6 test ./internal/service/ssmcontacts/... -v -count 1 -parallel 20 -run='TestAccSSMContacts_serial/ContactDataSource'  -timeout 360m -vet=off
2025/10/02 17:50:17 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/02 17:50:17 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccSSMContacts_serial
=== PAUSE TestAccSSMContacts_serial
=== CONT  TestAccSSMContacts_serial
=== RUN   TestAccSSMContacts_serial/ContactDataSource
=== RUN   TestAccSSMContacts_serial/ContactDataSource/basic
=== RUN   TestAccSSMContacts_serial/ContactDataSource/tags
=== RUN   TestAccSSMContacts_serial/ContactDataSource/tags/IgnoreTags_Overlap_ResourceTag
=== RUN   TestAccSSMContacts_serial/ContactDataSource/tags/basic
=== RUN   TestAccSSMContacts_serial/ContactDataSource/tags/NullMap
=== RUN   TestAccSSMContacts_serial/ContactDataSource/tags/EmptyMap
=== RUN   TestAccSSMContacts_serial/ContactDataSource/tags/DefaultTags_nonOverlapping
=== RUN   TestAccSSMContacts_serial/ContactDataSource/tags/IgnoreTags_Overlap_DefaultTag
=== RUN   TestAccSSMContacts_serial/ContactDataSource/oncallSchedule
--- PASS: TestAccSSMContacts_serial (2535.17s)
    --- PASS: TestAccSSMContacts_serial/ContactDataSource (2535.17s)
        --- PASS: TestAccSSMContacts_serial/ContactDataSource/basic (302.51s)
        --- PASS: TestAccSSMContacts_serial/ContactDataSource/tags (1930.53s)
            --- PASS: TestAccSSMContacts_serial/ContactDataSource/tags/IgnoreTags_Overlap_ResourceTag (301.86s)
            --- PASS: TestAccSSMContacts_serial/ContactDataSource/tags/basic (340.99s)
            --- PASS: TestAccSSMContacts_serial/ContactDataSource/tags/NullMap (342.15s)
            --- PASS: TestAccSSMContacts_serial/ContactDataSource/tags/EmptyMap (341.10s)
            --- PASS: TestAccSSMContacts_serial/ContactDataSource/tags/DefaultTags_nonOverlapping (301.86s)
            --- PASS: TestAccSSMContacts_serial/ContactDataSource/tags/IgnoreTags_Overlap_DefaultTag (302.57s)
        --- PASS: TestAccSSMContacts_serial/ContactDataSource/oncallSchedule (302.13s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ssmcontacts        2535.248s

Copy link
Contributor

github-actions bot commented Oct 2, 2025

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ssmcontacts Issues and PRs that pertain to the ssmcontacts service. size/L Managed by automation to categorize the size of a PR. labels Oct 2, 2025
@MacoTasu MacoTasu force-pushed the f-ssmcontacts-oncall-schedule-39758 branch from a933880 to 286ff1f Compare October 2, 2025 04:23
@MacoTasu MacoTasu force-pushed the f-ssmcontacts-oncall-schedule-39758 branch from 286ff1f to 48d6187 Compare October 2, 2025 04:37
@github-actions github-actions bot added the size/XL Managed by automation to categorize the size of a PR. label Oct 2, 2025
@MacoTasu MacoTasu changed the title [WIP] support on-call rotations for ssmcontacts support on-call rotations for ssmcontacts Oct 2, 2025
@MacoTasu MacoTasu marked this pull request as ready for review October 2, 2025 09:57
@MacoTasu MacoTasu requested a review from a team as a code owner October 2, 2025 09:57
@MacoTasu MacoTasu changed the title support on-call rotations for ssmcontacts [Enhancement] support on-call rotations for ssmcontacts Oct 2, 2025
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/ssmcontacts Issues and PRs that pertain to the ssmcontacts service. size/L Managed by automation to categorize the size of a PR. size/XL 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.

2 participants