From f3d81e842fb8bb1807efdc8f9681fe372f0ec214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Brod=C3=A9n?= Date: Tue, 18 Apr 2023 09:47:56 +0200 Subject: [PATCH 01/11] Customdiff to validate plan/region when changed --- cloudamqp/resource_cloudamqp_instance.go | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/cloudamqp/resource_cloudamqp_instance.go b/cloudamqp/resource_cloudamqp_instance.go index b728e55d..d28e67c3 100644 --- a/cloudamqp/resource_cloudamqp_instance.go +++ b/cloudamqp/resource_cloudamqp_instance.go @@ -27,10 +27,9 @@ func resourceInstance() *schema.Resource { Description: "Name of the instance", }, "plan": { - Type: schema.TypeString, - Required: true, - Description: "Name of the plan, see documentation for valid plans", - ValidateFunc: validatePlanName(), + Type: schema.TypeString, + Required: true, + Description: "Name of the plan, see documentation for valid plans", }, "region": { Type: schema.TypeString, @@ -129,6 +128,20 @@ func resourceInstance() *schema.Resource { newPlanType, _ := getPlanType(new.(string)) return !(oldPlanType == newPlanType) }), + customdiff.ValidateChange("plan", func(old, new, meta interface{}) error { + if old == new { + return nil + } + api := meta.(*api.API) + return api.ValidatePlan(new.(string)) + }), + customdiff.ValidateChange("region", func(old, new, meta interface{}) error { + if old == new { + return nil + } + api := meta.(*api.API) + return api.ValidateRegion(new.(string)) + }), ), } } From d73cf26b80c8cd3f11715002ec34cf3b04d37dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Brod=C3=A9n?= Date: Thu, 20 Apr 2023 14:37:25 +0200 Subject: [PATCH 02/11] Use backend validation to fetch plan types --- cloudamqp/resource_cloudamqp_instance.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudamqp/resource_cloudamqp_instance.go b/cloudamqp/resource_cloudamqp_instance.go index d28e67c3..6b89e8d3 100644 --- a/cloudamqp/resource_cloudamqp_instance.go +++ b/cloudamqp/resource_cloudamqp_instance.go @@ -124,8 +124,8 @@ func resourceInstance() *schema.Resource { CustomizeDiff: customdiff.All( customdiff.ForceNewIfChange("plan", func(old, new, meta interface{}) bool { // Recreate instance if changing plan type (from dedicated to shared or vice versa) - oldPlanType, _ := getPlanType(old.(string)) - newPlanType, _ := getPlanType(new.(string)) + api := meta.(*api.API) + oldPlanType, newPlanType := api.PlanTypes(old.(string), new.(string)) return !(oldPlanType == newPlanType) }), customdiff.ValidateChange("plan", func(old, new, meta interface{}) error { From e2807e51e919a40535082a9b31d255721f922169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Brod=C3=A9n?= Date: Thu, 20 Apr 2023 14:42:46 +0200 Subject: [PATCH 03/11] Add new computed attribute 'backend' = [lavinmq, rabbitmq] --- cloudamqp/data_source_cloudamqp_instance.go | 5 +++++ cloudamqp/resource_cloudamqp_instance.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/cloudamqp/data_source_cloudamqp_instance.go b/cloudamqp/data_source_cloudamqp_instance.go index 05edfa45..90134a47 100644 --- a/cloudamqp/data_source_cloudamqp_instance.go +++ b/cloudamqp/data_source_cloudamqp_instance.go @@ -105,6 +105,11 @@ func dataSourceInstance() *schema.Resource { Computed: true, Description: "If default alarms set or not for the instance", }, + "backend": { + Type: schema.TypeString, + Computed: true, + Description: "Software backend used, determined by subscription plan", + }, }, } } diff --git a/cloudamqp/resource_cloudamqp_instance.go b/cloudamqp/resource_cloudamqp_instance.go index 6b89e8d3..ee8f8f31 100644 --- a/cloudamqp/resource_cloudamqp_instance.go +++ b/cloudamqp/resource_cloudamqp_instance.go @@ -120,6 +120,11 @@ func resourceInstance() *schema.Resource { Default: false, Description: "Keep associated VPC when deleting instance", }, + "backend": { + Type: schema.TypeString, + Computed: true, + Description: "Software backend used, determined by subscription plan", + }, }, CustomizeDiff: customdiff.All( customdiff.ForceNewIfChange("plan", func(old, new, meta interface{}) bool { From 69a2ffaafd87f4dc10d12b7db935f8d468f787ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Brod=C3=A9n?= Date: Thu, 20 Apr 2023 14:48:02 +0200 Subject: [PATCH 04/11] Update number of nodes handling --- cloudamqp/data_source_cloudamqp_instance.go | 8 ------ cloudamqp/resource_cloudamqp_instance.go | 32 +++++---------------- 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/cloudamqp/data_source_cloudamqp_instance.go b/cloudamqp/data_source_cloudamqp_instance.go index 90134a47..856da30d 100644 --- a/cloudamqp/data_source_cloudamqp_instance.go +++ b/cloudamqp/data_source_cloudamqp_instance.go @@ -128,14 +128,6 @@ func dataSourceInstanceRead(d *schema.ResourceData, meta interface{}) error { if k == "vpc" { err = d.Set("vpc_id", v.(map[string]interface{})["id"]) err = d.Set("vpc_subnet", v.(map[string]interface{})["subnet"]) - } else if k == "nodes" { - plan := d.Get("plan").(string) - if is2020Plan(plan) { - nodes := numberOfNodes(plan) - err = d.Set(k, nodes) - } else { - err = d.Set(k, v) - } } else { err = d.Set(k, v) } diff --git a/cloudamqp/resource_cloudamqp_instance.go b/cloudamqp/resource_cloudamqp_instance.go index ee8f8f31..f89c3f0b 100644 --- a/cloudamqp/resource_cloudamqp_instance.go +++ b/cloudamqp/resource_cloudamqp_instance.go @@ -165,23 +165,18 @@ func resourceCreate(d *schema.ResourceData, meta interface{}) error { params[k] = false } - if k == "nodes" { + // Remove keys from params + switch k { + case "nodes": plan := d.Get("plan").(string) - if is2020Plan(plan) { - nodes := numberOfNodes(plan) - params[k] = nodes - } else if isSharedPlan(plan) { + if isSharedPlan(plan) || !isLegacyPlan(plan) { delete(params, k) } - } - - if k == "vpc_id" { + case "vpc_id": if d.Get(k).(int) == 0 { delete(params, k) } - } - - if k == "vpc_subnet" { + case "vpc_subnet": if d.Get(k) == "" { delete(params, k) } @@ -209,16 +204,6 @@ func resourceRead(d *schema.ResourceData, meta interface{}) error { if validateInstanceSchemaAttribute(k) { if k == "vpc" { err = d.Set("vpc_id", v.(map[string]interface{})["id"]) - } else if k == "nodes" { - plan := d.Get("plan").(string) - if is2020Plan(plan) { - nodes := numberOfNodes(plan) - err = d.Set(k, nodes) - } else if isSharedPlan(plan) { - continue - } else { - err = d.Set(k, v) - } } else { err = d.Set(k, v) } @@ -264,10 +249,7 @@ func resourceUpdate(d *schema.ResourceData, meta interface{}) error { } if k == "nodes" { plan := d.Get("plan").(string) - if is2020Plan(plan) { - nodes := numberOfNodes(plan) - params[k] = nodes - } else if isSharedPlan(plan) { + if isSharedPlan(plan) || !isLegacyPlan(plan) { delete(params, k) } } From af02e5dcfb6401afb74cdcdbcf796ce22e2abbc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Brod=C3=A9n?= Date: Thu, 20 Apr 2023 14:49:32 +0200 Subject: [PATCH 05/11] Set shared/dedicated based on number of nodes --- cloudamqp/data_source_cloudamqp_instance.go | 12 ++++++------ cloudamqp/resource_cloudamqp_instance.go | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cloudamqp/data_source_cloudamqp_instance.go b/cloudamqp/data_source_cloudamqp_instance.go index 856da30d..515257bf 100644 --- a/cloudamqp/data_source_cloudamqp_instance.go +++ b/cloudamqp/data_source_cloudamqp_instance.go @@ -138,6 +138,12 @@ func dataSourceInstanceRead(d *schema.ResourceData, meta interface{}) error { } } + if v, ok := d.Get("nodes").(int); ok && v > 0 { + d.Set("dedicated", true) + } else { + d.Set("dedicated", false) + } + if err = d.Set("host", data["hostname_external"].(string)); err != nil { return fmt.Errorf("error setting host for resource %s: %s", d.Id(), err) } @@ -150,12 +156,6 @@ func dataSourceInstanceRead(d *schema.ResourceData, meta interface{}) error { d.Set("no_default_alarms", false) } - planType, _ := getPlanType(d.Get("plan").(string)) - dedicated := planType == "dedicated" - if err = d.Set("dedicated", dedicated); err != nil { - return fmt.Errorf("error setting dedicated for resource %s: %s", d.Id(), err) - } - data = api.UrlInformation(data["url"].(string)) for k, v := range data { if validateInstanceSchemaAttribute(k) { diff --git a/cloudamqp/resource_cloudamqp_instance.go b/cloudamqp/resource_cloudamqp_instance.go index f89c3f0b..19f843c8 100644 --- a/cloudamqp/resource_cloudamqp_instance.go +++ b/cloudamqp/resource_cloudamqp_instance.go @@ -214,6 +214,12 @@ func resourceRead(d *schema.ResourceData, meta interface{}) error { } } + if v, ok := d.Get("nodes").(int); ok && v > 0 { + d.Set("dedicated", true) + } else { + d.Set("dedicated", false) + } + if err = d.Set("host", data["hostname_external"].(string)); err != nil { return fmt.Errorf("error setting host for resource %s: %s", d.Id(), err) } @@ -222,12 +228,6 @@ func resourceRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error setting host for resource %s: %s", d.Id(), err) } - planType, _ := getPlanType(d.Get("plan").(string)) - dedicated := planType == "dedicated" - if err = d.Set("dedicated", dedicated); err != nil { - return fmt.Errorf("error setting dedicated for resource %s: %s", d.Id(), err) - } - data = api.UrlInformation(data["url"].(string)) for k, v := range data { if validateInstanceSchemaAttribute(k) { From 35595e871c045b6ae55da30966ce049aaafa71dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Brod=C3=A9n?= Date: Thu, 20 Apr 2023 14:49:55 +0200 Subject: [PATCH 06/11] Clean up --- cloudamqp/resource_cloudamqp_instance.go | 65 +++--------------------- 1 file changed, 6 insertions(+), 59 deletions(-) diff --git a/cloudamqp/resource_cloudamqp_instance.go b/cloudamqp/resource_cloudamqp_instance.go index 19f843c8..f8a696a9 100644 --- a/cloudamqp/resource_cloudamqp_instance.go +++ b/cloudamqp/resource_cloudamqp_instance.go @@ -2,13 +2,10 @@ package cloudamqp import ( "fmt" - "regexp" - "strconv" "github.com/84codes/go-api/api" "github.com/hashicorp/terraform-plugin-sdk/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) func resourceInstance() *schema.Resource { @@ -280,84 +277,34 @@ func validateInstanceSchemaAttribute(key string) bool { "tags", "vhost", "no_default_alarms", - "ready": + "ready", + "backend": return true } return false } -func getPlanType(plan string) (string, error) { - switch plan { - case "lemur", "tiger", "lemming": - return "shared", nil - // Legacy plans - case "bunny", "rabbit", "panda", "ape", "hippo", "lion", - // 2020 plans - "squirrel-1", - "hare-1", "hare-3", - "bunny-1", "bunny-3", - "rabbit-1", "rabbit-3", "rabbit-5", - "panda-1", "panda-3", "panda-5", - "ape-1", "ape-3", "ape-5", - "hippo-1", "hippo-3", "hippo-5", - "lion-1", "lion-3", "lion-5", - "rhino-1": - return "dedicated", nil - } - return "", fmt.Errorf("couldn't find a matching plan type for: %s", plan) -} - -func validatePlanName() schema.SchemaValidateFunc { - return validation.StringInSlice([]string{ - "lemur", "tiger", "lemming", - "bunny", "rabbit", "panda", "ape", "hippo", "lion", - "squirrel-1", - "hare-1", "hare-3", - "bunny-1", "bunny-3", - "rabbit-1", "rabbit-3", "rabbit-5", - "panda-1", "panda-3", "panda-5", - "ape-1", "ape-3", "ape-5", - "hippo-1", "hippo-3", "hippo-5", - "lion-1", "lion-3", "lion-5", - "rhino-1", - }, true) -} - func isSharedPlan(plan string) bool { switch plan { case "lemur", "tiger", - "lemming": + "lemming", + "ermine": return true } return false } -func is2020Plan(plan string) bool { +func isLegacyPlan(plan string) bool { switch plan { case - "squirrel-1", - "hare-1", "hare-3", - "bunny-1", "bunny-3", - "rabbit-1", "rabbit-3", "rabbit-5", - "panda-1", "panda-3", "panda-5", - "ape-1", "ape-3", "ape-5", - "hippo-1", "hippo-3", "hippo-5", - "lion-1", "lion-3", "lion-5", - "rhino-1": + "bunny", "rabbit", "panda", "ape", "hippo", "lion": return true } return false } -func numberOfNodes(plan string) int { - r := regexp.MustCompile("[135]") - match := r.FindString(plan) - nodes, _ := strconv.Atoi(match) - return nodes -} - func instanceCreateAttributeKeys() []string { return []string{ "name", From da12c1e68fed8e3a11ea5d7932911c091b082dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Brod=C3=A9n?= Date: Thu, 20 Apr 2023 16:11:17 +0200 Subject: [PATCH 07/11] Update docs --- docs/data-sources/instance.md | 2 + docs/guides/info_plan.md | 38 ++++++++++++++++- docs/guides/info_region.md | 7 ++++ docs/resources/instance.md | 52 +++++++++++++----------- docs/resources/plugin.md | 2 +- docs/resources/plugin_community.md | 2 +- docs/resources/rabbitmq_configuration.md | 2 +- docs/resources/security_firewall.md | 10 ++++- docs/resources/upgrade_rabbitmq.md | 2 +- 9 files changed, 86 insertions(+), 31 deletions(-) diff --git a/docs/data-sources/instance.md b/docs/data-sources/instance.md index ecf8c8e0..03526495 100644 --- a/docs/data-sources/instance.md +++ b/docs/data-sources/instance.md @@ -39,3 +39,5 @@ All attributes reference are computed * `host` - The external hostname for the CloudAMQP instance. * `host_internal` - The internal hostname for the CloudAMQP instance. * `vhost` - The virtual host configured in Rabbit MQ. +* `dedicated` - Information if the CloudAMQP instance is shared or dedicated. +* `backend` - Information if the CloudAMQP instance runs either RabbitMQ or LavinMQ. diff --git a/docs/guides/info_plan.md b/docs/guides/info_plan.md index dc9416c6..4050a860 100644 --- a/docs/guides/info_plan.md +++ b/docs/guides/info_plan.md @@ -8,13 +8,16 @@ description: |- # Subscription plans -Table below shows subscription plans for CloudAMQP. `Lemur`is free of charge, for full price list see [cloudamqp](https://www.cloudamqp.com/plans.html). `Lemur`and `Tiger` are shared instances and share underlying hardware with other instances. They are also limited to which CloudAMQP provider resources that can be used. Further information on availability on each resource page. +Tables below shows general subscription plans for CloudAMQP for either `RabbitMQ` or `LavinMQ`, for full price list see [cloudamqp](https://www.cloudamqp.com/plans.html). + +## Plans using RabbitMQ + +`Lemur` and `Tiger` are shared instances and share underlying hardware with other instances. They are also limited to which CloudAMQP provider resources that can be used. Further information on availability on each resource page. Name | Plan | Type | Nodes ---- | ---- | ---- | ---- Little lemur | lemur | shared Tough Tiger | tiger | shared -Lemming (Beta) | lemming | shared Sassy Squirrel | squirrel-1 | dedicated | 1 Big Bunny | bunny-1,3 | dedicated | 1,3 Roaring Rabbit | rabbit-1,3,5 | dedicated | 1,3,5 @@ -24,7 +27,38 @@ Heavy Hippo | hippo-1,3,5 | dedicated | 1,3,5 Loud Lion | lion-1,3,5 | dedicated | 1,3,5 Raging Rhino | rhino-1 | dedicated | 1 +*Information can differ from your actually valid plans, e.g. your team have been given preview access to unreleased plans. The complete list can be retrieved with your team API access key.* + +```shell +curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ + https://customer.cloudamqp.com/api/plans?backend=rabbitmq | json_pp +``` + +## Plans using LavinMQ + +`Lemming`and `Ermine` are shared instances and share underlying hardware with other instances. They are also limited to which CloudAMQP provider resources that can be used. Further information on availability on each resource page. + +Name | Plan | Type | Nodes +---- | ---- | ---- | ---- +Loyal Lemming | lemming | shared +Elegant Ermine | ermine | shared +Passionate Puffin | puffin-1 | dedicated | 1 +Playful Penguin | penguin-1 | dedicated | 1 +Lively Lynx | lynx-1 | dedicated | 1 +Wild Wolverine | wolverine-1 | dedicated | 1 +Remarkable Reindeer | reindeer-1 | dedicated | 1 +Brave Bear | bear-1 | dedicated | 1 +Outstanding Orca | orca-1 | dedicated | 1 + +*Information can differ from your actually valid plans, e.g. your team have been given preview access to unreleased plans. The complete list can be retrieved with your team API access key.* + +```shell +curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ + https://customer.cloudamqp.com/api/plans?backend=lavinmq | json_pp +``` +
+ # Legacy subscription plans Table below shows deprecated subscription plans for CloudAMQP. Existing plans will still work, but there will not be possible to create new ones. diff --git a/docs/guides/info_region.md b/docs/guides/info_region.md index e417a6a8..dc87e5e5 100644 --- a/docs/guides/info_region.md +++ b/docs/guides/info_region.md @@ -10,6 +10,13 @@ description: |- CloudAMQP support hosting by multiple cloud platform providers and over multiple regions. Below a few examples of supported platforms and regions. For fully updated list see [CloudAMQP plans](https://www.cloudamqp.com/plans.html) and scroll to the bottom and extend `List all available regions`. Platforms and regions with shared servers are also listed, for AWS we try to have at least one shared server supported for each region. +*The complete list can also be retrieved with your team API access key.* + +```shell +curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ + https://customer.cloudamqp.com/api/regions | json_pp +``` + Format used on instance regions are as follow `{provider}::{region}` ```hcl diff --git a/docs/resources/instance.md b/docs/resources/instance.md index 635d933c..35c67558 100644 --- a/docs/resources/instance.md +++ b/docs/resources/instance.md @@ -7,9 +7,9 @@ description: |- # cloudamqp_instance -This resource allows you to create and manage a CloudAMQP instance running Rabbit MQ and deploy to multiple cloud platforms provider and over multiple regions, see [Instance regions](../instance_region.html) for more information. +This resource allows you to create and manage a CloudAMQP instance running either ***RabbitMQ*** or ***LavinMQ*** and can be deployed to multiple cloud platforms provider and regions, see [Instance regions](../instance_region.html) for more information. -Once the instance is created it will be assigned a unique identifier. All other resource and data sources created for this instance needs to reference the instance identifier. +Once the instance is created it will be assigned a unique identifier. All other resources and data sources created for this instance needs to reference this unique instance identifier. Pricing is available at [cloudamqp.com](https://www.cloudamqp.com/plans.html). @@ -23,21 +23,28 @@ Pricing is available at [cloudamqp.com](https://www.cloudamqp.com/plans.html). ```hcl -# Minimum free lemur instance +# Minimum free lemur instance running RabbitMQ resource "cloudamqp_instance" "lemur_instance" { - name = "terraform-free-instance" - plan = "lemur" - region = "amazon-web-services::us-west-1" + name = "cloudamqp-free-instance" + plan = "lemur" + region = "amazon-web-services::us-west-1" + tags = ["rabbitmq"] } -# New dedicated bunny instance +# Minimum free lemming instance running LavinMQ +resource "cloudamqp_instance" "lemming_instance" { + name = "cloudamqp-free-instance" + plan = "lemming" + region = "amazon-web-services::us-west-1" + tags = ["lavinmq"] +} + +# New dedicated bunny instance running RabbitMQ resource "cloudamqp_instance" "instance" { - name = "terraform-cloudamqp-instance" - plan = "bunny-1" - region = "amazon-web-services::us-west-1" - tags = ["terraform"] - rmq_version = "3.8.3" - no_default_alarms = true + name = "terraform-cloudamqp-instance" + plan = "bunny-1" + region = "amazon-web-services::us-west-1" + tags = ["terraform"] } ``` @@ -52,10 +59,9 @@ resource "cloudamqp_instance" "instance" { ```hcl resource "cloudamqp_instance" "instance" { name = "terraform-cloudamqp-instance" - plan = "squirrel-1" + plan = "bunny-1" region = "amazon-web-services::us-west-1" tags = ["terraform"] - rmq_version = "3.9.14" vpc_subnet = "10.56.72.0/24" } ``` @@ -72,10 +78,9 @@ resource "cloudamqp_instance" "instance" { # Dedicated instance that also creates VPC resource "cloudamqp_instance" "instance_01" { name = "terraform-cloudamqp-instance-01" - plan = "squirrel-1" + plan = "bunny-1" region = "amazon-web-services::us-west-1" tags = ["terraform"] - rmq_version = "3.9.14" vpc_subnet = "10.56.72.0/24" } ``` @@ -96,10 +101,9 @@ resource "cloudamqp_vpc" "vpc" { # Add vpc_id and keep_associated_vpc attributes resource "cloudamqp_instance" "instance_01" { name = "terraform-cloudamqp-instance-01" - plan = "squirrel-1" + plan = "bunny-1" region = "amazon-web-services::us-west-1" tags = ["terraform"] - rmq_version = "3.9.14" vpc_id = cloudamqp_vpc.vpc.id keep_associated_vpc = true } @@ -125,10 +129,9 @@ resource "cloudamqp_vpc" "vpc" { # First instance added to managed VPC resource "cloudamqp_instance" "instance_01" { name = "terraform-cloudamqp-instance-01" - plan = "squirrel-1" + plan = "bunny-1" region = "amazon-web-services::us-west-1" tags = ["terraform"] - rmq_version = "3.9.14" vpc_id = cloudamqp_vpc.vpc.id keep_associated_vpc = true } @@ -136,10 +139,9 @@ resource "cloudamqp_instance" "instance_01" { # Second instance added to managed VPC resource "cloudamqp_instance" "instance_02" { name = "terraform-cloudamqp-instance-02" - plan = "squirrel-1" + plan = "bunny-1" region = "amazon-web-services::us-west-1" tags = ["terraform"] - rmq_version = "3.9.14" vpc_id = cloudamqp_vpc.vpc.id keep_associated_vpc = true } @@ -158,7 +160,7 @@ The following arguments are supported: ***Note: Changing region will force the instance to be destroyed and a new created in the new region. All data will be lost and a new name assigned.*** -* `nodes` - (Computed/Optional) Number of nodes, 1, 3 or 5 depending on plan used. +* `nodes` - (Computed/Optional) Number of nodes, 1, 3 or 5 depending on plan used. Only needed for legacy plans, will otherwise be computed. ***Deprecated: Legacy subscriptions plan can still change this to scale up or down the instance. New subscriptions plans use the plan to determine number of nodes. In order to change number of nodes the `plan` needs to be updated.*** @@ -188,6 +190,8 @@ All attributes reference are computed * `host` - The external hostname for the CloudAMQP instance. * `host_internal` - The internal hostname for the CloudAMQP instance. * `vhost` - The virtual host used by Rabbit MQ. +* `dedicated` - Information if the CloudAMQP instance is shared or dedicated. +* `backend` - Information if the CloudAMQP instance runs either RabbitMQ or LavinMQ. ## Import diff --git a/docs/resources/plugin.md b/docs/resources/plugin.md index 4b3c9dd6..94e6d051 100644 --- a/docs/resources/plugin.md +++ b/docs/resources/plugin.md @@ -9,7 +9,7 @@ description: |- This resource allows you to enable or disable Rabbit MQ plugins. -Only available for dedicated subscription plans. +Only available for dedicated subscription plans running ***RabbitMQ***. ~> CloudAMQP Terraform provider [v1.10.0](https://github.com/cloudamqp/terraform-provider-cloudamqp/releases/tag/v1.10.0) there is support for multiple retries when requesting information about plugins. This was introduced to avoid `ReadPlugin error 400: Timeout talking to backend`. diff --git a/docs/resources/plugin_community.md b/docs/resources/plugin_community.md index 7d5c3d74..b2f24bab 100644 --- a/docs/resources/plugin_community.md +++ b/docs/resources/plugin_community.md @@ -9,7 +9,7 @@ description: |- This resource allows you to install or uninstall community plugins. Once installed the plugin will be available in `cloudamqp_plugin`. -Only available for dedicated subscription plans. +Only available for dedicated subscription plans running ***RabbitMQ***. ~> CloudAMQP Terraform provider [v1.11.0](https://github.com/cloudamqp/terraform-provider-cloudamqp/releases/tag/v1.11.0) there is support for multiple retries when requesting information about community plugins. This was introduced to avoid `ReadPluginCommunity error 400: Timeout talking to backend`. diff --git a/docs/resources/rabbitmq_configuration.md b/docs/resources/rabbitmq_configuration.md index d78f851d..8d2cecc8 100644 --- a/docs/resources/rabbitmq_configuration.md +++ b/docs/resources/rabbitmq_configuration.md @@ -9,7 +9,7 @@ description: |- This resource allows you update RabbitMQ config. -Only available for dedicated subscription plans. +Only available for dedicated subscription plans running ***RabbitMQ***. ## Example Usage diff --git a/docs/resources/security_firewall.md b/docs/resources/security_firewall.md index 3aab2c09..38e3e644 100644 --- a/docs/resources/security_firewall.md +++ b/docs/resources/security_firewall.md @@ -56,7 +56,7 @@ The `rules` block consists of: * `services` - (Required) Pre-defined service ports, see table below * `description` - (Optional) Description name of the rule. e.g. Default. -Pre-defined services: +Pre-defined services for RabbitMQ: | Service name | Port | |--------------|-------| @@ -70,6 +70,14 @@ Pre-defined services: | STREAM | 5552 | | STREAM_SSL | 5551 | +Pre-defined services for LavinMQ: + +| Service name | Port | +|--------------|-------| +| AMQP | 5672 | +| AMQPS | 5671 | +| HTTPS | 443 | + ## Attributes Reference All attributes reference are computed diff --git a/docs/resources/upgrade_rabbitmq.md b/docs/resources/upgrade_rabbitmq.md index ca098fe7..11d59c2f 100644 --- a/docs/resources/upgrade_rabbitmq.md +++ b/docs/resources/upgrade_rabbitmq.md @@ -15,7 +15,7 @@ This resource allows you to automatically upgrade to latest possible upgradable > - Any custom plugins support has installed on your behalf will be disabled and you need to contact support@cloudamqp.com and ask to have them re-installed. > - TLS 1.0 and 1.1 will not be supported after the update. -Only available for dedicated subscription plans. +Only available for dedicated subscription plans running ***RabbitMQ***. ## Example Usage From 258901a987439f46357e614a5a9af76ddcaeb351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Brod=C3=A9n?= Date: Fri, 21 Apr 2023 08:30:57 +0200 Subject: [PATCH 08/11] Update curl examples --- docs/guides/info_plan.md | 17 +++++++++++------ docs/guides/info_region.md | 7 ++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/guides/info_plan.md b/docs/guides/info_plan.md index 4050a860..584c1a2d 100644 --- a/docs/guides/info_plan.md +++ b/docs/guides/info_plan.md @@ -10,6 +10,13 @@ description: |- Tables below shows general subscription plans for CloudAMQP for either `RabbitMQ` or `LavinMQ`, for full price list see [cloudamqp](https://www.cloudamqp.com/plans.html). +*Information can differ from your actually valid plans, e.g. your team have been given preview access to unreleased plans. The up to date collection of available plans can be retrieved with your team API access key.* + +```shell +curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ + https://customer.cloudamqp.com/api/plans +``` + ## Plans using RabbitMQ `Lemur` and `Tiger` are shared instances and share underlying hardware with other instances. They are also limited to which CloudAMQP provider resources that can be used. Further information on availability on each resource page. @@ -27,11 +34,10 @@ Heavy Hippo | hippo-1,3,5 | dedicated | 1,3,5 Loud Lion | lion-1,3,5 | dedicated | 1,3,5 Raging Rhino | rhino-1 | dedicated | 1 -*Information can differ from your actually valid plans, e.g. your team have been given preview access to unreleased plans. The complete list can be retrieved with your team API access key.* - ```shell +# Filter out available plans for RabbitMQ curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ - https://customer.cloudamqp.com/api/plans?backend=rabbitmq | json_pp + https://customer.cloudamqp.com/api/plans?backend=rabbitmq ``` ## Plans using LavinMQ @@ -50,11 +56,10 @@ Remarkable Reindeer | reindeer-1 | dedicated | 1 Brave Bear | bear-1 | dedicated | 1 Outstanding Orca | orca-1 | dedicated | 1 -*Information can differ from your actually valid plans, e.g. your team have been given preview access to unreleased plans. The complete list can be retrieved with your team API access key.* - ```shell +# Filter out available plans for LavinMQ curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ - https://customer.cloudamqp.com/api/plans?backend=lavinmq | json_pp + https://customer.cloudamqp.com/api/plans?backend=lavinmq ```
diff --git a/docs/guides/info_region.md b/docs/guides/info_region.md index dc87e5e5..fa965638 100644 --- a/docs/guides/info_region.md +++ b/docs/guides/info_region.md @@ -13,8 +13,13 @@ CloudAMQP support hosting by multiple cloud platform providers and over multiple *The complete list can also be retrieved with your team API access key.* ```shell +# List all supported platform providers and regions curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ - https://customer.cloudamqp.com/api/regions | json_pp + https://customer.cloudamqp.com/api/regions + +# Filter regions by platform provider +curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ + https://customer.cloudamqp.com/api/regions?provider=amazon-web-services ``` Format used on instance regions are as follow `{provider}::{region}` From e4c76416c10e40fe3dc9c0710a4ef33e72623344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Brod=C3=A9n?= Date: Fri, 21 Apr 2023 16:26:30 +0200 Subject: [PATCH 09/11] Remove curl examples and reference API-docs --- docs/guides/info_plan.md | 85 +++++++++++++++----------------------- docs/guides/info_region.md | 12 +----- 2 files changed, 35 insertions(+), 62 deletions(-) diff --git a/docs/guides/info_plan.md b/docs/guides/info_plan.md index 584c1a2d..4a88981f 100644 --- a/docs/guides/info_plan.md +++ b/docs/guides/info_plan.md @@ -10,57 +10,40 @@ description: |- Tables below shows general subscription plans for CloudAMQP for either `RabbitMQ` or `LavinMQ`, for full price list see [cloudamqp](https://www.cloudamqp.com/plans.html). -*Information can differ from your actually valid plans, e.g. your team have been given preview access to unreleased plans. The up to date collection of available plans can be retrieved with your team API access key.* - -```shell -curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ - https://customer.cloudamqp.com/api/plans -``` +*Information can differ from your actually valid plans, e.g. your team have been given preview access to unreleased plans. To retrieve an up to date list check out [cloudamqp-docs](https://docs.cloudamqp.com/#plans)* ## Plans using RabbitMQ `Lemur` and `Tiger` are shared instances and share underlying hardware with other instances. They are also limited to which CloudAMQP provider resources that can be used. Further information on availability on each resource page. -Name | Plan | Type | Nodes ----- | ---- | ---- | ---- -Little lemur | lemur | shared -Tough Tiger | tiger | shared -Sassy Squirrel | squirrel-1 | dedicated | 1 -Big Bunny | bunny-1,3 | dedicated | 1,3 -Roaring Rabbit | rabbit-1,3,5 | dedicated | 1,3,5 -Power Panda | panda-1,3,5 | dedicated | 1,3,5 -Awesome Ape | ape-1,3,5 | dedicated | 1,3,5 -Heavy Hippo | hippo-1,3,5 | dedicated | 1,3,5 -Loud Lion | lion-1,3,5 | dedicated | 1,3,5 -Raging Rhino | rhino-1 | dedicated | 1 - -```shell -# Filter out available plans for RabbitMQ -curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ - https://customer.cloudamqp.com/api/plans?backend=rabbitmq -``` +Name | Plan | Backend | Type | Nodes +---- | ---- | ---- | ---- | ---- +Little lemur | lemur | rabbitmq | shared +Tough Tiger | tiger | rabbitmq | shared +Sassy Squirrel | squirrel-1 | rabbitmq | dedicated | 1 +Big Bunny | bunny-1,3 | rabbitmq | dedicated | 1,3 +Roaring Rabbit | rabbit-1,3,5 | rabbitmq | dedicated | 1,3,5 +Power Panda | panda-1,3,5 | rabbitmq | dedicated | 1,3,5 +Awesome Ape | ape-1,3,5 | rabbitmq | dedicated | 1,3,5 +Heavy Hippo | hippo-1,3,5 | rabbitmq | dedicated | 1,3,5 +Loud Lion | lion-1,3,5 | rabbitmq | dedicated | 1,3,5 +Raging Rhino | rhino-1 | rabbitmq | dedicated | 1 ## Plans using LavinMQ `Lemming`and `Ermine` are shared instances and share underlying hardware with other instances. They are also limited to which CloudAMQP provider resources that can be used. Further information on availability on each resource page. -Name | Plan | Type | Nodes ----- | ---- | ---- | ---- -Loyal Lemming | lemming | shared -Elegant Ermine | ermine | shared -Passionate Puffin | puffin-1 | dedicated | 1 -Playful Penguin | penguin-1 | dedicated | 1 -Lively Lynx | lynx-1 | dedicated | 1 -Wild Wolverine | wolverine-1 | dedicated | 1 -Remarkable Reindeer | reindeer-1 | dedicated | 1 -Brave Bear | bear-1 | dedicated | 1 -Outstanding Orca | orca-1 | dedicated | 1 - -```shell -# Filter out available plans for LavinMQ -curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ - https://customer.cloudamqp.com/api/plans?backend=lavinmq -``` +Name | Plan | Backend | Type | Nodes +---- | ---- | ---- | ---- | ---- +Loyal Lemming | lemming | lavinmq | shared +Elegant Ermine | ermine | lavinmq | shared +Passionate Puffin | puffin-1 | lavinmq | dedicated | 1 +Playful Penguin | penguin-1 | lavinmq | dedicated | 1 +Lively Lynx | lynx-1 | lavinmq | dedicated | 1 +Wild Wolverine | wolverine-1 | lavinmq | dedicated | 1 +Remarkable Reindeer | reindeer-1 | lavinmq | dedicated | 1 +Brave Bear | bear-1 | lavinmq | dedicated | 1 +Outstanding Orca | orca-1 | lavinmq | dedicated | 1
@@ -68,13 +51,13 @@ curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ Table below shows deprecated subscription plans for CloudAMQP. Existing plans will still work, but there will not be possible to create new ones. -Name | Plan | Type ----- | ---- | ---- -Little lemur | lemur | shared -Tough Tiger | tiger | shared -Big Bunny | bunny | dedicated -Roaring Rabbit | rabbit | dedicated -Power Panda | panda | dedicated -Awesome Ape | ape | dedicated -Heavy Hippo | hippo | dedicated -Loud Lion | lion | dedicated +Name | Plan | Backend | Type +---- | ---- | ---- | ---- +Little lemur | lemur | rabbitmq | shared +Tough Tiger | tiger | rabbitmq | shared +Big Bunny | bunny | rabbitmq | dedicated +Roaring Rabbit | rabbit | rabbitmq | dedicated +Power Panda | panda | rabbitmq | dedicated +Awesome Ape | ape | rabbitmq | dedicated +Heavy Hippo | hippo | rabbitmq | dedicated +Loud Lion | lion | rabbitmq | dedicated diff --git a/docs/guides/info_region.md b/docs/guides/info_region.md index fa965638..833fd9ae 100644 --- a/docs/guides/info_region.md +++ b/docs/guides/info_region.md @@ -10,17 +10,7 @@ description: |- CloudAMQP support hosting by multiple cloud platform providers and over multiple regions. Below a few examples of supported platforms and regions. For fully updated list see [CloudAMQP plans](https://www.cloudamqp.com/plans.html) and scroll to the bottom and extend `List all available regions`. Platforms and regions with shared servers are also listed, for AWS we try to have at least one shared server supported for each region. -*The complete list can also be retrieved with your team API access key.* - -```shell -# List all supported platform providers and regions -curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ - https://customer.cloudamqp.com/api/regions - -# Filter regions by platform provider -curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ - https://customer.cloudamqp.com/api/regions?provider=amazon-web-services -``` +*To retrieve an up to date list check out [cloudamqp-docs](https://docs.cloudamqp.com/#regions)* Format used on instance regions are as follow `{provider}::{region}` From cb2dc371abe7544135005904d53b3a9d4375ee36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Brod=C3=A9n?= Date: Fri, 21 Apr 2023 17:23:26 +0200 Subject: [PATCH 10/11] Remove deprecated regions from documentation --- docs/guides/info_region.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/docs/guides/info_region.md b/docs/guides/info_region.md index 833fd9ae..e6861db7 100644 --- a/docs/guides/info_region.md +++ b/docs/guides/info_region.md @@ -21,10 +21,6 @@ amazon-web-services::us-west-1 amazon-web-services::eu-central-1 amazon-web-services::ap-east-1 -# Example of Azure regions -azure::south-central-us -azure::west-europe - # Example of Azure-arm regions azure-arm::australiacentral azure-arm::southeastasia @@ -38,16 +34,4 @@ google-compute-engine::asia-east1 # Example of Digital Ocean regions digital-ocean::nyc3 digital-ocean::sgp1 - -# Example of Rackspace regions -rackspace::iad -rackspace::ord - -# Example of Softlayer regions -softlayer::ams01 -softlayer::dal05 - -# Example of Alibaba regions -alibaba::cn-beijing -alibaba::ap-southeast-1 ``` From 2aa524bb789e81860aead1deda5087fb63c82140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Brod=C3=A9n?= Date: Wed, 3 May 2023 16:55:49 +0200 Subject: [PATCH 11/11] Add product links for RabbitMQ and LavinMQ --- docs/guides/info_plan.md | 2 +- docs/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/info_plan.md b/docs/guides/info_plan.md index 4a88981f..8aaf74ec 100644 --- a/docs/guides/info_plan.md +++ b/docs/guides/info_plan.md @@ -8,7 +8,7 @@ description: |- # Subscription plans -Tables below shows general subscription plans for CloudAMQP for either `RabbitMQ` or `LavinMQ`, for full price list see [cloudamqp](https://www.cloudamqp.com/plans.html). +Tables below shows general subscription plans for CloudAMQP for either [**RabbitMQ**](https://www.rabbitmq.com/) or [**LavinMQ**](https://lavinmq.com/), for full price list see [cloudamqp](https://www.cloudamqp.com/plans.html). *Information can differ from your actually valid plans, e.g. your team have been given preview access to unreleased plans. To retrieve an up to date list check out [cloudamqp-docs](https://docs.cloudamqp.com/#plans)* diff --git a/docs/index.md b/docs/index.md index 7f063a7d..71240693 100644 --- a/docs/index.md +++ b/docs/index.md @@ -9,7 +9,7 @@ description: |- The CloudAMQP provider is used to interact with CloudAMQP organization resources. -The provider allows you to manage your CloudAMQP instances and features. Create, configure and deploy Rabbit MQ to different cloud platforms. The provider needs to be configured with the proper API key before it can be used. +The provider allows you to manage your CloudAMQP instances and features. Create, configure and deploy [**RabbitMQ**](https://www.rabbitmq.com/) or [**LavinMQ**](https://lavinmq.com/) to different cloud platforms. The provider needs to be configured with the proper API key before it can be used. Use the navigation to the left to read about the available resources.