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

[Bug]: Stackset module not respecting failure_tolerance_count/failure_tolerance_percentage #27764

Open
soumyadipDe opened this issue Nov 11, 2022 · 4 comments
Labels
bug Addresses a defect in current functionality. service/cloudformation Issues and PRs that pertain to the cloudformation service.

Comments

@soumyadipDe
Copy link

soumyadipDe commented Nov 11, 2022

Terraform Core Version

v1.2.4

AWS Provider Version

v4.39.0

Affected Resource(s)

aws_cloudformation_stack_set

Expected Behavior

failure_tolerance_count or failure_tolerance_percentage should be configured in Stackset resources once given as part of operation_preferences.

Actual Behavior

failure_tolerance_count or failure_tolerance_percentage is showing 0 in AWS console and stack instances getting cancelled if a region is failed.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

data "local_file" "aws-config-stackset" {
  filename = "aws-config-stackset.yaml"
}
locals {
  aws_regions = [
    "eu-north-1",
    "ap-south-1",
    "eu-west-3",
    "eu-west-2",
    "eu-west-1",
    "ap-northeast-3",
    "ap-northeast-2",
    "ap-northeast-1",
    "sa-east-1",
    "ca-central-1",
    "ap-southeast-1",
    "ap-southeast-2",
    "eu-central-1",
    #"us-east-1",
    "us-east-2",
    "us-west-1",
    #"us-west-2"
  ]
}
resource "aws_cloudformation_stack_set" "ENABLE-AWS-CONFIG-MULTI-ACCOUNT-MULTI-REGION" {
  name             = "ENABLE-AWS-CONFIG-MULTI-ACCOUNT-MULTI-REGION"
  capabilities     = ["CAPABILITY_IAM"]
  permission_model = "SERVICE_MANAGED"

  operation_preferences {
    region_concurrency_type = "PARALLEL"
    max_concurrent_count = 100
    failure_tolerance_count = 999
  }
  parameters = {
    Frequency                  = "6hours"
    AllSupported               = "true"
    DeliveryChannelName        = "<Generated>"
    IncludeGlobalResourceTypes = "true"
    NotificationEmail          = "<None>"
    ResourceTypes              = "<All>"
    "TopicArn"                 = "<New Topic>"
  }

  template_body = data.local_file.aws-config-stackset.content

  
  auto_deployment {
    enabled                          = true
    retain_stacks_on_account_removal = false
  }

  timeouts {}
}

resource "aws_cloudformation_stack_set_instance" "ENABLE-AWS-CONFIG-MULTI-ACCOUNT-MULTI-REGION-INSTANCE" {
  stack_set_name = aws_cloudformation_stack_set.ENABLE-AWS-CONFIG-MULTI-ACCOUNT-MULTI-REGION.name
  deployment_targets {
    organizational_unit_ids = [
       "ou-something"
    ]
  }
  for_each = toset(local.aws_regions)
  region       = each.value
}

Steps to Reproduce

Deploying the stackset.
It would not respect the failure tolerance value.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No response

@soumyadipDe soumyadipDe added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Nov 11, 2022
@github-actions github-actions bot added the service/cloudformation Issues and PRs that pertain to the cloudformation service. label Nov 11, 2022
@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.

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Dec 6, 2022
@JorisBoelen-TomTom
Copy link

I was experiencing some issues with this as well, but after some investigation I noticed that the operation_preferences argument can be set on both the aws_cloudformation_stack_set_instance and aws_cloudformation_stack_set resource types.

On the aws_cloudformation_stack_set_instance it applies to any modifications to the deployment targets (OUs, accounts, regions)
On the aws_cloudformation_stack_set it applies to any modifications to the stack (template, parameters, tags)

When applied to both resources types it works for me as expected. Perhaps this is not a bug but just a confusing implementation?

@aries1980
Copy link
Contributor

@JorisBoelen-TomTom : to me it is doesn't apply it on the stack set level either. It is like the whole operation_preferences gets ignored. See my comment on: #30806 (comment)

@podon
Copy link

podon commented May 17, 2023

I believe this is an issue with the AWS UI. After manually adjusting the tolerance count in the UI to 100, repeating the process shows a default of 1 again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/cloudformation Issues and PRs that pertain to the cloudformation service.
Projects
None yet
Development

No branches or pull requests

5 participants