Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Update Resource Definitions for related Applications

This repository contains reference material for Humanitec's tutorial on Resource Definitions for related Applications. You can find the full tutorial instructions here (link coming soon).

This repository contains reference material for Humanitec's tutorial on [Updating Resource Definitions for related Applications](https://developer.humanitec.com/introduction/tutorials/update-resource-definitions-for-related-applications). Please find the full tutorial instructions in the linked documentation.
4 changes: 2 additions & 2 deletions score/score-app1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ containers:
command: ["/bin/bash"]
args: ["-c", "while true; do printenv && sleep 100; done"]
variables:
REDIS: ${externals.redis.host}
REDIS: ${resources.redis.host}
resources:
"redis":
redis:
type: redis
8 changes: 4 additions & 4 deletions score/score-app2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ containers:
command: ["/bin/bash"]
args: ["-c", "while true; do printenv && sleep 100; done"]
variables:
REDIS: ${externals.redis.host}
S3: ${externals.s3.bucket}
REDIS: ${resources.redis.host}
S3: ${resources.s3.bucket}
resources:
"redis":
redis:
type: redis
"s3":
s3:
type: s3
4 changes: 2 additions & 2 deletions score/score-app3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ containers:
command: ["/bin/bash"]
args: ["-c", "while true; do printenv && sleep 100; done"]
variables:
POSTGRES: ${externals.postgres.host}
POSTGRES: ${resources.postgres.host}
resources:
"postgres":
postgres:
type: postgres
15 changes: 15 additions & 0 deletions terraform/matching.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,18 @@ resource "humanitec_resource_definition_criteria" "criteria4" {
resource_definition_id = humanitec_resource_definition.postgres.id
app_id = "app3"
}


# Matching criteria for the target Kubernetes cluster
resource "humanitec_resource_definition_criteria" "cluster-app1" {
resource_definition_id = var.k8s_resDef
app_id = "app1"
}
resource "humanitec_resource_definition_criteria" "cluster-app2" {
resource_definition_id = var.k8s_resDef
app_id = "app2"
}
resource "humanitec_resource_definition_criteria" "cluster-app3" {
resource_definition_id = var.k8s_resDef
app_id = "app3"
}
3 changes: 3 additions & 0 deletions terraform/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ variable "org" {

variable "token" {
}

variable "k8s_resDef" {
}
6 changes: 3 additions & 3 deletions terraform/resdef.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ variable "instance_type" {
resource "humanitec_resource_definition" "redis" {
name = "redis"
id = "redis"
driver_type = "${var.org}/terraform"
driver_type = "humanitec/terraform"
type = "redis"

driver_inputs = {
Expand Down Expand Up @@ -37,7 +37,7 @@ resource "humanitec_resource_definition" "redis" {
resource "humanitec_resource_definition" "bucket" {
name = "bucket"
id = "bucket"
driver_type = "${var.org}/terraform"
driver_type = "humanitec/terraform"
type = "s3"

driver_inputs = {
Expand Down Expand Up @@ -69,7 +69,7 @@ resource "humanitec_resource_definition" "bucket" {
resource "humanitec_resource_definition" "postgres" {
name = "postgres"
id = "postgres"
driver_type = "${var.org}/terraform"
driver_type = "humanitec/terraform"
type = "postgres"

driver_inputs = {
Expand Down
4 changes: 3 additions & 1 deletion terraform/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# The Humanitec Organization ID. Must be all lowercase.
org = ""
# The Humanitec API Token.
token = ""
token = ""
# The id of the Resource Definition of the target Kubernetes Cluster
k8s_resDef = ""