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

[Enhancement]: aws_cloudformation_stack_set_instance DeploymentTargets #33914

Closed
mbainter opened this issue Oct 12, 2023 · 7 comments · Fixed by #37898
Closed

[Enhancement]: aws_cloudformation_stack_set_instance DeploymentTargets #33914

mbainter opened this issue Oct 12, 2023 · 7 comments · Fixed by #37898
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/cloudformation Issues and PRs that pertain to the cloudformation service.
Milestone

Comments

@mbainter
Copy link
Contributor

Description

When deploying StackSets using aws_cloudformation_stack_set_instance the API provides a means to manage which accounts in the target OUs will receive the deploys.

Service-managed Stack Sets, can deploy to individual accounts with the accounts parameter, to all the accounts in specified OU, or a subset of accounts in the specified OU.

{
  "Accounts": ["string", ...],
  "AccountsUrl": "string", 
  "OrganizationalUnitIds": ["string", ...] 
  "AccountFilterType": "string"
}

You can specify a list of accounts, and then affect how that list is used with the filter type:

  • INTERSECTION: StackSets deploys to the accounts specified in Accounts parameter.
  • DIFFERENCE: StackSets excludes the accounts specified in Accounts parameter. This enables user to avoid certain accounts within an OU such as suspended accounts.
  • UNION: (default value) StackSets includes additional accounts deployment targets.
  • NONE: Deploys to all the accounts in specified organizational units (OU).

This is particularly important when using the SERVICE_MANAGED permission model, as you cannot target or exclude individual accounts with the resources currently provided. If you try to do something like what is in the documentation:

resource "aws_cloudformation_stack_set_instance" "example" {
  account_id     = "123456789012"
  region         = "us-east-1"
  stack_set_name = aws_cloudformation_stack_set.example.name
}

when using a SERVICE_MANAGED model you get a validation error:

Error: creating CloudFormation StackSet (example) Instance: ValidationError: StackSets with SERVICE_MANAGED permission model can only have OrganizationalUnit as target

Affected Resource(s) and/or Data Source(s)

  • aws_cloudformation_stack_set_instance

Potential Terraform Configuration

resource "aws_cloudformation_stack_set_instance" "example" {
  deployment_targets {
    organizational_unit_ids = [aws_organizations_organization.example.roots[0].id]
    accounts = var.excluded_accounts
    account_filter_type = "DIFFERENCE"
  }

  region         = "us-east-1"
  stack_set_name = aws_cloudformation_stack_set.example.name
}

References

Would you like to implement a fix?

No

@mbainter mbainter added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 12, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/cloudformation Issues and PRs that pertain to the cloudformation service. label Oct 12, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 12, 2023
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Oct 25, 2023
@michalz-rely
Copy link

This feature is really missing

@dylanmtaylor
Copy link

We really need this to avoid deploying a stackset to a couple of accoutns

@halberom
Copy link

halberom commented Apr 2, 2024

This is related to issue #26917 and pr #26935

Copy link

github-actions bot commented Jul 5, 2024

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. 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.

@github-actions github-actions bot added this to the v5.58.0 milestone Jul 5, 2024
Copy link

This functionality has been released in v5.58.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. Thank you!

Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/cloudformation Issues and PRs that pertain to the cloudformation service.
Projects
None yet
5 participants