Skip to content

Commit 60f1566

Browse files
committed
update per comments
1 parent b492f4a commit 60f1566

File tree

1 file changed

+23
-21
lines changed
  • docs/content/guides/recipes/terraform/howto-custom-provider

1 file changed

+23
-21
lines changed

docs/content/guides/recipes/terraform/howto-custom-provider/index.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
---
22
type: docs
33
title: "How-To: Configure custom Terraform Providers"
4-
linkTitle: "Configure custom Terraform Providers"
5-
description: "Learn how to setup your Radius environment to configure custom Terraform Providers and deploy recipes."
4+
linkTitle: "Custom Terraform Providers"
5+
description: "Learn how to setup your Radius environment with custom Terraform Providers and deploy recipes."
66
weight: 500
77
categories: "How-To"
88
aliases : ["/guides/recipes/terraform/howto-custom-provider"]
9-
tags: ["recipes", "terraform", "provider"]
9+
tags: ["recipes", "terraform"]
1010
---
1111

1212
This how-to guide will describe how to:
1313

14-
- Configure a custom Terraform Provider and use it in a Terraform recipe.
15-
In this example we're going to configure a PostgreSQL Terraform provider in a Radius environment and deploy a recipe.
16-
Ref: [Documentation for cyrilgdn/postgresql provider](https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs)
14+
- Configure a custom [Terraform provider](https://registry.terraform.io/browse/providers) in a Radius environment.
15+
- Configure credentials to authenticate into the Terraform provider.
16+
- Consume the terraform modules from a custom Terraform provider and use it in a Terraform recipe.
17+
18+
In this example we're going to configure a [PostgreSQL Terraform provider](https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs) in a Radius environment and deploy a recipe.
1719

1820
### Prerequisites
1921

@@ -23,58 +25,58 @@ Before you get started, you'll need to make sure you have the following tools an
2325
- [Radius Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
2426
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
2527
- [Radius initialized with `rad init`]({{< ref howto-environment >}})
28+
- [Recipes overview]({{< ref "/guides/recipes/overview" >}})
2629

27-
28-
## Step 1: Define a secretStore resource and store any sensitive information needed for the custom provider.
30+
## Step 1: Define a secretStore resource for the custom provider
2931

3032
Configure a [Radius Secret Store]({{< ref "/guides/author-apps/secrets/overview" >}}) with any sensitive information needed as input configuration for the custom Terraform Provider. Define the namespace for the cluster that will contain your [Kubernetes Secret](https://kubernetes.io/docs/concepts/configuration/secret/) with the `resource` property.
3133

3234
> While this example shows a Radius-managed secret store where Radius creates the underlying secrets infrastructure, you can also bring your own existing secrets. Refer to the [secrets documentation]({{< ref "/guides/author-apps/secrets/overview" >}}) for more information.
3335
34-
Create a Bicep file `env.bicep`, import Radius, and define your resource:
36+
Create a Bicep file `env.bicep` with the secretStore resource:
3537

3638
{{< rad file="snippets/env.bicep" embed=true marker="//SECRETSTORE" >}}
3739

38-
> In this example, we're creating a secret with keys `username` and `password` as sensitive inputs required by the Terraform Provider `cyrilgdn/postgresql`.
40+
> In this example, we're creating a secret with keys `username` and `password` as sensitive data required to authenticate into the Terraform Provider `cyrilgdn/postgresql`.
3941
40-
## Step 2: Configure Terraform Provider configuration
42+
## Step 2: Configure Terraform Provider
4143

42-
`recipeConfig/terraform/providers` allows the user to setup configurations for one or multiple Terraform Providers. For more information refer to the [Radius Environment schema]({{< ref environment-schema >}}) page.
44+
`recipeConfig/terraform/providers` allows you to setup configurations for one or multiple Terraform Providers. For more information refer to the [Radius Environment schema]({{< ref environment-schema >}}) page.
4345

44-
In your `env.bicep` file add an Environment resource, along with Recipe configuration which leverages the previously defined secret store for certain configuration fields.
45-
In this example we're also passing in `host` as an environment variable to highlight use cases where, depending on provider configuration requirements, users can pass environment variables to the terraform runtime.
46+
In your `env.bicep` file add an Environment resource, along with Recipe configuration which leverages properties from the previously defined secret store.
47+
In this example you're also passing in `host` as an environment variable to highlight use cases where, depending on provider configuration requirements, users can pass environment variables to the Terraform runtime.
4648

4749
{{< rad file="snippets/env.bicep" embed=true marker="//ENV" >}}
4850

49-
## Step 3: Define Terraform Recipe
51+
## Step 3: Define a Terraform Recipe
5052

5153
Create a Terraform recipe which deploys a postgreSQL database instance using custom Terraform provider `cyrilgdn/postgresql`
5254

5355
{{< rad file="snippets/postgres.tf" embed=true marker="//ENV" >}}
5456

55-
## Step 4: Add a Terraform Recipe to Env
57+
## Step 4: Add a Terraform Recipe to the environment
5658

57-
Update your Environment with a Terraform Recipe.
59+
Update your Environment with the Terraform Recipe.
5860

5961
{{< rad file="snippets/env-complete.bicep" embed=true marker="//ENV" markdownConfig="{linenos=table,hl_lines=[\"22-30\"],linenostart=30,lineNos=false}" >}}
6062

6163
## Step 5: Deploy your Radius Environment
6264

6365
Deploy your new Radius Environment:
6466

65-
```
67+
```bash
6668
rad deploy ./env.bicep -p username=****** -p password=******
6769
```
6870

6971
## Done
7072

71-
Your Radius Environment is now ready to deploy your Radius Recipes that utilize resources associated with configured custom providers. For more information on Radius Recipes visit the [Recipes overview page]({{< ref "/guides/recipes/overview" >}}).
73+
Your Radius Environment is now configured with a custom Terraform provider which you can use to deploy Radius Terraform recipes. For more information on Radius Recipes visit the [Recipes overview page]({{< ref "/guides/recipes/overview" >}}).
7274

7375
## Cleanup
7476

75-
You can delete a Radius Environment by running the following command:
77+
You can delete the Radius Environment by running the following command:
7678

77-
```
79+
```bash
7880
rad env delete my-env
7981
```
8082

0 commit comments

Comments
 (0)