{"id":35361472,"url":"https://github.com/lex00/cloudformation-schema-go","last_synced_at":"2026-01-13T19:16:02.387Z","repository":{"id":331385574,"uuid":"1126425589","full_name":"lex00/cloudformation-schema-go","owner":"lex00","description":"Go types for CloudFormation specifications, intrinsic functions, and template parsing","archived":false,"fork":false,"pushed_at":"2026-01-05T23:11:15.000Z","size":1930,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-07T08:57:19.689Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lex00.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-01T22:15:40.000Z","updated_at":"2026-01-05T23:07:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lex00/cloudformation-schema-go","commit_stats":null,"previous_names":["lex00/cloudformation-schema-go"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/lex00/cloudformation-schema-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lex00%2Fcloudformation-schema-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lex00%2Fcloudformation-schema-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lex00%2Fcloudformation-schema-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lex00%2Fcloudformation-schema-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lex00","download_url":"https://codeload.github.com/lex00/cloudformation-schema-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lex00%2Fcloudformation-schema-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28397826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-02T00:25:00.068Z","updated_at":"2026-01-13T19:16:02.382Z","avatar_url":"https://github.com/lex00.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cloudformation-schema-go\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/lex00/cloudformation-schema-go.svg)](https://pkg.go.dev/github.com/lex00/cloudformation-schema-go)\n[![CI](https://github.com/lex00/cloudformation-schema-go/actions/workflows/ci.yml/badge.svg)](https://github.com/lex00/cloudformation-schema-go/actions/workflows/ci.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/lex00/cloudformation-schema-go)](https://goreportcard.com/report/github.com/lex00/cloudformation-schema-go)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nGo types for CloudFormation specifications, intrinsic functions, template parsing, enum validation, and code generation utilities.\n\nShared foundation for:\n- [wetwire-aws](https://github.com/lex00/wetwire-aws) - Declarative IaC in Go\n- [cfn-lint-go](https://github.com/lex00/cfn-lint-go) - CloudFormation linter in Go\n\n## Packages\n\n### spec/\n\nCloudFormation Resource Specification types and fetching.\n\n```go\nimport (\n    \"time\"\n    \"github.com/lex00/cloudformation-schema-go/spec\"\n)\n\n// Download and cache the CF spec (use nil for defaults)\ncfSpec, err := spec.FetchSpec(nil)\n\n// Or with custom options\ncfSpec, err := spec.FetchSpec(\u0026spec.FetchOptions{\n    CacheDir: \"/custom/cache\",\n    MaxAge:   24 * time.Hour,  // Re-download if cache older than 24h\n})\n\n// Look up resource types\nbucket := cfSpec.GetResourceType(\"AWS::S3::Bucket\")\nrequired := bucket.GetRequiredProperties()\n```\n\n### intrinsics/\n\nCloudFormation intrinsic functions with JSON marshaling.\n\n```go\nimport \"github.com/lex00/cloudformation-schema-go/intrinsics\"\n\n// Intrinsic functions\nref := intrinsics.Ref{LogicalName: \"MyBucket\"}\ngetAtt := intrinsics.GetAtt{LogicalName: \"MyRole\", Attribute: \"Arn\"}\nsub := intrinsics.Sub{String: \"${AWS::Region}-bucket\"}\n\n// Pseudo-parameters\nregion := intrinsics.AWS_REGION\naccountID := intrinsics.AWS_ACCOUNT_ID\n```\n\n### template/\n\nParse CloudFormation YAML/JSON templates to intermediate representation.\n\n```go\nimport \"github.com/lex00/cloudformation-schema-go/template\"\n\n// Parse a template file\ntmpl, err := template.ParseTemplate(\"template.yaml\")\n\n// Access resources\nfor name, resource := range tmpl.Resources {\n    fmt.Printf(\"%s: %s\\n\", name, resource.ResourceType)\n}\n\n// Reference graph for dependency analysis\ndeps := tmpl.ReferenceGraph[\"MyFunction\"]  // [\"MyRole\", \"MyBucket\"]\n```\n\n### enums/\n\nEnum constants and validation, generated from aws-sdk-go-v2.\n\n```go\nimport \"github.com/lex00/cloudformation-schema-go/enums\"\n\n// Use constants for IDE autocomplete\nruntime := enums.LambdaRuntimePython312\n\n// Validate enum values\nallowed := enums.GetAllowedValues(\"lambda\", \"Runtime\")\nvalid := enums.IsValidValue(\"lambda\", \"Runtime\", \"python3.12\")\n\n// List all services with enums\nservices := enums.Services()  // [\"accessanalyzer\", \"acm\", ...]\n\n// List all enum names for a service\nenumNames := enums.GetEnumNames(\"lambda\")  // [\"Architecture\", \"Runtime\", ...]\n```\n\n### codegen/\n\nUtilities for code generation: case conversion, identifier sanitization, and topological sorting.\n\n```go\nimport \"github.com/lex00/cloudformation-schema-go/codegen\"\n\n// Case conversion\ncodegen.ToSnakeCase(\"BucketName\")     // \"bucket_name\"\ncodegen.ToPascalCase(\"bucket_name\")   // \"BucketName\"\n\n// Go keyword handling\ncodegen.IsGoKeyword(\"type\")           // true\ncodegen.IsGoKeyword(\"bucket\")         // false\n\n// Identifier sanitization (ensures valid Go identifiers)\ncodegen.SanitizeGoIdentifier(\"123start\")   // \"_123start\"\ncodegen.SanitizeGoIdentifier(\"with-dash\")  // \"withdash\"\ncodegen.SanitizeGoIdentifier(\"type\")       // \"type_\"\n\n// Topological sort for dependency ordering\nnodes := []string{\"A\", \"B\", \"C\"}\ndeps := map[string][]string{\"A\": {\"B\"}, \"B\": {\"C\"}, \"C\": {}}\nsorted := codegen.TopologicalSort(nodes, func(n string) []string {\n    return deps[n]\n})\n// Result: [\"C\", \"B\", \"A\"] (dependencies first)\n```\n\n## Installation\n\n```bash\ngo get github.com/lex00/cloudformation-schema-go\n```\n\n## Regenerating Enums\n\nEnum constants are generated from aws-sdk-go-v2:\n\n```bash\ngo generate ./enums/...\n```\n\n## License\n\nApache 2.0 - See [LICENSE](LICENSE) and [NOTICE](NOTICE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flex00%2Fcloudformation-schema-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flex00%2Fcloudformation-schema-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flex00%2Fcloudformation-schema-go/lists"}