{"id":15176643,"url":"https://github.com/ionos-cloud/terraform-provider-ionoscloud","last_synced_at":"2025-04-07T15:09:00.945Z","repository":{"id":37800315,"uuid":"319271388","full_name":"ionos-cloud/terraform-provider-ionoscloud","owner":"ionos-cloud","description":"The IonosCloud Terraform provider gives the ability to deploy and configure resources using the IonosCloud APIs.","archived":false,"fork":false,"pushed_at":"2024-10-29T09:39:06.000Z","size":164172,"stargazers_count":35,"open_issues_count":22,"forks_count":23,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-29T11:42:09.857Z","etag":null,"topics":["terraform","terraform-provider"],"latest_commit_sha":null,"homepage":"","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/ionos-cloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-07T09:41:29.000Z","updated_at":"2024-10-28T14:03:30.000Z","dependencies_parsed_at":"2023-09-23T03:49:35.768Z","dependency_job_id":"fd651bc5-b0d4-4224-ae64-7dec08621492","html_url":"https://github.com/ionos-cloud/terraform-provider-ionoscloud","commit_stats":{"total_commits":669,"total_committers":34,"mean_commits":"19.676470588235293","dds":0.8295964125560538,"last_synced_commit":"e56c0bf8dd9974734d918f41657bbba40902c76f"},"previous_names":[],"tags_count":132,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionos-cloud%2Fterraform-provider-ionoscloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionos-cloud%2Fterraform-provider-ionoscloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionos-cloud%2Fterraform-provider-ionoscloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionos-cloud%2Fterraform-provider-ionoscloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ionos-cloud","download_url":"https://codeload.github.com/ionos-cloud/terraform-provider-ionoscloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675597,"owners_count":20977376,"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":["terraform","terraform-provider"],"created_at":"2024-09-27T13:22:54.821Z","updated_at":"2025-04-07T15:09:00.926Z","avatar_url":"https://github.com/ionos-cloud.png","language":"Go","funding_links":[],"categories":["\u003ca name=\"Go\"\u003e\u003c/a\u003eGo"],"sub_categories":[],"readme":"\n[![Gitter](https://img.shields.io/gitter/room/ionos-cloud/sdk-general)](https://gitter.im/ionos-cloud/sdk-general)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=terraform-provider\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=terraform-provider)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=terraform-provider\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=terraform-provider)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=terraform-provider\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=terraform-provider)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=terraform-provider\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=terraform-provider)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=terraform-provider\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=terraform-provider)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=terraform-provider\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=terraform-provider)\n[![Release](https://img.shields.io/github/v/release/ionos-cloud/terraform-provider-ionoscloud.svg)](https://github.com/ionos-cloud/terraform-provider-ionoscloud/releases/latest)\n[![Release Date](https://img.shields.io/github/release-date/ionos-cloud/terraform-provider-ionoscloud.svg)](https://github.com/ionos-cloud/terraform-provider-ionoscloud/releases/latest)\n[![Compute-engine test run](https://github.com/ionos-cloud/terraform-provider-ionoscloud/actions/workflows/compute-test-run.yml/badge.svg)](https://github.com/ionos-cloud/terraform-provider-ionoscloud/actions/workflows/compute-test-run.yml)\n[![Go](https://img.shields.io/github/go-mod/go-version/ionos-cloud/terraform-provider-ionoscloud.svg)](https://github.com/ionos-cloud/terraform-provider-ionoscloud)\n\n![Alt text](.github/IONOS.CLOUD.BLU.svg?raw=true \"Title\")\n\n# IONOS Cloud Terraform Provider\n\nThe IonosCloud provider gives the ability to deploy and configure resources using the IonosCloud APIs.\n\n---\n\n## Requirements\n\n- [Terraform](https://www.terraform.io/downloads.html) 0.12.x+\n\n**NOTE:** In order to use a specific version of this provider, please include the following block at the beginning of your terraform config files [details](https://www.terraform.io/docs/configuration/terraform.html#specifying-a-required-terraform-version):\n\n```terraform\nprovider \"ionoscloud\" {\n  version = \"\u003e= 6.4.10\"\n}\n```\n\n\n## Using the provider\n\nThe provider needs to be configured with proper credentials before it can be used.\n\nYou can use token authentication. We strongly suggest to use token authentication for security reasons. Details on how to generate your token [here](https://github.com/ionos-cloud/sdk-go#token-authentication):\n\n```bash\nexport IONOS_TOKEN=\"token\"\n```\n\nOr you can set the environment variables for HTTP basic authentication:\n\n```bash\nexport IONOS_USERNAME=\"username\"\nexport IONOS_PASSWORD=\"password\"\n```\n\nFor managing IONOS Object Storage resources you need to set the following environment variables with your credentials\n```bash\nexport IONOS_S3_ACCESS_KEY=\"accesskey\"\nexport IONOS_S3_SECRET_KEY=\"secretkey\"\n```\n\n\nAnother way of configuring it is by providing your credentials/api_url in a `.tf` configuration file in the `provider` block as shown in the below example.\n\n```hcl\nprovider \"ionoscloud\" {\ntoken             = var.ionos_token\n# we suggest to use token authentication\n# username          = var.ionos_username\n# password          = var.ionos_password\n#  optional, to be used only for reseller accounts\n#  contract_number = \"contract_number_here\"\n#  optional, does not need to be configured in most cases\n#  endpoint = \"custom_cloud_api_url\"\n#  s3_access_key     =  \u003cyour_access_key\u003e\n#  s3_secret_key     =  \u003cyour_secret_key\u003e\n#  s3_region     =  \u003cyour_bucket_region\u003e\n}\n```\n\n⚠️ **Note:** It's NOT usually necessary to set `endpoint` field. The SDKs the terraform uses know how to route requests to the correct endpoints in the API. \n\nYou can either explicitly write them in the .tf file or use var.name as in the example above. For setting the var.name, environment variables can be used. The environment variables must be in the format TF_VAR_name and this will be checked last for a value. For example:\n\n```bash\nexport TF_VAR_ionos_token=\"token\"\nexport TF_VAR_ionos_username=\"username\"\nexport TF_VAR_ionos_password=\"password\"\nexport TF_VAR_ionos_s3_access_key=\"accesskey\"\nexport TF_VAR_ionos_s3_secret_key=\"secretkey\"\nexport TF_VAR_ionos_s3_region=\"eu-central-3\" # optional\n```\n\nSee the [IonosCloud Provider documentation](https://registry.terraform.io/providers/ionos-cloud/ionoscloud/latest/docs) for more details.\n\n## Environment Variables\n\n| Environment Variable    | Description                                                                                                                                                              |\n|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `IONOS_USERNAME`        | Specify the username used to login, to authenticate against the IONOS Cloud API                                                                                          |\n| `IONOS_PASSWORD`        | Specify the password used to login, to authenticate against the IONOS Cloud API                                                                                          |\n| `IONOS_TOKEN`           | Specify the token used to login, if a token is being used instead of username and password                                                                               |\n| `IONOS_API_URL`         | Specify the API URL. It will overwrite the API endpoint default value `api.ionos.com`. It is not necessary to override this value unless you have special routing config |\n| `IONOS_LOG_LEVEL`       | Specify the Log Level used to log messages. Possible values: Off, Debug, Trace                                                                                           |\n| `IONOS_PINNED_CERT`     | Specify the SHA-256 public fingerprint here, enables certificate pinning                                                                                                 |\n| `IONOS_CONTRACT_NUMBER` | Specify the contract number on which you wish to provision. Only valid for reseller accounts, for other types of accounts the header will be ignored                     |\n| `IONOS_S3_ACCESS_KEY`   | Specify the access key used to authenticate against the IONOS Object Storage API                                                                                         |\n| `IONOS_S3_SECRET_KEY`   | Specify the secret key used to authenticate against the IONOS Object Storage API                                                                                         |\n| `IONOS_S3_REGION`       | Region for IONOS Object Storage operations. Default value: eu-central-3. **If you use IONOS_API_URL_OBJECT_STORAGE, `IONOS_S3_REGION` is mandatory**                     |\n\n\n## Certificate pinning:\n\nYou can enable certificate pinning if you want to bypass the normal certificate checking procedure, by doing the following:\n\nSet env variable IONOS_PINNED_CERT=`\u003cinsert_sha256_public_fingerprint_here\u003e`\n\nYou can get the sha256 fingerprint most easily from the browser by inspecting the certificate.\n\n## Debugging\n\nIn the default mode, the Terraform provider returns only HTTP client errors. These usually consist only of the HTTP status code. There is no clear description of the problem. But if you want to see the API call error messages as well, you need to set the SDK and Terraform provider environment variables.\n\nYou can enable logging now using the `IONOS_LOG_LEVEL` env variable. Allowed values: `off`, `debug` and `trace`. Defaults to `off`.\n\n⚠️ **Note:** We recommend you only use `trace` level for debugging purposes. Disable it in your production environments because it can log sensitive data. It logs the full request and response without encryption, even for an HTTPS call.\nVerbose request and response logging can also significantly impact your application’s performance.\n\n```bash\n$ export IONOS_LOG_LEVEL=debug\n```\n\n⚠️ **Note:** `IONOS_DEBUG` is now deprecated and will be removed in a future release.\n\n⚠️ **Note:** We recommend you only use `IONOS_DEBUG` for debugging purposes. Disable it in your production environments because it can log sensitive data. It logs the full request and response without encryption, even for an HTTPS call.\nVerbose request and response logging can also significantly impact your application’s performance.\n\n```bash\n$ export TF_LOG=debug\n$ export IONOS_DEBUG=true\n$ terraform apply\n```\nnow you can see the response body incl. api error message:\n```json\n{\n  \"httpStatus\" : 422,\n  \"messages\" : [ {\n    \"errorCode\" : \"200\",\n    \"message\" : \"[VDC-yy-xxxx] Operation cannot be executed since this Kubernetes Nodepool is already marked for deletion. Current state of the resource is FAILED_DESTROYING.\"\n  }]\n}\n```\n\n## Building The Provider\n\n  **NOTE:**: Building the provider is only necessary if you want to contribute to the provider. It is not a prerequisite for using it.\n\n  ### Requirements:\n\n    - [Go](https://golang.org/doc/install) 1.20 (to build the provider plugin)\n\n  Clone repository to: `$GOPATH/src/github.com/ionos-cloud/terraform-provider-ionoscloud`\n\n  ```sh\n  $ mkdir -p $GOPATH/src/github.com/ionos-cloud; cd $GOPATH/src/github.com/ionos-cloud\n  $ git clone https://github.com/ionos-cloud/terraform-provider-ionoscloud.git\n  ```\n\n  Enter the provider directory and build the provider\n\n  ```sh\n  $ cd $GOPATH/src/github.com/ionos-cloud/terraform-provider-ionoscloud\n  $ make build\n  ```\n\n  ## Developing the Provider\n\n  If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.18+ is _required_). You'll also need to correctly set up a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.\n\n  To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.\n\n  ```sh\n  $ make build\n  ...\n  $ $GOPATH/bin/terraform-provider-ionoscloud\n  ...\n  ```\n\n  ## Testing the Provider\n\n  ### What Are We Testing?\n\n  The purpose of our acceptance tests is to **provision** resources containing all the available arguments, followed by **updates** on all arguments that allow this action. Beside the provisioning part, **data-sources** with all possible arguments and **imports** are also tested.\n\n  All tests are integrated into [github actions](https://github.com/ionos-cloud/terraform-provider-ionoscloud/actions) that run daily and are also run manually before any release.\n\n  ### How to Run Tests Locally\n\n  ⚠️ **Warning:** Acceptance tests provision resources in the IONOS Cloud, and often may involve extra billing charges on your account.\n\n  In order to test the provider, you can simply run:\n\n  ``` sh\n  $ make test\n  ```\n\n  In order to run the full suite of Acceptance tests, run:\n\n  ``` sh\n  $ make testacc TAGS=all\n  ```\n\n  #### Test Tags\n\n  Tests can also be run for a batch of resources or for a single resource, using tags.\n\n  _Example of running server and lan tests:_\n  ``` sh\n  $ make testacc TAGS=server,lan\n  ```\n\n  \u003cdetails\u003e \u003csummary title=\"Click to toggle\"\u003eSee more details about \u003cb\u003etest tags\u003c/b\u003e\u003c/summary\u003e\n\n    **Build tags** are named as follows:\n\n    - `compute` - all **compute engine** tests (datacenter, firewall rule, image, IP block, IP failover, lan, location, nic, cross connect, server, snapshot, template, volume)\n    - `nlb` - **network load balancer** and **network load balancer forwarding rule** tests\n    - `natgateway` - **NAT gateway** and **NAT gateway rule** tests\n    - `k8s` - **k8s cluster** and **k8s node pool** tests\n    - `dbaas` - **DBaaS postgres cluster** tests\n    - `alb` - **Application Load Balancer** tests\n\n    ``` sh\n    $ make testacc TAGS=dbaas\n    ```\n\n    You can also test one single resource, using one of the tags: `backup`, `datacenter`, `dbaas`, `firewall`, `group`, `image`, `ipblock`, `ipfailover`, `k8s`, `lan`, `location`, `natgateway`,\n    `nlb`, `nic`, `pcc`, `resource`, `s3key`, `server`, `share`, `snapshot`, `template`, `user`, `volume`\n\n  \u003c/details\u003e\n\n  ## Migrating from the ProfitBricks provider\n\n  Please see the [Documentation](docs/index.md#migrating-from-the-profitbricks-provider) on how to migrate from the ProfitBricks provider.\n\n  ## Frequently Asked Questions\n\n  ### How can I find out the IP for the added NIC on a K8s nodepool?\n  Please check out this [module](https://github.com/ionos-cloud/terraform-ionoscloud-kube-lan-ip).\n  \n  ### For more complex examples on how to use the provider\n  Please check out the [examples](examples/) directory.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionos-cloud%2Fterraform-provider-ionoscloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fionos-cloud%2Fterraform-provider-ionoscloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionos-cloud%2Fterraform-provider-ionoscloud/lists"}