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

d/aws_sfn_state_machines: Add data source for listing all State Machines #34519

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sklirg
Copy link
Contributor

@sklirg sklirg commented Nov 22, 2023

Description

Adds a data source for listing all State Machines in Step Functions.

This can be combined with the data.aws_sfn_state_machine data source to get detailed information about each resource via the arns and names attributes in a for_each loop.

I tried following the skaff-procedure as detailed in https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/add-a-new-datasource.md but couldn't find any reference implementations from services I already know about/use, so I decided to follow the code used in e.g. the RDS Clusters data source instead.

I've tested overriding the provider locally and I got the expected output, but I'll try to provide the acceptance tests as well.

Relations

References

Output from Acceptance Testing

I was not able to add acceptance tests because I'm not quite sure how to ensure a resource exists while testing a data source only, and looking at the singular data.aws_sfn_state_machine it seemed like that just expects 1 to exist, which doesn't work when I try the same. If you have any pointers on how to add acceptance tests for a data source fetching multiple items I'd love that, but I'll keep playing around to try to get them done. :)

% make testacc TESTS=TestAccXXX PKG=ec2

...

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • 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 size/M Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/sfn Issues and PRs that pertain to the sfn service. generators Relates to code generators. labels Nov 22, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 22, 2023
@justinretzolk justinretzolk added new-data-source Introduces a new data source. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 6, 2023
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. new-data-source Introduces a new data source. service/sfn Issues and PRs that pertain to the sfn service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants