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

awscc_greengrassv2_deployment recreates the entire resource when a component version changes #2114

Open
bobthemighty opened this issue Nov 26, 2024 · 2 comments

Comments

@bobthemighty
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the CloudFormation Open Coverage Roadmap.

Terraform CLI and Terraform AWS Cloud Control Provider Version

Terraform v1.2.3
on linux_amd64

  • provider registry.terraform.io/hashicorp/awscc v1.16.1

Affected Resource(s)

  • awscc_greengrassv2_deployment

Terraform Configuration Files

resource "awscc_greengrassv2_deployment" "demo" {
  deployment_name = "demo"
  target_arn      = "arn:aws:iot:${local.region}:${local.aws_account_id}:thing/demo"

  components = {
    my_component= {
      component_version = var.component_version
      configuration_update = {
        merge = jsonencode({
          Message = "Hello, Greengrass!"
        })
      }
    }
  }
}

Debug Output

  # module.greengrass[0].awscc_greengrassv2_deployment.demo must be replaced
-/+ resource "awscc_greengrassv2_deployment" "demo" {
      ~ components            = {
          ~ "my_component" = { # forces replacement
              ~ component_version    = "1.0.9" -> "1.0.10"
              ~ configuration_update = {
                  + reset = (known after apply)
                    # (1 unchanged attribute hidden)
                }
              + run_with             = {
                  + posix_user             = (known after apply)
                  + system_resource_limits = {
                      + cpus   = (known after apply)
                      + memory = (known after apply)
                    }
                  + windows_user           = (known after apply)
                }
            },
        }
      ~ deployment_id         = "fdef5944-80f4-4f60-8898-5c0f353244b8" -> (known after apply)
      + deployment_policies   = {
          + component_update_policy         = {
              + action             = (known after apply)
              + timeout_in_seconds = (known after apply)
            }
          + configuration_validation_policy = {
              + timeout_in_seconds = (known after apply)
            }
          + failure_handling_policy         = (known after apply)
        }
      ~ id                    = "fdef5944-80f4-4f60-8898-5c0f353244b8" -> (known after apply)
      + iot_job_configuration = {
          + abort_config                  = {
              + criteria_list = [
                ] -> (known after apply)
            }
          + job_executions_rollout_config = {
              + exponential_rate   = {
                  + base_rate_per_minute   = (known after apply)
                  + increment_factor       = (known after apply)
                  + rate_increase_criteria = {
                      + number_of_notified_things  = (known after apply)
                      + number_of_succeeded_things = (known after apply)
                    }
                }
              + maximum_per_minute = (known after apply)
            }
          + timeout_config                = {
              + in_progress_timeout_in_minutes = (known after apply)
            }
        }
      + parent_target_arn     = (known after apply)
      ~ tags                  = {} -> (known after apply)
        # (2 unchanged attributes hidden)
    }

Expected Behavior

I would like to change the component version, and update the existing deployment, so that we create a new version of the deployment, and my greengrass device automatically updates.

Actual Behavior

Changing the component version causes the entire Deployment to be replaced, rather than updated in place, with the result that I get a new deployment, at version 1, rather than the same deployment at version 2.
Greengrass core ignores the update, since the deployment has the same arn and version number.

Steps to Reproduce

  • Create a greengrass deployment, deploy
  • Update the version number, deploy
@wellsiau-aws
Copy link
Collaborator

@bobthemighty , thanks for reporting the issue. To help us categorize this into existing common problem, can you run the plan again with TF_LOG set to DEBUG. Ref : https://developer.hashicorp.com/terraform/internals/debugging

@quixoticmonk
Copy link
Collaborator

quixoticmonk commented Dec 13, 2024

Isn't the resource expected to be replaced with any change in the components attribute ?

Components
The components to deploy. This is a dictionary, where each key is the name of a component, and each key's value is the version and configuration to deploy for that component.
Required: No

Update requires: Replacement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants