{"id":28744280,"url":"https://github.com/priyanshujain/infrasync","last_synced_at":"2025-06-16T11:39:21.524Z","repository":{"id":292637501,"uuid":"954741769","full_name":"priyanshujain/infrasync","owner":"priyanshujain","description":"InfraSync is a tool for converting existing cloud infrastructure to Terraform code and maintaining synchronization between Infrastructure-as-Code and actual cloud resources.","archived":false,"fork":false,"pushed_at":"2025-05-11T08:40:07.000Z","size":3183,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-11T09:27:51.982Z","etag":null,"topics":["aws","google-cloud-platform","infragpt","infrastructure-as-code","terraform","wip"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/priyanshujain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-03-25T14:47:57.000Z","updated_at":"2025-05-11T08:47:18.000Z","dependencies_parsed_at":"2025-05-11T09:28:24.006Z","dependency_job_id":"174e74a4-db52-4909-a98e-6ccf1f642f29","html_url":"https://github.com/priyanshujain/infrasync","commit_stats":null,"previous_names":["priyanshujain/infrasync"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/priyanshujain/infrasync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyanshujain%2Finfrasync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyanshujain%2Finfrasync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyanshujain%2Finfrasync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyanshujain%2Finfrasync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/priyanshujain","download_url":"https://codeload.github.com/priyanshujain/infrasync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyanshujain%2Finfrasync/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260151983,"owners_count":22966609,"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","google-cloud-platform","infragpt","infrastructure-as-code","terraform","wip"],"created_at":"2025-06-16T11:39:19.366Z","updated_at":"2025-06-16T11:39:21.508Z","avatar_url":"https://github.com/priyanshujain.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# InfraSync\n\nInfraSync is a tool for converting existing cloud infrastructure to Terraform code and maintaining synchronization between Infrastructure-as-Code and actual cloud resources.\n\n## Features\n\n- Initialize new IaC repositories\n- Import existing GCP resources\n- Generate Terraform import blocks and resource definitions\n- Detect drift between cloud state and Terraform state\n- Create PRs with changes when drift is detected\n\n## Structure Approach\n- Separated imports and resources into different directories:\n  ```\n  project/\n  ├── resources/\n  │   └── [provider]/\n  │       └── [project]/\n  │           └── [service]/\n  │               └── resource.tf\n  ├── main.tf\n  ├── variables.tf\n  ├── providers.tf\n  └── outputs.tf\n  ```\n\n## Supported Providers\n\n- Google Cloud Platform (GCP)\n  - PubSub (Topics, Subscriptions, IAM bindings)\n  - CloudSQL (Instances, Databases, Users)\n  - Storage (Buckets, IAM bindings)\n  - More services coming soon!\n\n## Usage\n\n### As a CLI Tool\n\n#### Initialize a new IaC repository\n\n```bash\ninfrasync init\n```\n\nThis creates a new repository with:\n- Basic Terraform configuration\n- GCS backend configuration\n- GitHub Actions workflow for drift detection\n- Git repository initialization (optional)\n\n#### Import existing resources\n\n```bash\ninfrasync import\n```\n\nThis discovers existing resources and generates:\n- Import blocks for Terraform\n- Directory structure for resources\n- Provider configurations\n\n### As a Go Package\n\nInfraSync can also be used as a Go package in your own applications:\n\n```go\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/priyanshujain/infrasync/internal/config\"\n\t\"github.com/priyanshujain/infrasync/pkg/infrasync\"\n)\n\nfunc main() {\n\t// Load configuration\n\tcfg, err := config.Load()\n\tif err != nil {\n\t\tlog.Fatalf(\"Error loading config: %v\", err)\n\t}\n\n\t// Create a new client\n\tclient := infrasync.NewClient(cfg)\n\n\t// Initialize a project\n\tctx := context.Background()\n\tif err := client.Initialize(ctx); err != nil {\n\t\tlog.Fatalf(\"Error initializing project: %v\", err)\n\t}\n\n\t// Import all configured resources\n\tif err := client.Import(ctx); err != nil {\n\t\tlog.Fatalf(\"Error importing resources: %v\", err)\n\t}\n\n\t// Or import specific services\n\tif err := client.ImportPubSub(ctx); err != nil {\n\t\tlog.Fatalf(\"Error importing PubSub resources: %v\", err)\n\t}\n\n\t// Import a specific resource\n\t// Note: Currently imports all resources of the specified service\n\t// Future updates will support importing individual resources\n\tif err := client.ImportSingleResource(ctx, \"storage\", \"google_storage_bucket\", \"my-bucket\"); err != nil {\n\t\tlog.Fatalf(\"Error importing specific bucket: %v\", err)\n\t}\n}\n```\n\nSee the `examples/` directory for more detailed usage examples.\n\n## GitHub Actions Integration\n\nInfraSync includes GitHub Actions workflow templates for:\n- Automated drift detection\n- PR creation when changes are detected\n- Seamless integration with existing CI/CD pipelines\n\n## Development\n\n```bash\n# Build\nmake build\n\n# Install\ngo install\n\n# Test\nmake test\n\n# Run locally\nmake run\n```\n\n## Roadmap\n1. Support for additional GCP services\n2. Support for other cloud providers (AWS, Azure)\n3. Comprehensive drift detection and reconciliation\n4. Enhanced resource templating and customization","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpriyanshujain%2Finfrasync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpriyanshujain%2Finfrasync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpriyanshujain%2Finfrasync/lists"}