Skip to content

Commit

Permalink
Merge pull request #18 from humanitec-architecture/remove-app-creation
Browse files Browse the repository at this point in the history
Remove App creation
  • Loading branch information
mathieu-benoit authored Oct 3, 2024
2 parents 4cd37b8 + b2f4695 commit 8d5a9b7
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 84 deletions.
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Score & Humanitec Dev Container",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/terraform:1": {
"installTerraformDocs": true
}
},
"postCreateCommand": "bash .devcontainer/installMoreTools.sh",
"customizations": {
"vscode": {
"extensions": [
"redhat.vscode-yaml",
"humanitec.humanitec"
],
"settings": {
"yaml.schemas": {
"https://raw.githubusercontent.com/score-spec/spec/main/score-v1b1.json": "score.yaml"
}
}
}
}
}
13 changes: 13 additions & 0 deletions .devcontainer/installMoreTools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

mkdir install-more-tools
cd install-more-tools

HUMCTL_VERSION=$(curl -sL https://api.github.com/repos/humanitec/cli/releases/latest | jq -r .tag_name)
curl -fLO https://github.com/humanitec/cli/releases/download/${HUMCTL_VERSION}/cli_${HUMCTL_VERSION:1}_linux_amd64.tar.gz
tar -xvf cli_${HUMCTL_VERSION:1}_linux_amd64.tar.gz
chmod +x humctl
sudo mv humctl /usr/local/bin/humctl

cd ..
rm -rf install-more-tools
8 changes: 4 additions & 4 deletions examples/mongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ This example configures a [mongodb](https://developer.humanitec.com/platform-orc

| Name | Type |
|------|------|
| [humanitec_application.example](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/application) | resource |
| [humanitec_resource_definition_criteria.mongodb_basic](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| name | Name of the example application | `string` | `"hum-rp-mongodb-example"` | no |
| prefix | Prefix of the created resources | `string` | `"hum-rp-mongodb-ex-"` | no |
<!-- END_TF_DOCS -->

Expand Down Expand Up @@ -70,10 +68,12 @@ resources:
This Score file when deployed to Humanitec will provision the `mongodb` database and inject the outputs in the associated environment variable.

Here is how to deploy this Score file, for example to the `hum-rp-mongodb-example` Application and `development` Environment:
Here is how to deploy this Score file, for example to the `mongodb-example` Application and `development` Environment:
```bash
humctl create app mongodb-example
humctl score deploy \
-f score.yaml \
--app hum-rp-mongodb-example \
--app mongodb-example \
--env development
```
8 changes: 0 additions & 8 deletions examples/mongodb/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
resource "humanitec_application" "example" {
id = var.name
name = var.name
}

# mysql resource definition

module "mongodb_basic" {
source = "../../humanitec-resource-defs/mongodb/basic"

Expand All @@ -13,7 +6,6 @@ module "mongodb_basic" {

resource "humanitec_resource_definition_criteria" "mongodb_basic" {
resource_definition_id = module.mongodb_basic.id
app_id = humanitec_application.example.id
class = "default"
force_delete = true
}
3 changes: 0 additions & 3 deletions examples/mongodb/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

# Name of the example application
name = "hum-rp-mongodb-example"

# Prefix of the created resources
prefix = "hum-rp-mongodb-ex-"
6 changes: 0 additions & 6 deletions examples/mongodb/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
variable "name" {
description = "Name of the example application"
type = string
default = "hum-rp-mongodb-example"
}

variable "prefix" {
description = "Prefix of the created resources"
type = string
Expand Down
8 changes: 4 additions & 4 deletions examples/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ This example configures a [mysql](https://developer.humanitec.com/platform-orche

| Name | Type |
|------|------|
| [humanitec_application.example](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/application) | resource |
| [humanitec_resource_definition_criteria.mysql_basic](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| name | Name of the example application | `string` | `"hum-rp-mysql-example"` | no |
| prefix | Prefix of the created resources | `string` | `"hum-rp-mysql-ex-"` | no |
<!-- END_TF_DOCS -->

Expand Down Expand Up @@ -70,10 +68,12 @@ resources:
This Score file when deployed to Humanitec will provision the `mysql` database and inject the outputs in the associated environment variable.

Here is how to deploy this Score file, for example to the `hum-rp-mysql-example` Application and `development` Environment:
Here is how to deploy this Score file, for example to the `mysql-example` Application and `development` Environment:
```bash
humctl create app mysql-example
humctl score deploy \
-f score.yaml \
--app hum-rp-mysql-example \
--app mysql-example \
--env development
```
8 changes: 0 additions & 8 deletions examples/mysql/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
resource "humanitec_application" "example" {
id = var.name
name = var.name
}

# mysql resource definition

module "mysql_basic" {
source = "../../humanitec-resource-defs/mysql/basic"

Expand All @@ -13,7 +6,6 @@ module "mysql_basic" {

resource "humanitec_resource_definition_criteria" "mysql_basic" {
resource_definition_id = module.mysql_basic.id
app_id = humanitec_application.example.id
class = "default"
force_delete = true
}
3 changes: 0 additions & 3 deletions examples/mysql/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

# Name of the example application
name = "hum-rp-mysql-example"

# Prefix of the created resources
prefix = "hum-rp-mysql-ex-"
6 changes: 0 additions & 6 deletions examples/mysql/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
variable "name" {
description = "Name of the example application"
type = string
default = "hum-rp-mysql-example"
}

variable "prefix" {
description = "Prefix of the created resources"
type = string
Expand Down
8 changes: 4 additions & 4 deletions examples/postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ This example configures a [postgres](https://developer.humanitec.com/platform-or

| Name | Type |
|------|------|
| [humanitec_application.example](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/application) | resource |
| [humanitec_resource_definition_criteria.postgres_basic](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| name | Name of the example application | `string` | `"hum-rp-postgres-example"` | no |
| prefix | Prefix of the created resources | `string` | `"hum-rp-postgres-ex-"` | no |
<!-- END_TF_DOCS -->

Expand Down Expand Up @@ -70,10 +68,12 @@ resources:
This Score file when deployed to Humanitec will provision the `postgres` database and inject the outputs in the associated environment variable.

Here is how to deploy this Score file, for example to the `hum-rp-postgres-example` Application and `development` Environment:
Here is how to deploy this Score file, for example to the `postgres-example` Application and `development` Environment:
```bash
humctl create app postgres-example
humctl score deploy \
-f score.yaml \
--app hum-rp-postgres-example \
--app postgres-example \
--env development
```
8 changes: 0 additions & 8 deletions examples/postgres/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
resource "humanitec_application" "example" {
id = var.name
name = var.name
}

# postgres resource definition

module "postgres_basic" {
source = "../../humanitec-resource-defs/postgres/basic"

Expand All @@ -13,7 +6,6 @@ module "postgres_basic" {

resource "humanitec_resource_definition_criteria" "postgres_basic" {
resource_definition_id = module.postgres_basic.id
app_id = humanitec_application.example.id
class = "default"
force_delete = true
}
3 changes: 0 additions & 3 deletions examples/postgres/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

# Name of the example application
name = "hum-rp-postgres-example"

# Prefix of the created resources
prefix = "hum-rp-postgres-ex-"
6 changes: 0 additions & 6 deletions examples/postgres/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
variable "name" {
description = "Name of the example application"
type = string
default = "hum-rp-postgres-example"
}

variable "prefix" {
description = "Prefix of the created resources"
type = string
Expand Down
8 changes: 4 additions & 4 deletions examples/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ This example configures a [redis](https://developer.humanitec.com/platform-orche

| Name | Type |
|------|------|
| [humanitec_application.example](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/application) | resource |
| [humanitec_resource_definition_criteria.redis_basic](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| name | Name of the example application | `string` | `"hum-rp-redis-example"` | no |
| prefix | Prefix of the created resources | `string` | `"hum-rp-redis-ex-"` | no |
<!-- END_TF_DOCS -->

Expand Down Expand Up @@ -71,10 +69,12 @@ resources:
This Score file when deployed to Humanitec will provision the `redis` database and inject the outputs in the associated environment variable.

Here is how to deploy this Score file, for example to the `hum-rp-redis-example` Application and `development` Environment:
Here is how to deploy this Score file, for example to the `redis-example` Application and `development` Environment:
```bash
humctl create app redis-example
humctl score deploy \
-f score.yaml \
--app hum-rp-redis-example \
--app redis-example \
--env development
```
8 changes: 0 additions & 8 deletions examples/redis/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
resource "humanitec_application" "example" {
id = var.name
name = var.name
}

# redis resource definition

module "redis_basic" {
source = "../../humanitec-resource-defs/redis/basic"

Expand All @@ -13,7 +6,6 @@ module "redis_basic" {

resource "humanitec_resource_definition_criteria" "redis_basic" {
resource_definition_id = module.redis_basic.id
app_id = humanitec_application.example.id
class = "default"
force_delete = true
}
3 changes: 0 additions & 3 deletions examples/redis/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

# Name of the example application
name = "hum-rp-redis-example"

# Prefix of the created resources
prefix = "hum-rp-redis-ex-"
6 changes: 0 additions & 6 deletions examples/redis/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
variable "name" {
description = "Name of the example application"
type = string
default = "hum-rp-redis-example"
}

variable "prefix" {
description = "Prefix of the created resources"
type = string
Expand Down

0 comments on commit 8d5a9b7

Please sign in to comment.