Skip to content

Commit

Permalink
Adds user step for required property required_providers in TF Recip…
Browse files Browse the repository at this point in the history
…es author guide (#1035)

* --signed

Signed-off-by: jasonviviano <[email protected]>

* Adding information on required AWS TF property for authoring Recipes.

Signed-off-by: jasonviviano <[email protected]>

* Changed the alert message to a more step in the creation of the `main.tf` for `required_providers` in the Recipe author guide.

Signed-off-by: jasonviviano <[email protected]>

* Fixed the previous sentence.

Signed-off-by: jasonviviano <[email protected]>

* Combined the snippets for the `main.tf` instructions into a single snippet.

Signed-off-by: jasonviviano <[email protected]>

* Fixed grammar.

Signed-off-by: jasonviviano <[email protected]>

* Update docs/content/guides/recipes/howto-author-recipes/index.md

Co-authored-by: Aaron Crawfis <[email protected]>
Signed-off-by: jasonviviano <[email protected]>

* Removing comments from `main.tf`

Signed-off-by: jasonviviano <[email protected]>

---------

Signed-off-by: jasonviviano <[email protected]>
Co-authored-by: Aaron Crawfis <[email protected]>
  • Loading branch information
jasonviviano and AaronCrawfis authored Feb 7, 2024
1 parent 2d86305 commit 991041a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 5 additions & 2 deletions docs/content/guides/recipes/howto-author-recipes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ Add the `context` parameter to your `variable.tf` file:

{{< rad file="snippets/redis-kubernetes-variables.tf" embed=true marker="//CONTEXT" lang="terraform" >}}

Update `main.tf` to use `context` for naming and namespace configuration:
Ensure that your `main.tf` has:

{{< rad file="snippets/redis-kubernetes-main.tf" embed=true marker="//RESOURCE" lang="terraform" >}}
- Defined `required_providers` for any providers you leverage in your module. This allows Radius to inject configuration and credentials.
- Utilizes the `context` parameter for naming and namespace configuration. This ensures your resources don't unintentionally collide with other uses of the Recipe.

{{< rad file="snippets/redis-kubernetes-main.tf" embed=true lang="terraform" >}}

{{% /codetab %}}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//PROVIDER
terraform {
required_providers {
kubernetes = {
Expand All @@ -7,9 +6,7 @@ terraform {
}
}
}
//PROVIDER

//RESOURCE
resource "kubernetes_deployment" "redis" {
metadata {
name = "redis-${sha512(var.context.resource.id)}"
Expand Down Expand Up @@ -62,4 +59,3 @@ resource "kubernetes_service" "redis" {
}
}
}
//RESOURCE

0 comments on commit 991041a

Please sign in to comment.