hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.72k stars 9.08k forks source link

[Docs]: CodePipeline Source configuration - DetectChanges #38409

Closed sebolabs closed 3 weeks ago

sebolabs commented 1 month ago

Documentation Link

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codepipeline

Description

There's that DetectChanges property available in the Source action type configuration block. One can get to know it exists by checking that action AWS docs, however, that property is considered optional.

Unfortunately, If unspecified, the default value is true and that has got the following consequences:

It makes it tricky to figure out why you get a section configured that is nowhere declared.

My life example that made me raise this issue:

I've figured it out by updating the pipeline config with AWS CLI and then re-running Terraform plan. It then revealed this:

      ~ stage {
            name = "Source"

          ~ action {
              ~ configuration    = {
                  - "DetectChanges"    = "true" -> null
                    # (3 unchanged elements hidden)
                }
                name             = "Source"
                # (7 unchanged attributes hidden)
            }
        }

and that let me figure it out.

After I set "DetectChanges" = false and re-applied the trigger was gone and no changes were detected any more.

While I appreciate you refer in the docs to AWS docs, imo considering the default value for that property is true it impacts the configuration of the pipeline and makes Terraform see changes that are out of control.

Maybe it would be worth adding a note to the trigger block making people aware of that behaviour? Up to you, am just sharing my experience.

Big up!

References

https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html#action-reference-CodestarConnectionSource-config

Would you like to implement a fix?

None

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

Jyots6914 commented 1 month ago

Hi I will work on it and will raise PR

github-actions[bot] commented 3 weeks ago

[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

github-actions[bot] commented 2 weeks ago

This functionality has been released in v5.63.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!