{"id":20593265,"url":"https://github.com/rschmied/terraform-provider-cml2","last_synced_at":"2025-04-14T22:56:12.762Z","repository":{"id":60932394,"uuid":"490251969","full_name":"rschmied/terraform-provider-cml2","owner":"rschmied","description":"(moved to DevNet) A Terraform provider for Cisco Modeling Labs (CML) 2","archived":false,"fork":false,"pushed_at":"2023-07-05T21:31:23.000Z","size":16282,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T22:56:07.567Z","etag":null,"topics":["automation","cisco","network-simulation","networking","simulation","terraform","terraform-provider"],"latest_commit_sha":null,"homepage":"https://github.com/CiscoDevNet/terraform-provider-cml2","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rschmied.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-09T11:21:54.000Z","updated_at":"2023-03-15T09:57:50.000Z","dependencies_parsed_at":"2023-01-20T13:46:42.935Z","dependency_job_id":null,"html_url":"https://github.com/rschmied/terraform-provider-cml2","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rschmied%2Fterraform-provider-cml2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rschmied%2Fterraform-provider-cml2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rschmied%2Fterraform-provider-cml2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rschmied%2Fterraform-provider-cml2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rschmied","download_url":"https://codeload.github.com/rschmied/terraform-provider-cml2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975330,"owners_count":21192208,"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":["automation","cisco","network-simulation","networking","simulation","terraform","terraform-provider"],"created_at":"2024-11-16T07:47:51.926Z","updated_at":"2025-04-14T22:56:12.742Z","avatar_url":"https://github.com/rschmied.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Provider for Cisco CML2\n\n[![CodeQL](https://github.com/rschmied/terraform-provider-cml2/actions/workflows/codeql-analysis.yml/badge.svg?branch=dev)](https://github.com/rschmied/terraform-provider-cml2/actions/workflows/codeql-analysis.yml)\n\n_This template repository is built on the [Terraform Plugin Framework](https://github.com/hashicorp/terraform-plugin-framework). The template repository built on the [Terraform Plugin SDK](https://github.com/hashicorp/terraform-plugin-sdk) can be found at [terraform-provider-scaffolding](https://github.com/hashicorp/terraform-provider-scaffolding). See [Which SDK Should I Use?](https://www.terraform.io/docs/plugin/which-sdk.html) in the Terraform documentation for additional information._\n\nThis repository implements a [Terraform](https://www.terraform.io) provider for Cisco Modeling Labs version 2.3 and later. It's current state is \"work-in-progress\".  The current implementation provides:\n\n- A resource and a data source (`internal/provider/`),\n  - resource `cml2_lab` to create, update and destroy a lab based on a YAML topology file\n  - update allows to modify state, e.g. from STOPPED to STARTED, ...\n  - data source `cml2_lab_details` to retrieve operational state from a running lab.\n- Examples (`examples/`) and generated documentation (`docs/`),\n- Miscellaneous meta files.\n\nNote:  The examples and docs as well as the tests are pretty much identical to\n  the files found in the original templates...  See the [TODO.md](TODO.md) file!\n\n## Requirements\n\n- [Terraform](https://www.terraform.io/downloads.html) \u003e= 1.0\n- [Go](https://golang.org/doc/install) \u003e= 1.17\n- [CML2](https://cisco.com/go/cml) \u003e= 2.3.0\n\n## Building The Provider\n\n1. Clone the repository\n1. Enter the repository directory\n1. Build the provider using the Go `install` command:\n\n```shell\ngo install\n```\n\n## Using the provider\n\n### Environment\n\nThe provider is using environment variables for configuration.  Heres an example:\n\n```shell\n# for testing purposes, suggest to use direnv\n\n# this is used by the cmlclient test command, ctest, not needed for the provider\n# CML_LABID=\"ba35782a-06ee-4234-9de4-473ffe3c09e8\"\n\nCML_HOST=\"https://cml-controller.cml.lab\"\nCML_TOKEN=\" valid-cmd-jwt \"\nCML_USERNAME=\"\"\nCML_PASSWORD=\"\"\nTF_VAR_token=$CML_TOKEN\n\nexport CML_HOST CML_USERNAME CML_PASSWORD TF_VAR_token\n```\n\n### HCL\n\n\u003e _NOTE:_ this is mostly outdated... Need to update!!\n\nHere's a simple example that shows how to use the provider. It will import a\nlab as defined in `topology.yml`, then start it and wait for it to converge\n(e.g. all nodes report that they are BOOTED).  Then it will read the lab data\nvia `cml2_lab_details` using the ID from the import and print out the lab\ndetails.  Only nodes with an IP address are considered for output (`only_with_ip = true`).\n\n[![asciicast](https://asciinema.org/a/PfYfD1Br3QtytmR76kbGL1pva.svg)](https://asciinema.org/a/PfYfD1Br3QtytmR76kbGL1pva)\n\n```hcl\nterraform {\n  required_providers {\n    cml2 = {\n      version = \"0.1.0-alpha\"\n      source  = \"registry.terraform.io/ciscodevnet/cml2\"\n    }\n}\n\nvariable \"address\" {\n  description = \"CML controller address\"\n  type        = string\n  default     = \"https://192.168.122.245\"\n}\n\nvariable \"token\" {\n  description = \"CML API token\"\n  type        = string\n}\n\nvariable \"toponame\" {\n  description = \"topology name\"\n  type        = string\n  default     = \"absolute bananas\"\n}\n\nprovider \"cml2\" {\n  address = var.address\n  token   = var.token\n  # token       = null\n  skip_verify = true\n}\n\nresource \"cml2_lab\" \"bananas\" {\n  topology = templatefile(\"topology.yaml\", { toponame = var.toponame })\n  # start    = false\n  # wait     = false\n  # state    = \"STARTED\"\n}\n\ndata \"cml2_lab_details\" \"example\" {\n  id = cml2_lab.bananas.id\n  only_with_ip = true\n}\n\noutput \"bla\" {\n  value = data.cml2_lab_details.example\n}\n```\n\nExample `.terraformrc`:\n\n```hcl\nprovider_installation {\n\n  # dev_overrides {\n  #   \"hashicorp/cml2\" = \"/home/rschmied/Projects/terraform-provider-cml2\"\n  # }\n\n  # For all other providers, install them directly from their origin provider\n  # registries as normal. If you omit this, Terraform will _only_ use\n  # the dev_overrides block, and so no other providers will be available.\n  # direct {}\n  filesystem_mirror {\n    path = \"/tmp/terraform\"\n    include = [ \"registry.terraform.io/ciscodevnet/*\" ]\n  }\n}\n```\n\nSample filesystem mirror layout:\n\n```plain\n/tmp/terraform/\n└── registry.terraform.io\n    └── ciscodevnet\n        └── cml2\n            ├── terraform-provider-cml2_0.1.0-alpha_darwin_amd64.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_darwin_arm64.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_freebsd_386.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_freebsd_amd64.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_freebsd_arm64.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_freebsd_arm.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_linux_386.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_linux_amd64.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_linux_arm64.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_linux_arm.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_windows_386.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_windows_amd64.zip\n            ├── terraform-provider-cml2_0.1.0-alpha_windows_arm64.zip\n            └── terraform-provider-cml2_0.1.0-alpha_windows_arm.zip\n\n3 directories, 14 files\n```\n\n## Developing the Provider\n\nIf you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (see [Requirements](#requirements) above).\n\nTo compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.\n\nTo generate or update documentation, run `go generate`.\n\nIn order to run the full suite of Acceptance tests, run `make testacc`.\n\n_Note:_ Acceptance tests create real resources, and often cost money to run.\n\n```shell\nmake testacc\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frschmied%2Fterraform-provider-cml2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frschmied%2Fterraform-provider-cml2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frschmied%2Fterraform-provider-cml2/lists"}