Skip to content

Commit

Permalink
Merge pull request #9 from johanneswuerbach/gcp-iam-policy-binding
Browse files Browse the repository at this point in the history
feat: use gcp-iam-policy-binding
  • Loading branch information
johanneswuerbach authored Feb 20, 2024
2 parents 8502811 + 362388f commit 8cb77c3
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/gcs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ The workload service account will automatically be assigned the necessary GCP Se
| gcs\_basic | ../../humanitec-resource-defs/gcs/basic | n/a |
| gcs\_basic\_admin | ../../humanitec-resource-defs/gcs/passthrough | n/a |
| gcs\_basic\_read\_only | ../../humanitec-resource-defs/gcs/passthrough | n/a |
| iam\_role\_binding\_gcs\_admin | ../../humanitec-resource-defs/iam-role-binding/gcs | n/a |
| iam\_role\_binding\_gcs\_read\_only | ../../humanitec-resource-defs/iam-role-binding/gcs | n/a |
| iam\_role\_binding\_gcs\_admin | ../../humanitec-resource-defs/gcp-iam-policy-binding/gcs | n/a |
| iam\_role\_binding\_gcs\_read\_only | ../../humanitec-resource-defs/gcp-iam-policy-binding/gcs | n/a |
| k8s\_service\_account | ../../humanitec-resource-defs/k8s/service-account | n/a |
| workload | ../../humanitec-resource-defs/workload/service-account | n/a |
Expand Down
4 changes: 2 additions & 2 deletions examples/gcs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ resource "humanitec_resource_definition_criteria" "gcs_basic" {
## Policy

module "iam_role_binding_gcs_admin" {
source = "../../humanitec-resource-defs/iam-role-binding/gcs"
source = "../../humanitec-resource-defs/gcp-iam-policy-binding/gcs"

prefix = var.prefix

Expand Down Expand Up @@ -80,7 +80,7 @@ resource "humanitec_resource_definition_criteria" "gcs_basic_admin" {
## Policy

module "iam_role_binding_gcs_read_only" {
source = "../../humanitec-resource-defs/iam-role-binding/gcs"
source = "../../humanitec-resource-defs/gcp-iam-policy-binding/gcs"

prefix = var.prefix

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
resource "humanitec_resource_definition" "main" {
driver_type = "humanitec/template"
id = "${var.prefix}iam-role-biding-gcs-${var.name}"
name = "${var.prefix}iam-role-biding-gcs-${var.name}"
id = "${var.prefix}gcp-iam-policy-binding-gcs-${var.name}"
name = "${var.prefix}gcp-iam-policy-binding-gcs-${var.name}"

# TODO Switch the GCP type once available
type = "aws-policy"
type = "gcp-iam-policy-binding"

driver_inputs = {
values_string = jsonencode({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "humanitec_resource_definition" "main" {

namespace = "$${resources.k8s-namespace#k8s-namespace.outputs.namespace}"

bindings = "$${resources.workload>aws-policy.outputs.binding}"
bindings = "$${resources.workload>gcp-iam-policy-binding.outputs.binding}"

res_id = "$${context.res.id}"
app_id = "$${context.app.id}"
Expand Down
2 changes: 1 addition & 1 deletion humanitec-resource-defs/gcs/passthrough/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ EOL
}

provision = {
"aws-policy.${var.policy_resource_class}" = {
"gcp-iam-policy-binding.${var.policy_resource_class}" = {
match_dependents = true
is_dependent = false
}
Expand Down

0 comments on commit 8cb77c3

Please sign in to comment.