{"id":13718945,"url":"https://github.com/udondan/cfn-teleport","last_synced_at":"2026-02-22T20:05:51.853Z","repository":{"id":138777679,"uuid":"609128469","full_name":"udondan/cfn-teleport","owner":"udondan","description":"A command-line tool which can move CloudFormation resources between stacks","archived":false,"fork":false,"pushed_at":"2025-04-12T04:44:56.000Z","size":6525,"stargazers_count":99,"open_issues_count":14,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-13T04:05:06.892Z","etag":null,"topics":["aws","cloudformation","migration"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/udondan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-03T12:42:08.000Z","updated_at":"2025-04-11T21:57:48.000Z","dependencies_parsed_at":"2024-03-18T21:07:36.748Z","dependency_job_id":"da76de13-2ee2-4af4-8878-ce55c79381ea","html_url":"https://github.com/udondan/cfn-teleport","commit_stats":{"total_commits":386,"total_committers":4,"mean_commits":96.5,"dds":0.6295336787564767,"last_synced_commit":"9745efdaa19d12f0930fac08e48658a2f8221730"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udondan%2Fcfn-teleport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udondan%2Fcfn-teleport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udondan%2Fcfn-teleport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udondan%2Fcfn-teleport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/udondan","download_url":"https://codeload.github.com/udondan/cfn-teleport/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661707,"owners_count":21141450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cloudformation","migration"],"created_at":"2024-08-03T01:00:39.814Z","updated_at":"2026-02-22T20:05:51.845Z","avatar_url":"https://github.com/udondan.png","language":"Rust","funding_links":[],"categories":["CLI Tools"],"sub_categories":["Hooks"],"readme":"# cfn-teleport\n\n[![Release](https://img.shields.io/github/v/release/udondan/cfn-teleport)][latest]\n[![crates.io](https://img.shields.io/badge/crates.io-cfn--teleport-yellowgreen)][crate]\n[![License](https://img.shields.io/github/license/udondan/cfn-teleport)][license]\n\nA command-line tool for managing CloudFormation resources across and within stacks.\n\n**Features:**\n\n- **Move resources between stacks** - Transfer resources from one CloudFormation stack to another\n- **Rename resources within a stack** - Change logical IDs of resources in the same stack\n- **Automatic reference updates** - All CloudFormation references (`Ref`, `Fn::GetAtt`, `Fn::Sub`, `DependsOn`, etc.) are automatically updated\n\n![Demo](https://raw.githubusercontent.com/udondan/cfn-teleport/main/docs/demo.gif)\n\n## Installation\n\nOn MacOS and Linux you can install via [Homebrew](https://brew.sh/):\n\n```bash\nbrew install udondan/software/cfn-teleport\n```\n\nOn Arch Linux you can install from [AUR](https://aur.archlinux.org/packages/cfn-teleport), e.g.:\n\n```bash\nyay -S cfn-teleport\n```\n\nOn Windows you can install via [Chocolatey](https://community.chocolatey.org/packages/cfn-teleport):\n\n```powershell\nchoco install cfn-teleport\n```\n\nPre-compiled binaries for various operating systems and architectures are [available for download][latest].\n\nIf you have [rust/cargo installed](https://doc.rust-lang.org/cargo/getting-started/installation.html), you can install the [crate]:\n\n```bash\ncargo install cfn-teleport\n```\n\n## Usage\n\n```bash\n$ cfn-teleport --help\nMove CloudFormation resources between stacks\n\nUsage: cfn-teleport [OPTIONS]\n\nOptions:\n  -s, --source \u003cSOURCE\u003e         Name of the source stack\n  -t, --target \u003cTARGET\u003e         Name of the target stack\n  -r, --resource \u003cID[:NEW_ID]\u003e  Logical ID of a resource from the source stack - optionally with a new ID for the target stack\n  -y, --yes                     Automatically confirm all prompts\n      --mode \u003cMODE\u003e             Operation mode: 'refactor' (safe, atomic, fewer resource types) or 'import' (legacy, more resource types, can orphan resources) [default: refactor]\n  -h, --help                    Print help\n  -V, --version                 Print version\n```\n\n### Moving Resources Between Stacks\n\nTransfer resources from one stack to another:\n\n```bash\ncfn-teleport --source Stack1 --target Stack2 --resource Bucket21D68F7E8 --resource Bucket182C536A1 --yes\n```\n\n#### Operation Modes\n\ncfn-teleport supports two modes for cross-stack resource moves:\n\n| Feature                    | Refactor Mode (Default)                          | Import Mode (Legacy)                        |\n| -------------------------- | ------------------------------------------------ | ------------------------------------------- |\n| **Safety**                 | ✅ Atomic, rolls back on failure                 | ⚠️ Multi-step, can fail mid-way             |\n| **Resource Orphaning**     | ✅ Never happens                                 | ⚠️ Possible on failure                      |\n| **Resource Tags**          | ✅ Updated to new stack                          | ⚠️ Shows old stack name                     |\n| **Supported Types**        | ❌ Fewer (no KeyPair, etc.)                      | ✅ More types                               |\n| **Parameter Dependencies** | ✅ Allowed (target must have matching parameter) | ❌ Blocked (not validated for import mode)  |\n| **Recommendation**         | ✅ Use by default                                | ⚠️ Only for unsupported types               |\n\n##### Refactor Mode (Default, Recommended)\n\nUses the AWS CloudFormation Stack Refactoring API:\n\n```bash\ncfn-teleport --source Stack1 --target Stack2 --resource MyBucket --mode refactor\n```\n\n**Advantages:**\n\n- ✅ **Safe and atomic** - Either succeeds completely or rolls back with no changes\n- ✅ **No orphaned resources** - Resources never end up outside of any stack\n- ✅ **Updates resource tags** - `aws:cloudformation:*` tags reflect new stack ownership\n- ✅ **Validates parameter dependencies** - Checks that target stack has required parameters before moving\n\n**Limitations:**\n\n- ❌ **Fewer supported resource types** - Some resources (like `AWS::EC2::KeyPair`) cannot be moved because updating their tags requires resource replacement\n- ❌ **Target stack must have matching parameters** - Resources depending on parameters require the same parameter to exist in the target stack\n\n##### Import Mode (Legacy)\n\nUses the legacy import/export flow (6-step manual process):\n\n```bash\ncfn-teleport --source Stack1 --target Stack2 --resource MyKeyPair --mode import\n```\n\n**Advantages:**\n\n- ✅ **More resource types** - Can move resources like `AWS::EC2::KeyPair` that don't allow tag updates\n- ✅ **No tag updates required** - Only updates CloudFormation's internal tracking database\n\n**Risks:**\n\n- ⚠️ **Can orphan resources** - If the operation fails mid-way (steps 5-6), resources may be left outside any stack\n- ⚠️ **Not atomic** - Multi-step process that can leave stacks in inconsistent state on failure\n- ⚠️ **Outdated tags** - Resource tags still reference old stack (cosmetic issue only)\n- ⚠️ **Cannot move resources with parameter dependencies** - For safety, import mode blocks all resources that depend on stack parameters (not validated for import mode)\n\n**When to use import mode:**\n\n- You need to move a resource type that refactor mode doesn't support\n- You understand and accept the risk of potential resource orphaning\n- You have a backup/recovery plan if the operation fails\n\nThe tool will:\n\n1. Export resources from the source stack (refactor mode: atomic; import mode: manual steps)\n2. Import them into the target stack\n3. Update all references in both stacks automatically\n4. Preserve the physical resources (no deletion/recreation)\n\n### Renaming Resources Within a Stack\n\nRename resources in the same stack by specifying the same source and target:\n\n```bash\ncfn-teleport --source MyStack --target MyStack --resource OldBucketName:NewBucketName --yes\n```\n\n**Note:** Same-stack operations always use refactor mode (safe and atomic) regardless of the `--mode` parameter.\n\nThe tool will:\n\n1. Rename the logical ID of the resource\n2. Update all references (`Ref`, `Fn::GetAtt`, `Fn::Sub`, `DependsOn`, etc.) automatically\n3. Preserve the physical resource (no deletion/recreation)\n\n### Interactive Mode\n\nIf any of the required options is undefined, the program will prompt for input interactively:\n\n```bash\ncfn-teleport\n# Will prompt for:\n# - Source stack name\n# - Target stack name\n# - Resources to move/rename\n# - Optional: New logical IDs for each resource\n```\n\n## Contributing\n\nContributions are welcome!\n\nThis project uses [conventional commits](https://www.conventionalcommits.org/). Please make sure all your merge request titles follow these specifications.\n\n[license]: https://github.com/udondan/iam-floyd/blob/main/LICENSE\n[crate]: https://crates.io/crates/cfn-teleport\n[latest]: https://github.com/udondan/cfn-teleport/releases/latest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudondan%2Fcfn-teleport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fudondan%2Fcfn-teleport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudondan%2Fcfn-teleport/lists"}