{"id":17532756,"url":"https://github.com/cdklabs/cdk-import","last_synced_at":"2026-03-02T20:02:39.477Z","repository":{"id":37022315,"uuid":"385289969","full_name":"cdklabs/cdk-import","owner":"cdklabs","description":"Generates CDK level 1 constructs for public CloudFormation Registry types and modules","archived":false,"fork":false,"pushed_at":"2026-01-26T22:07:17.000Z","size":6054,"stargazers_count":57,"open_issues_count":5,"forks_count":13,"subscribers_count":13,"default_branch":"main","last_synced_at":"2026-01-27T09:34:40.333Z","etag":null,"topics":["aws","awscdk","cdk","cloudformation","constructs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/cdklabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-07-12T15:13:31.000Z","updated_at":"2026-01-26T22:07:20.000Z","dependencies_parsed_at":"2024-01-14T01:38:32.720Z","dependency_job_id":"93ab311f-eef2-4b85-b1c4-bf80774fe7b1","html_url":"https://github.com/cdklabs/cdk-import","commit_stats":null,"previous_names":[],"tags_count":1071,"template":false,"template_full_name":"amazon-archives/__template_Apache-2.0","purl":"pkg:github/cdklabs/cdk-import","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fcdk-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fcdk-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fcdk-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fcdk-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdklabs","download_url":"https://codeload.github.com/cdklabs/cdk-import/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fcdk-import/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29279470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T19:05:41.198Z","status":"ssl_error","status_checked_at":"2026-02-09T19:05:37.449Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["aws","awscdk","cdk","cloudformation","constructs"],"created_at":"2024-10-20T18:01:40.838Z","updated_at":"2026-02-09T20:12:53.816Z","avatar_url":"https://github.com/cdklabs.png","language":"TypeScript","funding_links":[],"categories":["aws"],"sub_categories":[],"readme":"# cdk-import\n\nGenerates CDK constructs from external sources such as public CloudFormation Registry types and\nmodules (L1s) as well as AWS Service Catalog product versions.\n\n\u003e **IMPORTANT** The AWS CDK CLI has feature called [`cdk import`](https://github.com/aws/aws-cdk/blob/master/packages/aws-cdk/README.md#cdk-import), which can be used to import (\"adopt\")\n\u003e existing resources into CloudFormation control, so that they can be mutated by CDK updates later.\n\u003e *The naming collission is unfortunate, but this repository has nothing to do with that feature*. For more information on the feature to import existing AWS resources into CDK/CloudFormation stacks, see the [CLI documentation on `cdk import`](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk/README.md#cdk-import).\n\n## Installation\n\n```shell\nnpm install -g cdk-import\n```\n\n## Usage\n\nThere are currently two sources that resources can be generated from. The subcommand\n`cfn` is used to import from CloudFormation Registry,\n`sc` is used to import AWS Service Catalog products.\nThere are shared general options for output directories and target language.\nYou will need `AWS_REGION` variable configured in your environment.\n\n```shell\nUsage:\n  cdk-import SUBCOMMAND (cfn or sc) [parameters]\n\nGeneral Options:\n  -l, --language     Output programming language                               [string]\n  -o, --outdir       Output directory                                          [string]\n  --go-module        Go module name (required if language is \"golang\")         [string]\n  --java-package     Java package name (required if language is \"java\")        [string]\n  --csharp-namespace C# namespace (optional if language is \"csharp\",           [string]\n                     defaults to resource name.)\n  -h, --help         Show usage info (include subcommand to see specific help) [boolean]\n```\n\n## CloudFormation Registry Usage\n\n```shell\nUsage:\n  cdk-import cfn -l LANGUAGE RESOURCE-NAME[@VERSION]\n\nOptions:\n  -l, --language     Output programming language                        [string]\n  -o, --outdir       Output directory                                   [string]  [default: \".\"]\n  -s, --schema-file  Read schema from a file (instead of CFN registry)  [string]\n  --go-module        Module name (required if language is \"golang\")     [string]\n  --java-package     Java package name (required if language is \"java\") [string]\n  --csharp-namespace C# namespace (optional if language is \"csharp\",    [string]\n                     defaults to resource name.)\n  -h, --help         Show this usage info                               [boolean]\n```\n\nThe `--language` option specifies the output programming language. Supported\nlanguages: `typescript`, `java`, `python`, `csharp` and `golang`.\n\nOutput will be generated relative to `--outdir` which defaults to the current\nworking directory.\n\nBy default, the resource schema will be read from the AWS CloudFormation Registry,\nusing the current AWS credentials (configured using environment variables). If\nyou have a copy of the JSON schema that describes the resource properties\nin a local file, you can pass `--schema-file` to specify the file. This will\nbypass the query to the CloudFormation Registry. It expects the exact same\n`Schema` contents as returned by `DescribeType`.\n\nThe following section describes language-specific behavior.\n\n### Java\n\nThe `--java-package` option is required and should include the Java package name\nto use for generated classes. Normally, this will be a sub-package of your\nproject's package.\n\nJava source files are generates in Maven-compatible structure under\n`$outdir/src/main/java/PACKAGE/` where `PACKAGE` is based on `--java-package`.\n\nFor example:\n\n```shell\ncdk-import -l java --java-package com.foo.bar.resources AWSQS::EKS::Cluster\n```\n\nWill generate class source files under `src/main/java/com/foo/bar/resources`.\nAll the classes will be under the package `com.foo.bar.resources`.\n\n### Python\n\nA Python submodule is generated under `$outdir/MODULE_NAME/` where `MODULE_NAME`\nis based on the name of the resource (`AWSQS::EKS::Cluster` =\u003e\n`awsqs_eks_cluster`).\n\nFor example:\n\n```shell\ncdk-import -l python AWSQS::EKS::Cluster\n```\n\nWill generate a subdirectory `awsqs_eks_cluster` with a Python module that can\nbe `import`ed.\n\n### CSharp\n\nA `.csproj` is generated under `$outdir/RESOURCE/` where `RESOURCE` is the\nresource name (`AWSQS::EKS::Cluster`).\n\nFor example:\n\n```shell\ncdk-import -l csharp AWSQS::EKS::Cluster\n```\n\nWill generate a directory `AWSQS::EKS::Cluster` with a `.csproj`. This can be\nused in a .NET solution.\n\n### TypeScript\n\nA TypeScript file will be generated under `$outdir/MODULE` where `MODULE` is\nderived from the resource name.\n\nFor example:\n\n```shell\ncdk-import -l typescript -o src AWSQS::EKS::Cluster\n```\n\nWill generate a file `src/awsqs-eks-cluster.ts` (note the usage of `-o` above).\n\n### Go\n\nIf `-l golang` is used, the `--go-module` option is required and must reflect\nthe Go module name of the parent project module.\n\nA Go submodule will be generated under `$outdir/PACKAGE` where `PACKAGE` is\nderived from the resource name (`AWSQS::EKS::Cluster` =\u003e `awsqs-eks-cluster`).\n\nFor example:\n\n```shell\ncdk-import -l golang --go-module \"github.com/foo/bar\" AWSQS::EKS::Cluster\n```\n\nWill generate a Go module under: `awsqs-eks-cluster`.\n\n## Examples\n\nGenerates constructs for the latest version AWSQS::EKS::Cluster in TypeScript:\n\n```shell\ncdk-import cfn -l typescript AWSQS::EKS::Cluster\n```\n\nGenerates construct in Go for a specific resource version:\n\n```shell\ncdk-import cfn -l golang --go-module \"github.com/account/repo\" AWSQS::EKS::Cluster@1.2.0\n```\n\nGenerates construct in Python under the \"src\" subfolder instead of working\ndirectory:\n\n```shell\ncdk-import cfn -l python -o src AWSQS::EKS::Cluster\n```\n\nGenerates construct in Java and identifies the resource type by its ARN:\n\n```shell\ncdk-import cfn -l java --java-package \"com.acme.myproject\" arn:aws:cloudformation:...\n```\n\nModules are also supported:\n\n```shell\ncdk-import cfn AWSQS::CheckPoint::CloudGuardQS::MODULE\n```\n\n## AWS Service Catalog Usage\n\nThe cdk-import tool generates a user friendly version of a provisioned product that becomes\na normal cdk construct that you can use within a cdk app.\nYou can currently either specify a specific product version or generate all available products.\nThe tool will call APIs and attempt to resolve default artifact and launch path for a product,\nif a singular product version or launch path cannot be resolved, it will throw an error.\nYou will need Service Catalog end-user read permissions to call these APIs.\n\n```shell\nUsage:\n  cdk-import sc -l LANGUAGE\n  cdk-import sc -l LANGUAGE --product-id PRODUCT-ID --provisioning-artifact-id PROVISIONING-ARTIFACT-ID --path-id LAUNCH-PATH-ID\n\nOptions:\n  -l, --language                 Output programming language                          [string]\n  -o, --outdir                   Output directory (default \"./sc-products\")           [string]\n  --product-id                   Product Id                                           [string]\n  --provisioning-artifact-id     Provisioning artifact Id                             [string]\n  --path-id                      Launch path Id                                       [string]\n  --go-module                    Module name (required if language is \"golang\")       [string]\n  --java-package                 Java package name (required if language is \"java\")   [string]\n  --csharp-namespace             C# namespace (optional if language is \"csharp\",      [string]\n                                 defaults to resource name.)\n  -h, --help                     Show this usage info                                 [boolean]\n```\n\nThe `--language` option specifies the output programming language. Supported\nlanguages: `typescript`, `java`, `python`, `csharp` and `golang`.\n\nIf you are using `csharp`, you must specify a `--csharp-namespace` within your project.\n\nOutput will be generated relative to `--outdir` which defaults to the current\nworking directory under `./sc-products`.\n\n## Examples\n\nGenerates constructs in python for the latest product versions as importable modules in your local workspace.\n\n```shell\ncdk-import sc -l python -o .\n```\n\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md)\n\n## Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more\ninformation.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdklabs%2Fcdk-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdklabs%2Fcdk-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdklabs%2Fcdk-import/lists"}