diff --git a/README.md b/README.md index fe49b90..b99d2fb 100644 --- a/README.md +++ b/README.md @@ -6,22 +6,27 @@ --- -A collection of AWS resources ready to be used with [Humanitec](https://humanitec.com/). +The AWS Resource Pack contains various reference implementation of connecting AWS with [the Humanitec Platform Orchestrator](https://developer.humanitec.com/platform-orchestrator/overview/). + +You can find more details about Resource Packs and how to use them [inside the Humanitec documentation](https://developer.humanitec.com/platform-orchestrator/resources/resource-packs/). The following resources are included: +* [dns/basic](./humanitec-resource-defs/dns/basic): A `dns` resource using Route 53. * [iam-policy/ecr-create-repository](./humanitec-resource-defs/iam-policy/ecr-create-repository): IAM policy for to create ECR repositories. -* [iam-policy/s3-admin](./humanitec-resource-defs/iam-policy/s3-admin): IAM policy for admin access for a S3 bucket. -* [iam-policy/sqs-admin](./humanitec-resource-defs/iam-policy/sqs-admin): IAM policy for admin access for an SQS queue. +* [iam-policy/s3](./humanitec-resource-defs/iam-policy/s3): IAM policy for for an S3 bucket. +* [iam-policy/sqs](./humanitec-resource-defs/iam-policy/sqs): IAM policy for an SQS queue. * [iam-role/service-account](./humanitec-resource-defs/iam-role/service-account): An assumable IAM role, by a k8s service account. -* [k8s/service-account](./humanitec-resource-defs/k8s/service-account): A k8s service account linked to an IAM role. -* [redis/basic](./humanitec-resource-defs/redis/basic): AWS ElastiCache resource. -* [s3/basic](./humanitec-resource-defs/s3/basic): A basic S3 bucket. -* [sqs/basic](./humanitec-resource-defs/sqs/basic): A basic SQS queue. -* [workload/service-account](./humanitec-resource-defs/workload/service-account): A workload service account. +* [k8s/service-account](./humanitec-resource-defs/k8s/service-account): A `k8s-service-account` linked to an IAM role. +* [rds/aurora](./humanitec-resource-defs/rds/aurora): A `postgres` or `mysql` resource using AWS RDS Aurora. +* [rds/basic](./humanitec-resource-defs/rds/basic): A `postgres` or `mysql` resource using AWS RDS. +* [redis/basic](./humanitec-resource-defs/redis/basic): A `redis` resource using AWS ElastiCache. +* [s3/basic](./humanitec-resource-defs/s3/basic): A basic `s3` bucket. +* [sqs/basic](./humanitec-resource-defs/sqs/basic): A basic `sqs` queue. +* [workload/service-account](./humanitec-resource-defs/workload/service-account): Inject a k8s service account into a `workload`. -The `humanitec-resource-defs` directory includes the respective resource definitions. +The `humanitec-resource-defs` directory includes the respective Resource Definitions. The `modules` directory includes the Terraform modules used by the [Humanitec Terraform Driver](https://developer.humanitec.com/integration-and-extensions/drivers/generic-drivers/terraform/) to provision the actual resources. -Checkout `examples/main.tf` for an example application using S3 & SQS. +Checkout `examples/` for example usage of the Resource Definitions listed above. diff --git a/examples/route53/README.md b/examples/dns/README.md similarity index 76% rename from examples/route53/README.md rename to examples/dns/README.md index c27eb00..9dc57d3 100644 --- a/examples/route53/README.md +++ b/examples/dns/README.md @@ -1,3 +1,16 @@ +# 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: + +```yaml +resources: + ... + dns: + type: dns +``` + ## Requirements @@ -16,7 +29,7 @@ | Name | Source | Version | |------|--------|---------| -| route53 | ../../humanitec-resource-defs/route53/basic | n/a | +| route53 | ../../humanitec-resource-defs/dns/basic | n/a | ## Resources @@ -36,4 +49,4 @@ | secret\_key | AWS Secret Key | `string` | n/a | yes | | resource\_packs\_aws\_rev | AWS Resource Pack git branch | `string` | `"refs/heads/main"` | no | | resource\_packs\_aws\_url | AWS Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-aws.git"` | no | - \ No newline at end of file + diff --git a/examples/route53/main.tf b/examples/dns/main.tf similarity index 91% rename from examples/route53/main.tf rename to examples/dns/main.tf index 99d3db1..c031dce 100644 --- a/examples/route53/main.tf +++ b/examples/dns/main.tf @@ -8,7 +8,7 @@ resource "humanitec_application" "example" { } module "route53" { - source = "../../humanitec-resource-defs/route53/basic" + source = "../../humanitec-resource-defs/dns/basic" access_key = var.access_key secret_key = var.secret_key diff --git a/examples/route53/providers.tf b/examples/dns/providers.tf similarity index 100% rename from examples/route53/providers.tf rename to examples/dns/providers.tf diff --git a/examples/route53/terraform.tfvars.example b/examples/dns/terraform.tfvars.example similarity index 100% rename from examples/route53/terraform.tfvars.example rename to examples/dns/terraform.tfvars.example diff --git a/examples/route53/variables.tf b/examples/dns/variables.tf similarity index 100% rename from examples/route53/variables.tf rename to examples/dns/variables.tf diff --git a/examples/rds/aurora-mysql/README.md b/examples/mysql/aurora/README.md similarity index 84% rename from examples/rds/aurora-mysql/README.md rename to examples/mysql/aurora/README.md index 15c8eb9..dc19f90 100644 --- a/examples/rds/aurora-mysql/README.md +++ b/examples/mysql/aurora/README.md @@ -1,3 +1,16 @@ +# 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: + +```yaml +resources: + ... + db: + type: mysql +``` + ## Requirements @@ -42,4 +55,4 @@ | humanitec\_host | Humanitec API host url | `string` | `"https://api.humanitec.io"` | no | | resource\_packs\_aws\_rev | AWS Resource Pack git branch | `string` | `"refs/heads/main"` | no | | resource\_packs\_aws\_url | AWS Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-aws.git"` | no | - \ No newline at end of file + diff --git a/examples/rds/aurora-mysql/main.tf b/examples/mysql/aurora/main.tf similarity index 100% rename from examples/rds/aurora-mysql/main.tf rename to examples/mysql/aurora/main.tf diff --git a/examples/rds/aurora-mysql/providers.tf b/examples/mysql/aurora/providers.tf similarity index 100% rename from examples/rds/aurora-mysql/providers.tf rename to examples/mysql/aurora/providers.tf diff --git a/examples/rds/aurora-mysql/terraform.tfvars.example b/examples/mysql/aurora/terraform.tfvars.example similarity index 100% rename from examples/rds/aurora-mysql/terraform.tfvars.example rename to examples/mysql/aurora/terraform.tfvars.example diff --git a/examples/rds/aurora-mysql/variables.tf b/examples/mysql/aurora/variables.tf similarity index 100% rename from examples/rds/aurora-mysql/variables.tf rename to examples/mysql/aurora/variables.tf diff --git a/examples/rds/basic-mysql/README.md b/examples/mysql/basic/README.md similarity index 86% rename from examples/rds/basic-mysql/README.md rename to examples/mysql/basic/README.md index 7ea2196..450d9e0 100644 --- a/examples/rds/basic-mysql/README.md +++ b/examples/mysql/basic/README.md @@ -1,3 +1,16 @@ +# 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: + +```yaml +resources: + ... + db: + type: mysql +``` + ## Requirements @@ -45,4 +58,4 @@ | humanitec\_host | Humanitec API host url | `string` | `"https://api.humanitec.io"` | no | | resource\_packs\_aws\_rev | AWS Resource Pack git branch | `string` | `"refs/heads/main"` | no | | resource\_packs\_aws\_url | AWS Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-aws.git"` | no | - \ No newline at end of file + diff --git a/examples/rds/basic-mysql/main.tf b/examples/mysql/basic/main.tf similarity index 100% rename from examples/rds/basic-mysql/main.tf rename to examples/mysql/basic/main.tf diff --git a/examples/rds/aurora-postgres/providers.tf b/examples/mysql/basic/providers.tf similarity index 100% rename from examples/rds/aurora-postgres/providers.tf rename to examples/mysql/basic/providers.tf diff --git a/examples/rds/aurora-postgres/terraform.tfvars.example b/examples/mysql/basic/terraform.tfvars.example similarity index 100% rename from examples/rds/aurora-postgres/terraform.tfvars.example rename to examples/mysql/basic/terraform.tfvars.example diff --git a/examples/rds/aurora-postgres/variables.tf b/examples/mysql/basic/variables.tf similarity index 100% rename from examples/rds/aurora-postgres/variables.tf rename to examples/mysql/basic/variables.tf diff --git a/examples/rds/aurora-postgres/README.md b/examples/postgres/aurora/README.md similarity index 83% rename from examples/rds/aurora-postgres/README.md rename to examples/postgres/aurora/README.md index 15c8eb9..b487bb7 100644 --- a/examples/rds/aurora-postgres/README.md +++ b/examples/postgres/aurora/README.md @@ -1,3 +1,16 @@ +# 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: + +```yaml +resources: + ... + db: + type: postgres +``` + ## Requirements @@ -42,4 +55,4 @@ | humanitec\_host | Humanitec API host url | `string` | `"https://api.humanitec.io"` | no | | resource\_packs\_aws\_rev | AWS Resource Pack git branch | `string` | `"refs/heads/main"` | no | | resource\_packs\_aws\_url | AWS Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-aws.git"` | no | - \ No newline at end of file + diff --git a/examples/rds/aurora-postgres/main.tf b/examples/postgres/aurora/main.tf similarity index 100% rename from examples/rds/aurora-postgres/main.tf rename to examples/postgres/aurora/main.tf diff --git a/examples/rds/basic-mysql/providers.tf b/examples/postgres/aurora/providers.tf similarity index 100% rename from examples/rds/basic-mysql/providers.tf rename to examples/postgres/aurora/providers.tf diff --git a/examples/rds/basic-mysql/terraform.tfvars.example b/examples/postgres/aurora/terraform.tfvars.example similarity index 100% rename from examples/rds/basic-mysql/terraform.tfvars.example rename to examples/postgres/aurora/terraform.tfvars.example diff --git a/examples/rds/basic-mysql/variables.tf b/examples/postgres/aurora/variables.tf similarity index 100% rename from examples/rds/basic-mysql/variables.tf rename to examples/postgres/aurora/variables.tf diff --git a/examples/rds/basic-postgres/README.md b/examples/postgres/basic/README.md similarity index 86% rename from examples/rds/basic-postgres/README.md rename to examples/postgres/basic/README.md index 11e4914..1bab5b1 100644 --- a/examples/rds/basic-postgres/README.md +++ b/examples/postgres/basic/README.md @@ -1,3 +1,16 @@ +# Example: postgres resource based on AWS RDS + +This example configures a [postgres](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#postgres) Resource Definition using AWS RDS. + +The created Resource Definition can be used in your Score file using: + +```yaml +resources: + ... + db: + type: postgres +``` + ## Requirements @@ -45,4 +58,4 @@ | humanitec\_host | Humanitec API host url | `string` | `"https://api.humanitec.io"` | no | | resource\_packs\_aws\_rev | AWS Resource Pack git branch | `string` | `"refs/heads/main"` | no | | resource\_packs\_aws\_url | AWS Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-aws.git"` | no | - \ No newline at end of file + diff --git a/examples/rds/basic-postgres/main.tf b/examples/postgres/basic/main.tf similarity index 100% rename from examples/rds/basic-postgres/main.tf rename to examples/postgres/basic/main.tf diff --git a/examples/rds/basic-postgres/providers.tf b/examples/postgres/basic/providers.tf similarity index 100% rename from examples/rds/basic-postgres/providers.tf rename to examples/postgres/basic/providers.tf diff --git a/examples/rds/basic-postgres/terraform.tfvars.example b/examples/postgres/basic/terraform.tfvars.example similarity index 100% rename from examples/rds/basic-postgres/terraform.tfvars.example rename to examples/postgres/basic/terraform.tfvars.example diff --git a/examples/rds/basic-postgres/variables.tf b/examples/postgres/basic/variables.tf similarity index 100% rename from examples/rds/basic-postgres/variables.tf rename to examples/postgres/basic/variables.tf diff --git a/examples/redis/README.md b/examples/redis/README.md index 78b294a..1cf8f15 100644 --- a/examples/redis/README.md +++ b/examples/redis/README.md @@ -1,3 +1,16 @@ +# Example: redis resource based on AWS ElastiCache + +This example configures a [redis](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#redis) Resource Definition using AWS ElastiCache. + +The created Resource Definition can be used in your Score file using: + +```yaml +resources: + ... + redis: + type: redis +``` + ## Requirements @@ -43,4 +56,4 @@ | name | Name of the example application | `string` | `"redis-test"` | no | | resource\_packs\_aws\_rev | AWS Resource Pack git branch | `string` | `"refs/heads/main"` | no | | resource\_packs\_aws\_url | AWS Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-aws.git"` | no | - \ No newline at end of file + diff --git a/examples/s3/README.md b/examples/s3/README.md index 6881e3b..e3f9b10 100644 --- a/examples/s3/README.md +++ b/examples/s3/README.md @@ -1,11 +1,11 @@ -# AWS S3 +# Example: s3 resource based on AWS S3 -This example configures an S3 bucket resource definition, with two different access policies: +This example configures a [s3](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#s3) Resource Definition using AWS S3, with two different access policies: * `basic-admin` (full access) * `basic-read-only` (read-only access) -Those resources can be used in your score file like: +Those Resource Definitions can be used in your Score file using: ```yaml resources: diff --git a/examples/sqs/README.md b/examples/sqs/README.md index 58baf1a..6099783 100644 --- a/examples/sqs/README.md +++ b/examples/sqs/README.md @@ -1,16 +1,16 @@ -# AWS SQS +# Example: sqs resource based on AWS SQS -This example configures an SQS queue resource definition, with two different access policies: +This example configures a [sqs](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#sqs) Resource Definition using AWS SQS, with two different access policies: * `basic-publisher` (allowed to send messages) * `basic-consumer` (allowed to receive messages) -Those resources can be used in your score file like: +Those Resource Definitions can be used in your Score file using: ```yaml resources: ... - sqs: + queue: type: sqs class: basic-publisher ``` diff --git a/humanitec-resource-defs/route53/basic/README.md b/humanitec-resource-defs/dns/basic/README.md similarity index 100% rename from humanitec-resource-defs/route53/basic/README.md rename to humanitec-resource-defs/dns/basic/README.md diff --git a/humanitec-resource-defs/route53/basic/main.tf b/humanitec-resource-defs/dns/basic/main.tf similarity index 95% rename from humanitec-resource-defs/route53/basic/main.tf rename to humanitec-resource-defs/dns/basic/main.tf index 19bb985..a1a62da 100644 --- a/humanitec-resource-defs/route53/basic/main.tf +++ b/humanitec-resource-defs/dns/basic/main.tf @@ -14,7 +14,7 @@ resource "humanitec_resource_definition" "main" { values_string = jsonencode({ source = { - path = "modules/route53/basic" + path = "modules/dns/basic" rev = var.resource_packs_aws_rev url = var.resource_packs_aws_url } diff --git a/humanitec-resource-defs/route53/basic/outputs.tf b/humanitec-resource-defs/dns/basic/outputs.tf similarity index 100% rename from humanitec-resource-defs/route53/basic/outputs.tf rename to humanitec-resource-defs/dns/basic/outputs.tf diff --git a/humanitec-resource-defs/route53/basic/providers.tf b/humanitec-resource-defs/dns/basic/providers.tf similarity index 100% rename from humanitec-resource-defs/route53/basic/providers.tf rename to humanitec-resource-defs/dns/basic/providers.tf diff --git a/humanitec-resource-defs/route53/basic/terraform.tfvars.example b/humanitec-resource-defs/dns/basic/terraform.tfvars.example similarity index 100% rename from humanitec-resource-defs/route53/basic/terraform.tfvars.example rename to humanitec-resource-defs/dns/basic/terraform.tfvars.example diff --git a/humanitec-resource-defs/route53/basic/variables.tf b/humanitec-resource-defs/dns/basic/variables.tf similarity index 100% rename from humanitec-resource-defs/route53/basic/variables.tf rename to humanitec-resource-defs/dns/basic/variables.tf diff --git a/modules/route53/basic/README.md b/modules/dns/basic/README.md similarity index 100% rename from modules/route53/basic/README.md rename to modules/dns/basic/README.md diff --git a/modules/route53/basic/main.tf b/modules/dns/basic/main.tf similarity index 100% rename from modules/route53/basic/main.tf rename to modules/dns/basic/main.tf diff --git a/modules/route53/basic/outputs.tf b/modules/dns/basic/outputs.tf similarity index 100% rename from modules/route53/basic/outputs.tf rename to modules/dns/basic/outputs.tf diff --git a/modules/route53/basic/providers.tf b/modules/dns/basic/providers.tf similarity index 100% rename from modules/route53/basic/providers.tf rename to modules/dns/basic/providers.tf diff --git a/modules/route53/basic/terraform.tfvars.example b/modules/dns/basic/terraform.tfvars.example similarity index 100% rename from modules/route53/basic/terraform.tfvars.example rename to modules/dns/basic/terraform.tfvars.example diff --git a/modules/route53/basic/variables.tf b/modules/dns/basic/variables.tf similarity index 100% rename from modules/route53/basic/variables.tf rename to modules/dns/basic/variables.tf