Skip to content

Conversation

its2shar
Copy link

@its2shar its2shar commented Sep 19, 2025

Description

Add resource identity to ARN-based resources in SSMContacts. This includes:

  • aws_ssmcontacts_contact_channel

Relations

Relates #42983
Relates #42984

Output from Acceptance Testing

TF_ACC=1 go test -v ./internal/service/ssmcontacts -run TestAccSSMContacts_serial/ContactChannelResource/identity -timeout 30m
2025/09/24 15:56:25 Creating Terraform AWS Provider (SDKv2-style)...
2025/09/24 15:56:25 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccSSMContacts_serial
=== PAUSE TestAccSSMContacts_serial
=== CONT  TestAccSSMContacts_serial
=== RUN   TestAccSSMContacts_serial/ContactChannelResource
=== RUN   TestAccSSMContacts_serial/ContactChannelResource/identity_Basic
=== RUN   TestAccSSMContacts_serial/ContactChannelResource/identity_ExistingResource
--- PASS: TestAccSSMContacts_serial (104.02s)
    --- PASS: TestAccSSMContacts_serial/ContactChannelResource (104.02s)
        --- PASS: TestAccSSMContacts_serial/ContactChannelResource/identity_Basic (44.88s)
        --- PASS: TestAccSSMContacts_serial/ContactChannelResource/identity_ExistingResource (59.15s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ssmcontacts        109.981s

@its2shar its2shar requested a review from a team as a code owner September 19, 2025 10:39
Copy link
Contributor

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 documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. generators Relates to code generators. service/ssmcontacts Issues and PRs that pertain to the ssmcontacts service. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. size/XL Managed by automation to categorize the size of a PR. labels Sep 19, 2025
@github-actions github-actions bot added the size/L Managed by automation to categorize the size of a PR. label Sep 19, 2025
Copy link
Contributor

@anurag-hashicorp anurag-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to create a changelog:
.changelog/<pr-number>.txt

@anurag-hashicorp anurag-hashicorp self-requested a review September 19, 2025 11:39
@anurag-hashicorp anurag-hashicorp added the rnd-ind-provider rnd-ind-provider label Sep 22, 2025
Comment on lines +24 to +26
# testAccContactChannelConfig_base

data "aws_ssmincidents_replication_set" "test" {} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't match the base config from the standard tests. It creates a replication set resource, e.g.

func testAccContactChannelConfig_base() string {
	return fmt.Sprintf(`
resource "aws_ssmincidents_replication_set" "test" {
  region {
    name = %[1]q
  }
}
`, acctest.Region())
}

This discrepancy is causing the acceptance tests to fail.

=== RUN   TestAccSSMContacts_serial/ContactChannelResource/identity_ExistingResource
    contact_channel_identity_gen_test.go:125: Step 1/2 error: Error running pre-apply plan: exit status 1

        Error: reading SSMIncidents Replication Set: empty result

          with data.aws_ssmincidents_replication_set.test,
          on main_gen.tf line 24, in data "aws_ssmincidents_replication_set" "test":
          24: data "aws_ssmincidents_replication_set" "test" {}

Comment on lines +37 to +38
"identity_Basic": testAccSSMContactsContactChannel_Identity_Basic,
"identity_ExistingResource": testAccSSMContactsContactChannel_Identity_ExistingResource,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets remove the _ here for consistency with other test names.

Suggested change
"identity_Basic": testAccSSMContactsContactChannel_Identity_Basic,
"identity_ExistingResource": testAccSSMContactsContactChannel_Identity_ExistingResource,
"identityBasic": testAccSSMContactsContactChannel_Identity_Basic,
"identityExistingResource": testAccSSMContactsContactChannel_Identity_ExistingResource,

type = "PERSONAL"

depends_on = [data.aws_ssmincidents_replication_set.test]
{{- template "tags" . }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exclude the tags template for any resources which are not the primary subject of the test case.

Suggested change
{{- template "tags" . }}

@jar-b jar-b added the resource-identity Pertains to resource identity. label Sep 24, 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. generators Relates to code generators. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. resource-identity Pertains to resource identity. rnd-ind-provider rnd-ind-provider 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.

3 participants