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]: Deployment options of stack sets are not respected #30864

Open
JulianAWS opened this issue Apr 21, 2023 · 4 comments
Open

[Bug]: Deployment options of stack sets are not respected #30864

JulianAWS opened this issue Apr 21, 2023 · 4 comments
Labels
bug Addresses a defect in current functionality. service/cloudformation Issues and PRs that pertain to the cloudformation service.

Comments

@JulianAWS
Copy link

JulianAWS commented Apr 21, 2023

Terraform Core Version

1.4.5 on darwin_arm64

AWS Provider Version

4.58.0

Affected Resource(s)

  • aws_cloudformation_stack_set
  • aws_cloudformation_stack_set_instance

Expected Behavior

The deployment options of the stack set are as stated in the state file / terraform code

Actual Behavior

The deployment options of the stack set remain at default after terraform apply

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_cloudformation_stack_set" "default_iam_roles" {
    administration_role_arn = "arn:aws:iam::**********:role/aws-service-role/stacksets.cloudformation.amazonaws.com/AWSServiceRoleForCloudFormationStackSetsOrgAdmin"
    arn                     = "arn:aws:cloudformation:us-east-1:*********:stackset/default-iam-roles:*********************"
    call_as                 = "SELF"
    capabilities            = [
        "CAPABILITY_IAM",
        "CAPABILITY_NAMED_IAM",
    ]
    execution_role_name     = "stacksets-exec-*********************"
    id                      = "default-iam-roles"
    name                    = "default-iam-roles"
    parameters              = {
        "pIdpUrl" = "*********************"
    }
    permission_model        = "SERVICE_MANAGED"
    stack_set_id            = "default-iam-roles:*********************"
    tags                    = {}
    template_body           = <<-EOT
       ....
    EOT

    auto_deployment {
        enabled                          = true
        retain_stacks_on_account_removal = false
    }

    operation_preferences {
        failure_tolerance_count      = 0
        failure_tolerance_percentage = 10
        max_concurrent_count         = 0
        max_concurrent_percentage    = 100
        region_order                 = []
    }
}



resource "aws_cloudformation_stack_set_instance" "default_iam_roles" {
    account_id             = "*********************"
    call_as                = "SELF"
    id                     = "default-iam-roles,*********************,<aws-region>"
    organizational_unit_id = "*********************"
    region                 = "<aws-region>"
    retain_stack           = false
    stack_id               = "arn:aws:cloudformation:<aws-region>:*********************:stack/StackSet-default-iam-roles--*********************"
    stack_set_name         = "default-iam-roles"

    deployment_targets {
        organizational_unit_ids = [
            "*********************",
        ]
    }

    operation_preferences {
        failure_tolerance_count      = 0
        failure_tolerance_percentage = 10
        max_concurrent_count         = 0
        max_concurrent_percentage    = 100
        region_concurrency_type      = "PARALLEL"
    }
}

Steps to Reproduce

terraform init
terraform apply

Debug Output

Apply complete! Resources: 0 added, 2 changed, 0 destroyed.

Panic Output

No response

Important Factoids

No response

References

Would you like to implement a fix?

None

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

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Apr 25, 2023
@evantlueck
Copy link

My answer here may give some insight. I also ran into this issue: #33170 (comment)

@ohookins
Copy link

Not sure if it's the same issue I'm seeing, but I'm finding that service-managed stacksets continually attempt to remove the administration_role_arn parameter on the stack set. But of course, this is unnecessary if it's a service-managed stackset (as opposed to self managed).

  # module.xxxx[0].aws_cloudformation_stack_set.xxxx[0] will be updated in-place
  ~ resource "aws_cloudformation_stack_set" "xxxx" {
      - administration_role_arn = "arn:aws:iam::000000000000:role/aws-service-role/stacksets.cloudformation.amazonaws.com/AWSServiceRoleForCloudFormationStackSetsOrgAdmin" -> null
        id                      = "xxxx"
        name                    = "xxxx"
      ~ parameters              = {
          ~ "Region"               = (sensitive value)
            # (6 unchanged elements hidden)
        }
        tags                    = {}
        # (10 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

@michalz-rely
Copy link

@ohookins it's not, you can simply ignore that changes with lifecycle
lifecycle { ignore_changes = [ administration_role_arn ] }

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