Skip to content

Commit

Permalink
feat: add infrastructure and orchestrator diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszjenek committed Mar 19, 2024
1 parent d4610d9 commit f483bcc
Show file tree
Hide file tree
Showing 23 changed files with 212 additions and 146 deletions.
29 changes: 26 additions & 3 deletions examples/dns/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Example: dns resource based on AWS Route 53

This example configures a [dns](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#dns) Resource Definition using AWS Route 53.

The created Resource Definition can be used in your Score file using:
## Configuration
This example configures a [dns](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#dns) Resource Definition using AWS Route 53. A workload using the `dns` resource to create dns records looks like:

```yaml
resources:
Expand All @@ -11,6 +10,30 @@ resources:
type: dns
```
## Infrastructure setup
```mermaid
graph TD;
subgraph AWS Hosted zone
record["record"]
end

subgraph AKS Cluster
pod[workload pod]
end
record --> pod
```

## Orchestrator setup

```mermaid
graph LR;
workload_1 --> dns_1["dns_1, resource_type: dns"]
workload_2 --> dns_2["dns_2, resource_type: dns"]
workload_2 --> shared.dns_1["shared.dns_1, resource_type: dns"]
workload_3 --> shared.dns_1["shared.dns_1, resource_type: dns"]
```

<!-- BEGIN_TF_DOCS -->
## Requirements

Expand Down
3 changes: 2 additions & 1 deletion examples/dns/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ terraform {
required_version = ">= 1.3.0"
}

provider "humanitec" {}
provider "humanitec" {
}
32 changes: 26 additions & 6 deletions examples/mysql/aurora/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Example: mysql resource based on AWS RDS Aurora

This example configures a [mysql](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#mysql) Resource Definition using AWS RDS Aurora.

The created definition can be used in your Score file using:
## Configuration
This example configures a [mysql](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#mysql) Resource Definition using AWS RDS Aurora. A workload using the `mysql` resource to create database instance looks like:

```yaml
resources:
Expand All @@ -11,6 +10,30 @@ resources:
type: mysql
```
## Infrastructure setup
```mermaid
graph TD;
subgraph VPC
database["MySQl AWS RDS Aurora instance"]
sg["MySQL security group"]
subgraph AKS Cluster
pod[workload pod]
end
database --> sg --> pod
end
```

## Orchestrator setup

```mermaid
graph LR;
workload_1 --> db_1["db_1, resource_type: mysql"]
workload_2 --> db_2["db_2, resource_type: mysql"]
workload_2 --> shared.db_1["shared.db_1, resource_type: mysql"]
workload_3 --> shared.db_1["shared.db_1, resource_type: mysql"]
```

<!-- BEGIN_TF_DOCS -->
## Requirements

Expand Down Expand Up @@ -44,14 +67,11 @@ resources:
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| access\_key | AWS Access Key | `string` | n/a | yes |
| humanitec\_org\_id | Humanitec organization where resource definitions will be applied | `string` | n/a | yes |
| humanitec\_token | Humanitec API token | `string` | n/a | yes |
| k8s\_node\_security\_group\_id | AWS Security Group ID of the kubernetes nodes to allow access to the AWS RDS cluster | `string` | n/a | yes |
| region | AWS Region to create resources | `string` | n/a | yes |
| secret\_key | AWS Secret Key | `string` | n/a | yes |
| subnet\_ids | AWS Subnet IDs to use for the AWS RDS cluster | `set(string)` | n/a | yes |
| vpc\_id | AWS VPC ID | `string` | n/a | yes |
| humanitec\_host | Humanitec API host url | `string` | `"https://api.humanitec.io"` | no |
| name | Name of the example application | `string` | `"hum-rp-mysql-example"` | no |
| prefix | Prefix of the created resources | `string` | `"hum-rp-mysql-ex-"` | no |
| resource\_packs\_aws\_rev | AWS Resource Pack git branch | `string` | `"refs/heads/main"` | no |
Expand Down
3 changes: 0 additions & 3 deletions examples/mysql/aurora/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@ provider "aws" {
}

provider "humanitec" {
host = var.humanitec_host
org_id = var.humanitec_org_id
token = var.humanitec_token
}
9 changes: 0 additions & 9 deletions examples/mysql/aurora/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
# AWS Access Key
access_key = ""

# Humanitec API host url
humanitec_host = "https://api.humanitec.io"

# Humanitec organization where resource definitions will be applied
humanitec_org_id = ""

# Humanitec API token
humanitec_token = ""

# AWS Security Group ID of the kubernetes nodes to allow access to the AWS RDS cluster
k8s_node_security_group_id = ""

Expand Down
16 changes: 0 additions & 16 deletions examples/mysql/aurora/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,6 @@ variable "region" {
description = "AWS Region to create resources"
}

variable "humanitec_org_id" {
type = string
description = "Humanitec organization where resource definitions will be applied"
}

variable "humanitec_token" {
type = string
description = "Humanitec API token"
}

variable "humanitec_host" {
type = string
default = "https://api.humanitec.io"
description = "Humanitec API host url"
}

variable "resource_packs_aws_url" {
description = "AWS Resource Pack git url"
type = string
Expand Down
31 changes: 26 additions & 5 deletions examples/mysql/basic/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Example: mysql resource based on AWS RDS

This example configures a [mysql](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#mysql) Resource Definition using AWS RDS.

The created Resource Definition can be used in your Score file using:
## Configuration
This example configures a [mysql](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#mysql) Resource Definition using AWS RDS. A workload using the `mysql` resource to create database instance looks like:

```yaml
resources:
Expand All @@ -11,6 +11,30 @@ resources:
type: mysql
```
## Infrastructure setup
```mermaid
graph TD;
subgraph VPC
database["MySQl AWS RDS instance"]
sg["MySQL security group"]
subgraph AKS Cluster
pod[workload pod]
end
database --> sg --> pod
end
```

## Orchestrator setup

```mermaid
graph LR;
workload_1 --> db_1["db_1, resource_type: mysql"]
workload_2 --> db_2["db_2, resource_type: mysql"]
workload_2 --> shared.db_1["shared.db_1, resource_type: mysql"]
workload_3 --> shared.db_1["shared.db_1, resource_type: mysql"]
```

<!-- BEGIN_TF_DOCS -->
## Requirements

Expand Down Expand Up @@ -47,14 +71,11 @@ resources:
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| access\_key | AWS Access Key | `string` | n/a | yes |
| humanitec\_org\_id | Humanitec organization where resource definitions will be applied | `string` | n/a | yes |
| humanitec\_token | Humanitec API token | `string` | n/a | yes |
| k8s\_node\_security\_group\_id | AWS Security Group ID of the kubernetes nodes to allow access to the AWS RDS cluster | `string` | n/a | yes |
| region | AWS Region to create resources | `string` | n/a | yes |
| secret\_key | AWS Secret Key | `string` | n/a | yes |
| subnet\_ids | AWS Subnet IDs to use for the AWS RDS cluster | `set(string)` | n/a | yes |
| vpc\_id | AWS VPC ID | `string` | n/a | yes |
| humanitec\_host | Humanitec API host url | `string` | `"https://api.humanitec.io"` | no |
| name | Name of the example application | `string` | `"hum-rp-mysql-example"` | no |
| prefix | Prefix of the created resources | `string` | `"hum-rp-mysql-ex-"` | no |
| resource\_packs\_aws\_rev | AWS Resource Pack git branch | `string` | `"refs/heads/main"` | no |
Expand Down
3 changes: 0 additions & 3 deletions examples/mysql/basic/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@ provider "aws" {
}

provider "humanitec" {
host = var.humanitec_host
org_id = var.humanitec_org_id
token = var.humanitec_token
}
9 changes: 0 additions & 9 deletions examples/mysql/basic/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
# AWS Access Key
access_key = ""

# Humanitec API host url
humanitec_host = "https://api.humanitec.io"

# Humanitec organization where resource definitions will be applied
humanitec_org_id = ""

# Humanitec API token
humanitec_token = ""

# AWS Security Group ID of the kubernetes nodes to allow access to the AWS RDS cluster
k8s_node_security_group_id = ""

Expand Down
16 changes: 0 additions & 16 deletions examples/mysql/basic/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,6 @@ variable "region" {
description = "AWS Region to create resources"
}

variable "humanitec_org_id" {
type = string
description = "Humanitec organization where resource definitions will be applied"
}

variable "humanitec_token" {
type = string
description = "Humanitec API token"
}

variable "humanitec_host" {
type = string
default = "https://api.humanitec.io"
description = "Humanitec API host url"
}

variable "resource_packs_aws_url" {
description = "AWS Resource Pack git url"
type = string
Expand Down
32 changes: 26 additions & 6 deletions examples/postgres/aurora/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Example: postgres resource based on AWS RDS Aurora

This example configures a [postgres](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#postgres) Resource Definition using AWS RDS Aurora.

The created Resource Definition can be used in your Score file using:
## Configuration
This example configures a [postgres](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#postgres) Resource Definition using AWS RDS Aurora. A workload using the `postgres` resource to create database instance looks like:

```yaml
resources:
Expand All @@ -11,6 +10,30 @@ resources:
type: postgres
```
## Infrastructure setup
```mermaid
graph TD;
subgraph VPC
database["Postgres AWS RDS Aurora instance"]
sg["Postgres security group"]
subgraph AKS Cluster
pod[workload pod]
end
database --> sg --> pod
end
```

## Orchestrator setup

```mermaid
graph LR;
workload_1 --> db_1["db_1, resource_type: postgres"]
workload_2 --> db_2["db_2, resource_type: postgres"]
workload_2 --> shared.db_1["shared.db_1, resource_type: postgres"]
workload_3 --> shared.db_1["shared.db_1, resource_type: postgres"]
```

<!-- BEGIN_TF_DOCS -->
## Requirements

Expand Down Expand Up @@ -44,14 +67,11 @@ resources:
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| access\_key | AWS Access Key | `string` | n/a | yes |
| humanitec\_org\_id | Humanitec organization where resource definitions will be applied | `string` | n/a | yes |
| humanitec\_token | Humanitec API token | `string` | n/a | yes |
| k8s\_node\_security\_group\_id | AWS Security Group ID of the kubernetes nodes to allow access to the AWS RDS cluster | `string` | n/a | yes |
| region | AWS Region to create resources | `string` | n/a | yes |
| secret\_key | AWS Secret Key | `string` | n/a | yes |
| subnet\_ids | AWS Subnet IDs to use for the AWS RDS cluster | `set(string)` | n/a | yes |
| vpc\_id | AWS VPC ID | `string` | n/a | yes |
| humanitec\_host | Humanitec API host url | `string` | `"https://api.humanitec.io"` | no |
| name | Name of the example application | `string` | `"hum-rp-postgres-example"` | no |
| prefix | Prefix of the created resources | `string` | `"hum-rp-postgres-ex-"` | no |
| resource\_packs\_aws\_rev | AWS Resource Pack git branch | `string` | `"refs/heads/main"` | no |
Expand Down
3 changes: 0 additions & 3 deletions examples/postgres/aurora/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@ provider "aws" {
}

provider "humanitec" {
host = var.humanitec_host
org_id = var.humanitec_org_id
token = var.humanitec_token
}
9 changes: 0 additions & 9 deletions examples/postgres/aurora/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
# AWS Access Key
access_key = ""

# Humanitec API host url
humanitec_host = "https://api.humanitec.io"

# Humanitec organization where resource definitions will be applied
humanitec_org_id = ""

# Humanitec API token
humanitec_token = ""

# AWS Security Group ID of the kubernetes nodes to allow access to the AWS RDS cluster
k8s_node_security_group_id = ""

Expand Down
16 changes: 0 additions & 16 deletions examples/postgres/aurora/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,6 @@ variable "region" {
description = "AWS Region to create resources"
}

variable "humanitec_org_id" {
type = string
description = "Humanitec organization where resource definitions will be applied"
}

variable "humanitec_token" {
type = string
description = "Humanitec API token"
}

variable "humanitec_host" {
type = string
default = "https://api.humanitec.io"
description = "Humanitec API host url"
}

variable "resource_packs_aws_url" {
description = "AWS Resource Pack git url"
type = string
Expand Down
Loading

0 comments on commit f483bcc

Please sign in to comment.