{"id":20127166,"url":"https://github.com/cloudamqp/terraform-provider-cloudamqp","last_synced_at":"2026-02-25T10:11:54.374Z","repository":{"id":37493405,"uuid":"137849188","full_name":"cloudamqp/terraform-provider-cloudamqp","owner":"cloudamqp","description":"Terraform Provider for CloudAMQP","archived":false,"fork":false,"pushed_at":"2025-03-27T16:32:27.000Z","size":29436,"stargazers_count":36,"open_issues_count":18,"forks_count":38,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-03-27T17:37:59.933Z","etag":null,"topics":["cloudamqp","rabbitmq","terraform"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/providers/cloudamqp/cloudamqp","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/cloudamqp.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-19T06:25:55.000Z","updated_at":"2025-03-26T07:45:09.000Z","dependencies_parsed_at":"2024-03-15T13:50:13.387Z","dependency_job_id":"46d88ad6-5e2b-4d41-a6f5-e5c5821079be","html_url":"https://github.com/cloudamqp/terraform-provider-cloudamqp","commit_stats":null,"previous_names":["cloudamqp/terraform-provider"],"tags_count":77,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudamqp%2Fterraform-provider-cloudamqp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudamqp%2Fterraform-provider-cloudamqp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudamqp%2Fterraform-provider-cloudamqp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudamqp%2Fterraform-provider-cloudamqp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudamqp","download_url":"https://codeload.github.com/cloudamqp/terraform-provider-cloudamqp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543589,"owners_count":20955865,"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":["cloudamqp","rabbitmq","terraform"],"created_at":"2024-11-13T20:19:32.193Z","updated_at":"2025-12-11T18:36:02.875Z","avatar_url":"https://github.com/cloudamqp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform provider for CloudAMQP\n\nSetup your CloudAMQP cluster from Terraform\n\n## Getting Started (As a Terraform User)\n\n### Prerequisites\n\nGolang, make, Terraform\n\n## Setup prerequisites and CloudAMQP account\n\n* Install golang: https://golang.org/dl/\n  Example with default paths\n  * Download latest version and extract to `/usr/local/go`\n  * Set environmental variable `export GOROOT=/usr/local/go`\n  * Set environmental variable `export GOPATH=$HOME/go`\n  * Set environmental variable `export PATH=$GOROOT/bin:$GOPATH:$GOPATH/bin:$PATH`\n  * Activate module mode `export GO111MODULE=on` (Very important!)\n* Install make\n  * `sudo apt install make`\n* Install terraform: https://learn.hashicorp.com/terraform/getting-started/install.html\n  * Download the latest version and extract to /usr/local/terraform\n  * Set environmental variable `export PATH=/usr/local/terraform:$PATH`\n\n* Create a CloudAMQP account if you haven't already:\n  * Go to https://www.cloudamqp.com/\n  * Click \"Sign Up\"\n  * Sign in\n  * Go to API access (https://customer.cloudamqp.com/apikeys) and create a key. (note that this is the API key for one of the two APIs CloudAMQP supports.)\n\n`\nThe two APIs supported can be found at https://docs.cloudamqp.com (called customer) and https://docs.cloudamqp.com/instance-api.html (called api). The API key created gain access to the customer API (used to handle the instance). While the second API handles different resources on the instace (such as alarms, notification etc.). The customer API also has a proxy service, which makes it possible for the provider to access the second API through customer API using the same created API key.\n`\n\n## Install the CloudAMQP Terraform Provider\n\n### From Terraform Registry\n\nThe CloudAMQP provider is available from the registry at https://registry.terraform.io/providers/cloudamqp/cloudamqp\n\nIf you are using Terraform 0.13+:\n\n```yaml\nterraform {\n  required_providers {\n    cloudamqp = {\n      source = \"cloudamqp/cloudamqp\"\n    }\n  }\n}\n```\n\nRead more at https://www.terraform.io/docs/language/providers/requirements.html\n\n### From source\n\nClone repository to `/home/USER/code/cloudamqp/terraform-provider-cloudamqp`\n\nChange directory and build the provider binary using `go build`.\n\nSetup [.terraformrc](https://developer.hashicorp.com/terraform/cli/config/config-file) so that terraform will use the binary that we just build instead of the one from the registry\n\n```\nprovider_installation {\n  dev_overrides {\n    \"hashicorp/cloudamqp\" = \"/home/USER/code/cloudamqp/terraform-provider-cloudamqp\"\n  }\n  direct {}\n}\n```\nmake sure the path points to where you checked out the code.\n\nWhen using `dev_overrides` there is no need to a `terraform init` since you already have the provider locally. \nYou should also not have the `terraform ... required_provders` block in your `.tf` file \n\nWhen this is setup you can just run `plan` or `apply` and terraform will use your locally compiled binary as provider. \n\n*To change the provider now you can just update the code and hit `go build` and then rerun your terraform command.*\n\nMore detailed documentation of the provider can be found at: https://docs.cloudamqp.com/terraform.html\n\n### Example Usage: Deploying a First CloudAMQP RMQ server\n\n(See the examples.tf file in the repo.  It has a bunny VPC example and a simple lemur example.)\n\n```sh\ncd $GOPATH/src/github.com/cloudamqp/terraform-provider-cloudamqp  #This is the root of the repo where examples.tf lives.\nterraform plan\n```\n\nWhen prompted paste in your CloudAMQP API key (created above).\n\nThis will give you output on stdout that tells you what would have been created:\n\n* rmq_lemur\n\nNext run\n\n```sh\nterraform apply\n```\n\nAgain, paste in your API key.  This should create an actual CloudAMQP instance.\n\n\n## Debug log\n\nIf more information needed, it's possible to increase Terraform log level. Using *DEBUG* will enable both CloudAMQP and underlying go-api debug logging.\n\nTo enable Terraform debug logging.\n`export TF_LOG=DEBUG`\n\n## Resources\n\nResource documentation can be found [here](https://docs.cloudamqp.com/terraform.html)\n\n### Instance ###\n\n**IMPORTANT - PLAN CHANGES BETWEEN SHARED AND DEDICATED**\n`\nIt’s possible to change between shared and dedicated plans (or vice versa). This will however force a destruction of the old instance, before creating a new one. All data will be lost and a new hostname will be created with corresponding DNS record.\n`\n\n## Import\n\nImport existing infrastructure into state and bring the resource under Terraform management. Information about the resource will be added to the terraform.state file. Then add manually the given information to the .tf file. Once this is done, run terraform plan to see that the resource is under Terraform management. From here it's possible to add more resources such as alarm.\n\nYou'll need to determine the `resource_id` and other identifiers for the items you intend to import. You can do this using the CloudAMQP API, which is documented here https://docs.cloudamqp.com/index.html#tag/instances. Use a token found on this page https://customer.cloudamqp.com/apikeys.\n\n### Instance:\n\nImport cloudamqp instance and bring it under Terraform management. First declare an empty instance resource in the .tf file. Followed by running the terraform import command\n\n```sh\nresource \"cloudamqp_instance\" \"rmq_url\" {}\n```\n\nGeneric form of terraform import command\n\n```sh\nterraform import {resource_type}.{resource_name} {resource_id}\n```\n\nExample of terraform import command (with resource_id=80)\n\n```sh\nterraform import cloudamqp_instance.rmq_url 80\n```\n\n### Resources depending on an instance:\n\nAll resources depending on the instance resource also needs the instance id when using terraform import, in order to make correct API calls. Resource id and instance id is seperated with \",\".\n\nResource affected by this is:\n\n* cloudamqp_notification\n* cloudamqp_alarm\n\nFirst declare two empty notification and alarm resources in the .tf file. Followed by running the terraform import command.\n\n```sh\nresource \"cloudamqp_notification\".\"recipient_01\" {}\nresource \"cloudamqp_alarm\".\"alarm_01\" {}\n```\n\nGeneric form of terraform import command\n\n```sh\nterraform import {resource_type}.{resource_name} {resource_id},{instance_id}\n```\n\nYou can find `{instance_id}` through [the API](https://docs.cloudamqp.com/index.html#tag/instances/get/instances)\n\nExample of terraform import command (with instance_id=80)\n\n```sh\nterraform import cloudamqp_notification.recipient_01 10,80\nterraform import cloudamqp_alarm.alarm_01 65,80\n```\n\n## AWS VPC Setup\n\nSupport for setting up VPC peering connection between AWS instance and CloudAMQP. Requires that the AWS instance is used as the requester and CloudAMQP used as an accepter. More detailed description can be found here: [setup](https://docs.cloudamqp.com/cloudamqp_terraform.html#aws-vpc-setup)\n\nTogether with at full example found under *sample/aws_vpc*.\n\n## Testing\n\nThe provider can be tested with Terraform Acceptance Test together with [Go-VCR](https://github.com/dnaeon/go-vcr) package. When using the Go-VCR package\nall HTTP interactions to the API backend can be recorded or replayed and used while testing the provider.\n\nRecord:\n\n```sh\nCLOUDAMQP_RECORD=1 TF_ACC=1 dotenv -f .env go test ./cloudamqp/ -v -run {TestName}  -timeout 30m\n```\n\nReplay single test:\n\n```sh\nTF_ACC=1 go test ./cloudamqp/ -v -run {TestName}\n```\n\nReplay all tests:\n\n```sh\nTF_ACC=1 go test ./cloudamqp/ -v\n```\n\nDefault timeout is 10 min when running the test, this can be changed with -timeout flag. \nIf the test is cached, use -count 1 to force it to run.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudamqp%2Fterraform-provider-cloudamqp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudamqp%2Fterraform-provider-cloudamqp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudamqp%2Fterraform-provider-cloudamqp/lists"}