-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
060afba
commit 1e2d857
Showing
4 changed files
with
180 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
test/functional/shared/resources/testdata/corerp-resources-terraform-postgres.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import radius as radius | ||
|
||
@description('The URL of the server hosting test Terraform modules.') | ||
param moduleServer string | ||
|
||
@description('Username for Postgres db.') | ||
param userName string | ||
|
||
@description('Password for Postgres db.') | ||
@secure() | ||
param password string | ||
|
||
resource env 'Applications.Core/environments@2023-10-01-preview' = { | ||
name: 'corerp-resources-terraform-pg-env' | ||
location: 'global' | ||
properties: { | ||
compute: { | ||
kind: 'kubernetes' | ||
resourceId: 'self' | ||
namespace: 'corerp-resources-terraform-pg-env' | ||
} | ||
recipeConfig: { | ||
terraform:{ | ||
providers:{ | ||
postgresql:[{ | ||
username: userName | ||
port: 5432 | ||
password: password | ||
sslmode: 'disable' | ||
}] | ||
} | ||
} | ||
env: { | ||
PGHOST: 'postgres.corerp-resources-terraform-pg-app.svc.cluster.local' | ||
} | ||
} | ||
recipes: { | ||
'Applications.Core/extenders': { | ||
default: { | ||
templateKind: 'terraform' | ||
templatePath: '${moduleServer}/postgres.zip' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource app 'Applications.Core/applications@2023-10-01-preview' = { | ||
name: 'corerp-resources-terraform-pg-app' | ||
location: 'global' | ||
properties: { | ||
environment: env.id | ||
extensions: [ | ||
{ | ||
kind: 'kubernetesNamespace' | ||
namespace: 'corerp-resources-terraform-pg-app' | ||
} | ||
] | ||
} | ||
} | ||
|
||
resource pgsapp 'Applications.Core/extenders@2023-10-01-preview' = { | ||
name: 'pgs-resources-terraform-pgsapp' | ||
properties: { | ||
application: app.id | ||
environment: env.id | ||
recipe: { | ||
name: 'default' | ||
parameters: { | ||
password: password | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
...functional/shared/resources/testdata/recipes/test-terraform-recipes/postgres/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
|
||
variable "context" { | ||
description = "This variable contains Radius recipe context." | ||
type = any | ||
} | ||
|
||
variable "password" { | ||
description = "The password for the PostgreSQL database" | ||
type = string | ||
} | ||
|
||
variable "host" { | ||
default = "localhost" | ||
} |