Skip to content

Commit

Permalink
feat: iterate
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneswuerbach committed Dec 22, 2023
1 parent 7498761 commit 489e4b2
Show file tree
Hide file tree
Showing 19 changed files with 466 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plugin "terraform" {
enabled = true
preset = "recommended"
}

plugin "google" {
enabled = true
version = "0.26.0"
source = "github.com/terraform-linters/tflint-ruleset-google"
}
46 changes: 46 additions & 0 deletions examples/gcs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 1.3.0 |
| humanitec | ~> 0 |

## Providers

| Name | Version |
|------|---------|
| humanitec | ~> 0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| gcp\_service\_account\_workload | ../../humanitec-resource-defs/gcp-service-account/workload | n/a |
| gcs\_basic | ../../humanitec-resource-defs/gcs/basic | n/a |
| iam\_role\_binding\_gcs\_admin | ../../humanitec-resource-defs/iam-role-binding/gcs-admin | n/a |
| k8s\_service\_account | ../../humanitec-resource-defs/k8s/service-account | n/a |
| workload | ../../humanitec-resource-defs/workload/service-account | n/a |

## Resources

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

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| credentials | GCP credentials | `string` | n/a | yes |
| location | The location of the bucket | `string` | n/a | yes |
| project | GCP project ID | `string` | n/a | yes |
| humanitec\_application | n/a | `string` | `"gcs-test"` | no |
| resource\_packs\_gcp\_rev | GCP Resource Pack git ref | `string` | `"refs/heads/main"` | no |
| resource\_packs\_gcp\_url | GCP Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-gcp.git"` | no |
<!-- END_TF_DOCS -->
17 changes: 17 additions & 0 deletions examples/gcs/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# GCP credentials
credentials = ""

humanitec_application = "gcs-test"

# The location of the bucket
location = ""

# GCP project ID
project = ""

# GCP Resource Pack git ref
resource_packs_gcp_rev = "refs/heads/main"

# GCP Resource Pack git url
resource_packs_gcp_url = "https://github.com/humanitec-architecture/resource-packs-gcp.git"
37 changes: 37 additions & 0 deletions humanitec-resource-defs/gcp-service-account/workload/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 1.3.0 |
| humanitec | ~> 0 |

## Providers

| Name | Version |
|------|---------|
| humanitec | ~> 0 |

## Resources

| Name | Type |
|------|------|
| [humanitec_resource_definition.main](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| credentials | GCP credentials | `string` | n/a | yes |
| prefix | n/a | `string` | n/a | yes |
| project | GCP project ID | `string` | n/a | yes |
| roles | List of roles to assign to the service account | `set(string)` | n/a | yes |
| resource\_packs\_gcp\_rev | GCP Resource Pack git ref | `string` | `"refs/heads/main"` | no |
| resource\_packs\_gcp\_url | GCP Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-gcp.git"` | no |

## Outputs

| Name | Description |
|------|-------------|
| id | n/a |
<!-- END_TF_DOCS -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# GCP credentials
credentials = ""

prefix = ""

# GCP project ID
project = ""

# GCP Resource Pack git ref
resource_packs_gcp_rev = "refs/heads/main"

# GCP Resource Pack git url
resource_packs_gcp_url = "https://github.com/humanitec-architecture/resource-packs-gcp.git"

# List of roles to assign to the service account
roles = ""
38 changes: 38 additions & 0 deletions humanitec-resource-defs/gcs/basic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 1.3.0 |
| humanitec | ~> 0 |

## Providers

| Name | Version |
|------|---------|
| humanitec | ~> 0 |

## Resources

| Name | Type |
|------|------|
| [humanitec_resource_definition.main](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| credentials | GCP credentials | `string` | n/a | yes |
| location | The location of the bucket | `string` | n/a | yes |
| prefix | n/a | `string` | n/a | yes |
| project | GCP project ID | `string` | n/a | yes |
| force\_destroy | Whether to force destroy the bucket when deleting | `bool` | `false` | no |
| resource\_packs\_gcp\_rev | GCP Resource Pack git ref | `string` | `"refs/heads/main"` | no |
| resource\_packs\_gcp\_url | GCP Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-gcp.git"` | no |

## Outputs

| Name | Description |
|------|-------------|
| id | n/a |
<!-- END_TF_DOCS -->
20 changes: 20 additions & 0 deletions humanitec-resource-defs/gcs/basic/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# GCP credentials
credentials = ""

# Whether to force destroy the bucket when deleting
force_destroy = false

# The location of the bucket
location = ""

prefix = ""

# GCP project ID
project = ""

# GCP Resource Pack git ref
resource_packs_gcp_rev = "refs/heads/main"

# GCP Resource Pack git url
resource_packs_gcp_url = "https://github.com/humanitec-architecture/resource-packs-gcp.git"
36 changes: 36 additions & 0 deletions humanitec-resource-defs/iam-role-binding/gcs-admin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 1.3.0 |
| humanitec | ~> 0 |

## Providers

| Name | Version |
|------|---------|
| humanitec | ~> 0 |

## Resources

| Name | Type |
|------|------|
| [humanitec_resource_definition.main](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| credentials | GCP credentials | `string` | n/a | yes |
| prefix | n/a | `string` | n/a | yes |
| project | GCP project ID | `string` | n/a | yes |
| resource\_packs\_gcp\_rev | GCP Resource Pack git ref | `string` | `"refs/heads/main"` | no |
| resource\_packs\_gcp\_url | GCP Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-gcp.git"` | no |

## Outputs

| Name | Description |
|------|-------------|
| id | n/a |
<!-- END_TF_DOCS -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# GCP credentials
credentials = ""

prefix = ""

# GCP project ID
project = ""

# GCP Resource Pack git ref
resource_packs_gcp_rev = "refs/heads/main"

# GCP Resource Pack git url
resource_packs_gcp_url = "https://github.com/humanitec-architecture/resource-packs-gcp.git"
32 changes: 32 additions & 0 deletions humanitec-resource-defs/k8s/service-account/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 1.3.0 |
| humanitec | ~> 0 |

## Providers

| Name | Version |
|------|---------|
| humanitec | ~> 0 |

## Resources

| Name | Type |
|------|------|
| [humanitec_resource_definition.main](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| prefix | n/a | `string` | `""` | no |

## Outputs

| Name | Description |
|------|-------------|
| id | n/a |
<!-- END_TF_DOCS -->
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prefix = ""
32 changes: 32 additions & 0 deletions humanitec-resource-defs/workload/service-account/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 1.3.0 |
| humanitec | ~> 0 |

## Providers

| Name | Version |
|------|---------|
| humanitec | ~> 0 |

## Resources

| Name | Type |
|------|------|
| [humanitec_resource_definition.main](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| prefix | n/a | `string` | `""` | no |

## Outputs

| Name | Description |
|------|-------------|
| id | n/a |
<!-- END_TF_DOCS -->
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prefix = ""
42 changes: 42 additions & 0 deletions modules/gcp-service-account/workload/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 1.3.0 |
| google | ~> 5.1 |

## Providers

| Name | Version |
|------|---------|
| google | ~> 5.1 |

## Resources

| Name | Type |
|------|------|
| [google_project_iam_member.role](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project_iam_member) | resource |
| [google_service_account.main](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_account) | resource |
| [google_service_account_iam_member.workload_identity_k8s_service_account](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_account_iam_member) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| app\_id | n/a | `string` | n/a | yes |
| credentials | GCP credentials | `string` | n/a | yes |
| env\_id | n/a | `string` | n/a | yes |
| namespace | k8s namespace | `string` | n/a | yes |
| prefix | n/a | `string` | n/a | yes |
| project | GCP project ID | `string` | n/a | yes |
| res\_id | n/a | `string` | n/a | yes |
| roles | List of roles to assign to the service account | `set(string)` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| email | n/a |
| k8s\_service\_account\_name | n/a |
<!-- END_TF_DOCS -->
19 changes: 19 additions & 0 deletions modules/gcp-service-account/workload/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
app_id = ""

# GCP credentials
credentials = ""

env_id = ""

# k8s namespace
namespace = ""

prefix = ""

# GCP project ID
project = ""

res_id = ""

# List of roles to assign to the service account
roles = ""
Loading

0 comments on commit 489e4b2

Please sign in to comment.