-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature Request: Support renaming resource types in addition to resource names #83
Comments
|
I'm not sure if |
@suzuki-shunsuke |
@suzuki-shunsuke
I should have tested this before creating the issue. Thank you for implementing the feature (#88) and helping me understand the limitations with provider-level state migrations. |
Oh, I see. |
Feature Overview
Currently, tfmv can rename resource names (e.g., from
example-1
toexample_1
), but it would be useful to also support renaming resource types (e.g., fromaws_lambda_function
toaws_serverless_function
if such renaming occurs in provider updates).Why is the feature needed?
When working with Terraform configurations, there are several scenarios where we need to rename resource types:
Provider Updates: Sometimes providers deprecate and rename their resource types. For example, if a provider decides to rename
aws_elasticsearch_domain
toaws_opensearch_domain
, we need to update all occurrences in our code.Provider Migration: When migrating between providers (e.g., from a community provider to an official one), resource types often need to be changed while keeping the same resource names and configurations.
Currently, this process is manual and error-prone, especially in large codebases. Having tfmv support resource type renaming would make these transitions much smoother and less error-prone.
Example Code
$ tfmv --type-replace "aws_elasticsearch/aws_opensearch"
Expected result:
before:
after:
Note
The text was updated successfully, but these errors were encountered: