{"id":20700771,"url":"https://github.com/l2fprod/ibmcloud-cdktf-getting-started","last_synced_at":"2025-03-11T03:53:12.767Z","repository":{"id":136481849,"uuid":"532002017","full_name":"l2fprod/ibmcloud-cdktf-getting-started","owner":"l2fprod","description":"Getting started with CDK for Terraform and IBM Cloud","archived":false,"fork":false,"pushed_at":"2022-09-02T16:45:08.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-17T19:41:30.391Z","etag":null,"topics":["cdktf","ibm-cloud","terraform"],"latest_commit_sha":null,"homepage":"","language":"Python","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/l2fprod.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}},"created_at":"2022-09-02T16:31:54.000Z","updated_at":"2024-10-06T15:36:20.000Z","dependencies_parsed_at":"2023-05-06T10:30:38.919Z","dependency_job_id":null,"html_url":"https://github.com/l2fprod/ibmcloud-cdktf-getting-started","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2fprod%2Fibmcloud-cdktf-getting-started","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2fprod%2Fibmcloud-cdktf-getting-started/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2fprod%2Fibmcloud-cdktf-getting-started/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2fprod%2Fibmcloud-cdktf-getting-started/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/l2fprod","download_url":"https://codeload.github.com/l2fprod/ibmcloud-cdktf-getting-started/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242967741,"owners_count":20214281,"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":["cdktf","ibm-cloud","terraform"],"created_at":"2024-11-17T00:37:06.180Z","updated_at":"2025-03-11T03:53:12.759Z","avatar_url":"https://github.com/l2fprod.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Getting started with Hashicorp CDK for Terraform and IBM Cloud\n\nA simple example showing integration of the [IBM Cloud provider for Terraform](https://github.com/IBM-Cloud/terraform-provider-ibm) with [Hashicorp CDK for Terraform](https://www.terraform.io/cdktf).\n\n## Prerequisites\n\nFor CDK for Terraform, you will need:\n* Node.js and npm v16+.\n* Terraform CLI (1.1+).\n\nFor the project, you will need:\n* Python v3.7\n* pipenv v2021.5.29 with `pip install --user pipenv`\n\n## Install CDK for Terraform\n\n1. Install CDK for Terraform\n   ```\n   npm install --global cdktf-cli@latest\n   ```\n1. Verify installation\n   ```\n   cdktf help\n   ```\n\n## Understand the code organization and the stack to be deployed\n\nThe stack to be deployed is made of:\n* one input variable `basename` -- a prefix to name the resources that will be created.\n* one resource group that will be named after this variable.\n* one output variable containing the id of the resource group that was created.\n\nThe code for this stack is found in [main.py](./main.py). It was initialized with the command `cdktf init --template=python --local`.\n\nThe IBM Cloud provider was added with the command `cdktf provider add \"IBM-Cloud/ibm@~\u003e 1.44\"`. This command modified the [CDK configuration file (cdktf.json)](./cdktf.json). \n\n## Deploy the stack\n\n1. Retrieve the IBM Cloud provider and generate **python** constructs in the output directory `imports`:\n\n   ```sh\n   cdftk get\n   ```\n\n1. Set the environment variable `IBMCLOUD_API_KEY`\n\n   ```sh\n   export IBMCLOUD_API_KEY=...\n   ```\n\n1. Optionally set a prefix to name the resources that will be created. The example has a default value `cdktf-gs`.\n\n   ```sh\n   export TF_VAR_basename=uniqueprefix\n   ```\n\n1. Deploy the stack\n\n   ```sh\n   cdktf deploy\n   ```\n\n   Notice the `group_id` in the list of outputs.\n\n## Destroy the stack\n\n1. Destroy the stack\n\n   ```sh\n   cdktf destroy\n   ```\n\n## License\n\nSee [LICENSE](LICENSE) for license information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl2fprod%2Fibmcloud-cdktf-getting-started","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl2fprod%2Fibmcloud-cdktf-getting-started","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl2fprod%2Fibmcloud-cdktf-getting-started/lists"}