Terraform: Strange Behavior with Module Outputs implementation guide After Resource Changes in AWS
I'm performance testing and I'm working with an scenario in my Terraform configuration where the outputs of a module do not seem to update even after I have made changes to the underlying resources. I am using Terraform v1.3.5 and have a module that manages an S3 bucket with a few additional configurations. Hereβs a simplified version of my module's output definition: ```hcl output "bucket_arn" { value = aws_s3_bucket.my_bucket.arn } ``` The S3 bucket resource is defined as follows: ```hcl resource "aws_s3_bucket" "my_bucket" { bucket = "my-unique-bucket-name" acl = "private" } ``` After running `terraform apply`, I added tags to my S3 bucket like this: ```hcl resource "aws_s3_bucket" "my_bucket" { bucket = "my-unique-bucket-name" acl = "private" tags = { Name = "MyBucket" Environment = "Dev" } } ``` However, when I check the output using `terraform output`, the `bucket_arn` value remains the same and does not reflect any updates. I expected it to show the ARN of the newly configured S3 bucket with tags. I have tried running `terraform refresh` and `terraform apply` multiple times, but the outputs do not seem to update as anticipated. There are no errors during the apply process, and the state file seems correct. Is there a known scenario or a specific configuration that could be causing the outputs not to refresh correctly? What am I missing in terms of best practices for module outputs and resource changes? Is this even possible? I'm using Hcl latest in this project. Any help would be greatly appreciated!