terraform-provider-awscc icon indicating copy to clipboard operation
terraform-provider-awscc copied to clipboard

awscc_qbusiness_application - unnecessary drift

Open wellsiau-aws opened this issue 9 months ago • 2 comments

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.7.4
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.49.0
+ provider registry.terraform.io/hashicorp/awscc v0.76.0

Affected Resource(s)

  • awscc_qbusiness_application

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

data "aws_ssoadmin_instances" "example" {}

resource "awscc_qbusiness_application" "example" {
  description                  = "Example QBusiness Application New Desc Ver 3"
  display_name                 = "Demo_QBusiness_App"
  identity_center_instance_arn = data.aws_ssoadmin_instances.example.arns[0]
}

Debug Output

Expected Behavior

Subsequent terraform plan after the first terraform apply should not trigger any drift.

Actual Behavior

Subsequent terraform plan detected a drift.

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # awscc_qbusiness_application.example will be updated in-place
  ~ resource "awscc_qbusiness_application" "example" {
      + encryption_configuration        = (known after apply)
        id                              = "1eddae12-d80f-4f52-8e3c-3af32f42d054"
      + tags                            = (known after apply)
        # (11 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

  1. terraform apply
  2. terraform plan
  3. observe the new execution plan

Important Factoids

  • Notice the Terraform plan execution picked two attribute encryption_configuration and tags which were not declared in the configuration.
  • However this line on the debug log indicates that Terraform thinks that the drift occurs on another attribute attachments_configuration.
  • Attribute attachments_configuration does not have default value in Cfn schema. However, CCAPI GetResource will return the default value after you created the resource.

References

  • #0000

wellsiau-aws avatar May 15 '24 18:05 wellsiau-aws

Comparing the Request.State.Raw from AWSCC provider ReadResource implementation in here versus the Response.State.Raw in here, I found that the state are equal.

I suspect other processes are involved

wellsiau-aws avatar May 15 '24 19:05 wellsiau-aws