Skip to content

Conversation

@RezaImany
Copy link

@RezaImany RezaImany commented Oct 29, 2025

Summary

Adds aws_fis_target_account_configuration to manage FIS target account configuration for multi‑account experiment templates. This wraps the AWS FIS CreateTargetAccountConfiguration API.
Motivation

FIS supports multi-account experiments where the template runs actions in additional AWS accounts. This resource registers a target account and the role FIS assumes to execute the experiment there.
Implementation

Resource: internal/service/fis/fis_target_account_configuration.go
Create: calls CreateTargetAccountConfiguration with ClientToken = id.UniqueId() for idempotency; sets composite ID <experiment_template_id>/<account_id>.
Read: calls GetTargetAccountConfiguration, updates state; clears state on ResourceNotFoundException.
Update: if description changes, reissues CreateTargetAccountConfiguration with the same IDs (idempotent in AWS) and new description; re-reads state.
Delete: calls DeleteTargetAccountConfiguration, tolerates already-deleted ResourceNotFoundException.
Import: supports composite ID <experiment_template_id>/<account_id>.
Timeouts: create/update/delete default 30m.
Registration: internal/service/fis/service_package_gen.go adds the resource factory for aws_fis_target_account_configuration.
Finder/waiters: helper functions use composite ID parsing and the FIS SDK v2 types.TargetAccountConfiguration.
Removed scaffold-only helpers; code uses only required logic.
Schema

account_id (Required, ForceNew)
experiment_template_id (Required, ForceNew)
role_arn (Required, ForceNew)
description (Optional)
Identity and Import

ID is <experiment_template_id>/<account_id>.
Import accepts the same composite ID.
Behavior Notes

Only required when experiment_options.account_targeting in the template is multi-account.
Update: only description is mutable; implemented via idempotent CreateTargetAccountConfiguration call (no dedicated Update API).
Not Found: ResourceNotFoundException removes the resource from state during Read and is ignored during Delete.
Tests

internal/service/fis/fis_target_account_configuration_test.go
Basic: provisions an experiment template + target account config, asserts fields, and verifies import.
Disappears: deletes target account configuration out of band and expects recreation on plan.
Description update: updates description and verifies state.
Exports: internal/service/fis/exports_test.go exposes FindTargetAccountConfigurationByID for tests.
Documentation

Canonical: website/docs/r/fis_target_account_configuration.html.markdown
Parallel: website/docs/r/fis_target_account_configuration.md
Legacy stub: website/docs/r/fis_fis_target_account_configuration.html.markdown (redirects readers to the new page)
Includes example usage, argument/attribute docs, import, timeouts, and a link to the AWS API docs.
Generation

Ran make gen to register resource and update generated files.
Manual Validation

Built provider locally and validated end-to-end using a sample Terraform config:
terraform init && terraform apply to create, then delete via console/CLI and re-plan to confirm recreation, then terraform destroy.
Checklist

New resource
Acceptance tests (basic, disappears, argument update)
Documentation
make gen, make fmt, make lint (note: local linter may require pinned Go version)
Unit tests pass (make test)
No breaking changes

Closes #44884

@RezaImany RezaImany requested a review from a team as a code owner October 29, 2025 23:59
@github-actions
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
Copy link
Contributor

github-actions bot commented Oct 30, 2025

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

@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. generators Relates to code generators. service/fis Issues and PRs that pertain to the fis service. size/XL Managed by automation to categorize the size of a PR. labels Oct 30, 2025
@github-actions github-actions bot removed the needs-triage Waiting for first response or review from a maintainer. label Nov 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

Warning

This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

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. service/fis Issues and PRs that pertain to the fis service. 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.

[new resource] aws_fis_target_account_configuration

1 participant