From e7440a43761d8af2c4a13b708fbd1a8497112d76 Mon Sep 17 00:00:00 2001 From: Will Tsai <28876888+willtsai@users.noreply.github.com> Date: Mon, 7 Aug 2023 10:52:08 -0700 Subject: [PATCH] add environment variables related to connections Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> --- docs/content/author-apps/container/index.md | 2 +- docs/content/concepts/application-graph/index.md | 2 +- .../link-schema/cache/redis/index.md | 12 +++++++++++- .../link-schema/databases/microsoft-sql/index.md | 14 +++++++++++++- .../link-schema/databases/mongodb/index.md | 13 ++++++++++++- .../link-schema/messaging/rabbitmq/index.md | 13 ++++++++++++- 6 files changed, 50 insertions(+), 6 deletions(-) diff --git a/docs/content/author-apps/container/index.md b/docs/content/author-apps/container/index.md index 8a91d8671..de4f83f6d 100644 --- a/docs/content/author-apps/container/index.md +++ b/docs/content/author-apps/container/index.md @@ -72,7 +72,7 @@ Refer to the probes section of the [container resource schema]({{< ref "containe Connections enable communication between your container and other resources, such as databases, message queues, and other services. A connection injects information about the resource you connect to as environment variables. This could be connection strings, access keys, password or other information needed for communication between the container and the resource it connects to. It also enables you to configure the RBAC permissions for the container to access the resource. -Refer to the [connections schema] for containers({{< ref "container-schema#connections" >}}) for more details. +Refer to the [connections schema for containers]({{< ref "container-schema#connections" >}}) for more details. ### Extensions diff --git a/docs/content/concepts/application-graph/index.md b/docs/content/concepts/application-graph/index.md index 30c797b2d..dab03c194 100644 --- a/docs/content/concepts/application-graph/index.md +++ b/docs/content/concepts/application-graph/index.md @@ -26,7 +26,7 @@ For example, if you want a container to read from an Azure Storage Account witho A diagram showing a connection from a Radius container to an Azure storage account resulting in managed identities, role-based access control, and CSI drivers. -### Injected values +### Connections and injected values The mechanism behind this automated application deployment is injected values into environment variables. When a connection between two resources is declared, Radius injects resource related information into environment variables that are then used to access the respective resource without having to hard code URIs, connection strings, access keys, or anything that application code needs to successfully communicate. Refer to the [reference documentation]({{< ref resource-schema >}}) of each resource for more information. diff --git a/docs/content/reference/resource-schema/link-schema/cache/redis/index.md b/docs/content/reference/resource-schema/link-schema/cache/redis/index.md index 3ec44e38e..2cedde702 100644 --- a/docs/content/reference/resource-schema/link-schema/cache/redis/index.md +++ b/docs/content/reference/resource-schema/link-schema/cache/redis/index.md @@ -90,4 +90,14 @@ When no Recipe configuration is set, Radius will use the currently registered Re ### Provision manually -If you want to manually manage your infrastructure provisioning without the use of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values that enable Radius to deploy or connect to the desired infrastructure. \ No newline at end of file +If you want to manually manage your infrastructure provisioning without the use of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values that enable Radius to deploy or connect to the desired infrastructure. + +## Environment variables for connections + +Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a Redis resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to Redis is declared, Radius injects values into environment variables that are then used to access the connected Redis resource: + +| Environment variable | Description | Example(s) | +|----------------------|-------------|------------| +| CONNECTION_MYCONNECTION_USERNAME | The username for the Redis cache. | `admin` | +| CONNECTION_MYCONNECTION_CONNECTIONSTRING | The connection string for the Redis cache. | `https://mycache.redis.cache.windows.net,password=*****,....` | +| CONNECTION_MYCONNECTION_PASSWORD | The password for the Redis cache. | `mypassword` | \ No newline at end of file diff --git a/docs/content/reference/resource-schema/link-schema/databases/microsoft-sql/index.md b/docs/content/reference/resource-schema/link-schema/databases/microsoft-sql/index.md index 0666b656a..4b7a213a3 100644 --- a/docs/content/reference/resource-schema/link-schema/databases/microsoft-sql/index.md +++ b/docs/content/reference/resource-schema/link-schema/databases/microsoft-sql/index.md @@ -80,4 +80,16 @@ When no Recipe configuration is set Radius will use the Recipe registered as the ### Provision manually -If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values and values that enable Radius to deploy or connect to the desired infrastructure. \ No newline at end of file +If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values and values that enable Radius to deploy or connect to the desired infrastructure. + +## Environment variables for connections + +Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a Azure SQL resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to Azure SQL is declared, Radius injects values into environment variables that are then used to access the connected Azure SQL resource: + +| Environment variable | Description | Example(s) | +|----------------------|-------------|------------| +| CONNECTION_MYCONNECTION_DATABASE | The name of the target Azure SQL database. | `mydatabase` | +| CONNECTION_MYCONNECTION_SERVER | The fully qualified domain name of the target Azure SQL server. | `sql.hello.com` | +| CONNECTION_MYCONNECTION_USERNAME | The username for the target Azure SQL database. | `admin` | +| CONNECTION_MYCONNECTION_PASSWORD | The password for the target Azure SQL database. | `mypassword` | +| CONNECTION_MYCONNECTION_CONNECTIONSTRING | The connection string for the target Azure SQL database. | `https://mysqlserver.cluster.svc.local,password=*****,....` | \ No newline at end of file diff --git a/docs/content/reference/resource-schema/link-schema/databases/mongodb/index.md b/docs/content/reference/resource-schema/link-schema/databases/mongodb/index.md index f03c495db..a8c00fb20 100644 --- a/docs/content/reference/resource-schema/link-schema/databases/mongodb/index.md +++ b/docs/content/reference/resource-schema/link-schema/databases/mongodb/index.md @@ -91,4 +91,15 @@ Parameters can also optionally be specified for the Recipe. ### Provision manually -If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values in order for Radius to be able to deploy/connect to the desired infrastructure. \ No newline at end of file +If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values in order for Radius to be able to deploy/connect to the desired infrastructure. + +## Environment variables for connections + +Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a MongoDB resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to MongoDB is declared, Radius injects values into environment variables that are then used to access the connected MongoDB resource: + +| Environment variable | Description | Example(s) | +|----------------------|-------------|------------| +| CONNECTION_MYCONNECTION_DATABASE | Name of the target Mongo database | `mongodb-prod` | +| CONNECTION_MYCONNECTION_USERNAME | Username for the target Mongo database | `myusername` | +| CONNECTION_MYCONNECTION_PASSWORD | Password for the target Mongo database | `mypassword` | +| CONNECTION_MYCONNECTION_CONNECTIONSTRING | Connection string for the target Mongo database | `https://mymongo.cluster.svc.local,password=*****,....` | \ No newline at end of file diff --git a/docs/content/reference/resource-schema/link-schema/messaging/rabbitmq/index.md b/docs/content/reference/resource-schema/link-schema/messaging/rabbitmq/index.md index 011b335c0..cc84a44e5 100644 --- a/docs/content/reference/resource-schema/link-schema/messaging/rabbitmq/index.md +++ b/docs/content/reference/resource-schema/link-schema/messaging/rabbitmq/index.md @@ -84,4 +84,15 @@ When no Recipe configuration is set Radius will use the Recipe registered as the ### Provision manually -If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values and values that enable Radius to deploy or connect to the desired infrastructure. \ No newline at end of file +If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values and values that enable Radius to deploy or connect to the desired infrastructure. + +## Environment variables for connections + +Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a RabbitMQ resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to RabbitMQ is declared, Radius injects values into environment variables that are then used to access the connected RabbitMQ resource: + +| Environment variable | Description | Example(s) | +|----------------------|-------------|------------| +| CONNECTION_MYCONNECTION_QUEUE | The name of the target RabbitMQ queue. | `'orders'` | +| CONNECTION_MYCONNECTION_USERNAME | The username for the target RabbitMQ queue. | `'guest'` | +| CONNECTION_MYCONNECTION_CONNECTIONSTRING | The connection string to the target RabbitMQ queue. | `'amqp://guest:***@rabbitmq.svc.local.cluster:5672'` | +| CONNECTION_MYCONNECTION_PASSWORD | The password for the target RabbitMQ queue. | `'password'` | \ No newline at end of file