-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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]: Changing repository_name argument of aws_codecommit_repository resource forces unnecessary replacement #32161
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
This functionality has been released in v5.22.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! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Core Version
1.5.1, 1.4.2
AWS Provider Version
5.4.0, 4.55.0
Affected Resource(s)
aws_codecommit_repository
Expected Behavior
When changing the repository_name argument, the repository name should be updated in-place, without anything else changing besides the attributes derived from the name (Git access URIs, ARN, etc.).
The provider should call the
UpdateRepositoryName
action on the CodeCommit API, which is also exposed by the Go SDK.ForceNew
should be omitted at https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/codecommit/repository.go#L38, a functionresourceUpdateRepositoryName
should exist calling the aforementioned function in the SDK, andresourceRepositoryUpdate
at https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/codecommit/repository.go#L143 should call said function in the event of a name change.Actual Behavior
Changing the repository name forces the resource to be replaced unnecessarily. Changing a repository name is an action supported by the service. However, that action isn't implemented by the provider, and instead that argument in the schema has
ForceNew
set.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
terraform init
terraform apply -auto-approve
sed -i 's/to-/post-/' main.tf
terraform plan
aws_codecommit_repository.test must be replaced
and# forces replacement
next torepository_name
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_UpdateRepositoryName.html
https://docs.aws.amazon.com/sdk-for-go/api/service/codecommit/#CodeCommit.UpdateRepositoryName
https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-change-repository.html
Would you like to implement a fix?
No (Well, I'd like to, seems simple enough, but my knowledge of Go is unfortunately nonexistent)
The text was updated successfully, but these errors were encountered: