{"id":13505822,"url":"https://github.com/JamesWoolfenden/sato","last_synced_at":"2025-03-30T00:31:41.271Z","repository":{"id":61533965,"uuid":"551475761","full_name":"JamesWoolfenden/sato","owner":"JamesWoolfenden","description":"Sato converts ARM or CFN into Terraform","archived":false,"fork":false,"pushed_at":"2025-03-13T01:52:32.000Z","size":5873,"stargazers_count":106,"open_issues_count":1,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-22T04:47:16.434Z","etag":null,"topics":["arm","aws","azure","cfn","cloudformation","terraform"],"latest_commit_sha":null,"homepage":"","language":"Go","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/JamesWoolfenden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-14T13:22:43.000Z","updated_at":"2025-03-05T21:04:13.000Z","dependencies_parsed_at":"2024-01-07T10:51:08.776Z","dependency_job_id":"0cbe07eb-d14e-47b2-91ae-c0f9fd89da2d","html_url":"https://github.com/JamesWoolfenden/sato","commit_stats":null,"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesWoolfenden%2Fsato","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesWoolfenden%2Fsato/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesWoolfenden%2Fsato/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesWoolfenden%2Fsato/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesWoolfenden","download_url":"https://codeload.github.com/JamesWoolfenden/sato/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262490,"owners_count":20749170,"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":["arm","aws","azure","cfn","cloudformation","terraform"],"created_at":"2024-08-01T00:01:14.685Z","updated_at":"2025-03-30T00:31:36.259Z","avatar_url":"https://github.com/JamesWoolfenden.png","language":"Go","funding_links":[],"categories":["Go","Tools","azure"],"sub_categories":["Community providers"],"readme":"# Sato\n\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/jameswoolfenden/sato/graphs/commit-activity)\n[![Build Status](https://github.com/JamesWoolfenden/sato/workflows/CI/badge.svg?branch=master)](https://github.com/JamesWoolfenden/sato)\n[![Latest Release](https://img.shields.io/github/release/JamesWoolfenden/sato.svg)](https://github.com/JamesWoolfenden/sato/releases/latest)\n[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/JamesWoolfenden/sato.svg?label=latest)](https://github.com/JamesWoolfenden/sato/releases/latest)\n![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.14.0-blue.svg)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![checkov](https://img.shields.io/badge/checkov-verified-brightgreen)](https://www.checkov.io/)\n[![Github All Releases](https://img.shields.io/github/downloads/jameswoolfenden/sato/total.svg)](https://github.com/JamesWoolfenden/sato/releases)\n[![codecov](https://codecov.io/gh/JamesWoolfenden/sato/graph/badge.svg?token=AT1DREJQPR)](https://codecov.io/gh/JamesWoolfenden/sato)\n\nConverts CloudFormation (and now also ARM) into Terraform. In Go, but quickerly.\n\n## Table of Contents\n\n\u003c!--toc:start--\u003e\n\n- [Sato](#sato)\n  - [Table of Contents](#table-of-contents)\n  - [Install](#install)\n    - [Compile](#compile)\n    - [MacOS](#macos)\n    - [Windows](#windows)\n    - [Docker](#docker)\n  - [Usage](#usage)\n    - [Bisect](#bisect)\n    - [Parse](#parse)\n    - [See](#see)\n    - [Version](#version)\n    - [Help](#help)\n\n\u003c!--toc:end--\u003e\n\n## Install\n\n### Compile\n\nDownload the latest releases \u003chttps://github.com/JamesWoolfenden/sato/releases/tag/v0.1.19\u003e or:\n\nCompile locally:\n\n```bash\ngit clone https://github.com/JamesWoolfenden/sato\ncd sato\ngo install\n```\n\n### MacOS\n\n```shell\nbrew tap jameswoolfenden/homebrew-tap\nbrew install jameswoolfenden/tap/pike\n```\n\n### Windows\n\nI'm now using Scoop to distribute releases, it's much quicker to update and easier to manage than previous methods,\nyou can install scoop from \u003chttps://scoop.sh/\u003e.\n\nAdd my scoop bucket:\n\n```shell\nscoop bucket add iac https://github.com/JamesWoolfenden/scoop.git\n```\n\nThen you can install a tool:\n\n```pwsh\nscoop install sato\n```\n\n### Docker\n\n```shell\ndocker pull jameswoolfenden/sato\ndocker run --tty --volume /local/path/to/tf:/tf jameswoolfenden/sato scan -d /tf\n```\n\n\u003chttps://hub.docker.com/repository/docker/jameswoolfenden/sato\u003e\n\n## Usage\n\n### Parse\n\nGet yourself some valid CloudFormation*\n\n```bash\n git clone https://github.com/JamesWoolfenden/aws-cloudformation-templates\n \u003ecd aws-cloudformation-templates/community/codestar/custom-ci-cd-pipeline\n ❯ ls\n README.md    template.yml\n \u003esato parse -f template.yml\n 9:17PM INF Created .sato\\variables.tf\n 9:17PM INF Created .sato\\data.tf\n 9:17PM INF Created .sato\\aws_codebuild_project.productionbuild.tf\n 9:17PM INF Created .sato\\aws_codebuild_project.productiondeploy.tf\n 9:17PM INF Created .sato\\aws_codebuild_project.stagingbuild.tf\n 9:17PM INF Created .sato\\aws_codebuild_project.stagingdeploy.tf\n 9:17PM INF Created .sato\\aws_iam_role.codebuildrole.tf\n 9:17PM INF Created .sato\\aws_codepipeline_pipeline.pipeline.tf\n 9:17PM INF Created .sato\\aws_iam_role.pipelinerole.tf\n 9:17PM INF Created .sato\\aws_s3_bucket.pipelines3bucket.tf\n```\n\nThat's it. So by default (overridable) the parsed CloudFormation (now Terraform) will be in a .sato subdirectory.\nSo let's have a look see:\n\n```bash\n\u003e ls .sato\naws_codebuild_project.productionbuild.tf  aws_codebuild_project.stagingbuild.tf     aws_codepipeline_pipeline.pipeline.tf     aws_iam_role.pipelinerole.tf              variables.tf\naws_codebuild_project.productiondeploy.tf aws_codebuild_project.stagingdeploy.tf    aws_iam_role.codebuildrole.tf             aws_s3_bucket.pipelines3bucket.tf\n```\n\nSo there are some files that could be Terraform.\n\n### The Cats Pyjamas\n\nTesting...\n\n```bash\n\u003eterraform init\n...\nTerraform has been successfully initialized!\n....\n\u003eterraform plan\nTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:\n  + create\n...\nPlan: 12 to add, 0 to change, 0 to destroy.\n...\n```\n\n### See\n\nShows the Terraform resource equivalent to a CloudFormation resource, or vice versa.\n\nThis tells you the equivalent resource required, given a CF or an ARM resource;\n\n```bash\n$ sato see -r Microsoft.Storage/storageAccounts\nazurerm_storage_account\n```\n\nor\n\n```bash\n$sato see -r AWS::EC2::Instance\naws_instance%\n```\n\n### Bisect\n\nARM to Terraform conversion.\n\nWhat? You've got these legacy ARM templates, and you'd dearly love to drop them, but you really don't fancy Bicep\nand the rework.\nI got you covered. Sato now bisects ARM into Terraform.\n\nTake one of the Azure quickstart examples from here\n\u003chttps://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.compute/vm-simple-windows\u003e:\n\nClone it:\n\n```bash\ngit clone https://github.com/Azure/azure-quickstart-templates.git\n```\n\nThen bisect it!\n\n```bash\n$ sato bisect -f /Users/jwoolfenden/code/azure-quickstart-templates/quickstarts/microsoft.compute/vm-simple-windows/azuredeploy.json\n1:56PM INF Created /Users/jwoolfenden/code/sato/.sato/variables.tf\n1:56PM INF Created /Users/jwoolfenden/code/sato/.sato/locals.tf\n1:56PM INF Created /Users/jwoolfenden/code/sato/.sato/azurerm_storage_account.sato0.tf\n1:56PM INF Created /Users/jwoolfenden/code/sato/.sato/azurerm_public_ip.sato1.tf\n1:56PM INF Created /Users/jwoolfenden/code/sato/.sato/azurerm_network_security_group.sato2.tf\n1:56PM INF Created /Users/jwoolfenden/code/sato/.sato/azurerm_virtual_network.sato3.tf\n1:56PM INF Created /Users/jwoolfenden/code/sato/.sato/azurerm_network_interface.sato4.tf\n1:56PM INF Created /Users/jwoolfenden/code/sato/.sato/azurerm_virtual_machine.sato5.tf\n1:56PM INF Created /Users/jwoolfenden/code/sato/.sato/azurerm_virtual_machine_extension.sato6.tf\n1:56PM INF Created /Users/jwoolfenden/code/sato/.sato/outputs.tf\n1:56PM INF Created /Users/jwoolfenden/code/sato/.sato/data.tf\n```\n\nI make an opinionated translation, in Terraform there are no parameters, resources and dependencies are very different,\nthere's no one for one - ARM to Terraform, so the aim is to get you close to 100%.\n\nThere needs to be a lot of work supporting resources and built-in functions/template as yet.\nIf you want to use this, let me know so, then I'll know to do so, or even better send me a PR.\n\n### Version\n\n```bash\n$sato version\n9.9.9\n```\n\n### Help\n\n```bash\n$ sato\nNAME:\nsato - Translate Cloudformation to Terraform\n\nUSAGE:\nsato [global options] command [command options] [arguments...]\n\nVERSION:\n9.9.9\n\nAUTHOR:\nJames Woolfenden \u003cjim.wolf@duck.com\u003e\n\nCOMMANDS:\nbisect      translate ARM to Terraform\nparse       translate CFN to Terraform\nsee         shows equivalent Terraform resource\nversion, v  Outputs the application version\nhelp, h     Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n--help, -h     show help\n--version, -v  print the version\n```\n\n## Extra credit - \u003csmall\u003ePike\u003c/small\u003e\n\nIf you use my other tool, Pike you can now apply that and get the policy requirements:\n\n\u003e pike scan -d .sato -o json\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"VisualEditor0\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"codebuild:BatchGetProjects\",\n        \"codebuild:CreateProject\",\n        \"codebuild:DeleteProject\",\n        \"codebuild:UpdateProject\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    },\n    {\n      \"Sid\": \"VisualEditor1\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"codepipeline:CreatePipeline\",\n        \"codepipeline:DeletePipeline\",\n        \"codepipeline:GetPipeline\",\n        \"codepipeline:ListTagsForResource\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    },\n    {\n      \"Sid\": \"VisualEditor2\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"iam:CreateRole\",\n        \"iam:DeleteRole\",\n        \"iam:DeleteRolePolicy\",\n        \"iam:GetRole\",\n        \"iam:GetRolePolicy\",\n        \"iam:ListAttachedRolePolicies\",\n        \"iam:ListInstanceProfilesForRole\",\n        \"iam:ListRolePolicies\",\n        \"iam:PassRole\",\n        \"iam:PutRolePolicy\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    },\n    {\n      \"Sid\": \"VisualEditor3\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:CreateBucket\",\n        \"s3:DeleteBucket\",\n        \"s3:GetAccelerateConfiguration\",\n        \"s3:GetBucketAcl\",\n        \"s3:GetBucketCORS\",\n        \"s3:GetBucketLogging\",\n        \"s3:GetBucketObjectLockConfiguration\",\n        \"s3:GetBucketPolicy\",\n        \"s3:GetBucketRequestPayment\",\n        \"s3:GetBucketTagging\",\n        \"s3:GetBucketVersioning\",\n        \"s3:GetBucketWebsite\",\n        \"s3:GetEncryptionConfiguration\",\n        \"s3:GetLifecycleConfiguration\",\n        \"s3:GetObject\",\n        \"s3:GetObjectAcl\",\n        \"s3:GetReplicationConfiguration\",\n        \"s3:ListBucket\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    }\n  ]\n}\n\n```\n\n## Valid CloudFormation\n\nDitch it all, OK, but some older samples can play fast and lose with the CloudFormation schema and data types.\nThe Go-formation parser is less accommodating, you may need to be stricter on your typing.\n\n- Booleans are true or false and not \"false\"\n- Ints are 1,2,3 not \"1\", \"2\", \"3\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJamesWoolfenden%2Fsato","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJamesWoolfenden%2Fsato","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJamesWoolfenden%2Fsato/lists"}