Rename a resource
Copy resource to Rename
To rename a resource, the recommended approach is to duplicate (copy) the resource file you'd like to rename, update the name of the new resource with its new name, update the identifier attribute, and then set the deleted: true on the original resource template. See How to delete a resource.
For instance if you have a demo-1 role that is defined in the demo-1.yaml file and you'd like to rename the demo-1 role to demo-1-renamed, you would first copy the demo-1.yaml file:
cp demo-1.yaml demo-1-renamed.yaml, change the identifier and role_name attributes in the demo-1-renamed.yaml file to reflect the new name.
In the demo-1.yaml file you should add the deleted: true attribute underneath the template_type attribute, see How to delete a resource.
Lastly, run iambic apply to complete the rename process.