Can I use Terraform to create management groups?

Can I create an oidc filter using Terraform?
I can’t find the documentation.
Below is a cli example.

boundary managed-groups create oidc -name test -auth-method-id amoidc_tTz3xCZd2j -filter '"dev" in "/userinfo/groups"'
1 Like

Thanks for trying out Boundary @x980707x

We’re actually in progress on adding the managed group resource to the Terraform provider as I write this. Apologies for being tardy on adding this coverage. We’ll reach out on this thread as soon as it’s available.


Hi @malnick

Can I know when it will be released? If I can’t use terraform, I have to think of another way.


Looks like a commit was just recently added to the terraform provider adding the functionality. You might be able to try it out if you build it yourself.

I’m still waiting till the next release. For now I just use a local-exec hack, i.e.

resource "null_resource" "managed_group" {
  provisioner "local-exec" {
    command = <<EOT
export BOUNDARY_ADDR="${var.url}" \
&& export BOUNDARY_RECOVERY_CONFIG="${var.recovery_config_path}" \
&& GROUP_ID=$(boundary managed-groups create oidc -auth-method-id ${} -filter '"Admins" in "/userinfo/groups"' -format json | jq -r "") \
&& boundary roles add-principals -id ${} -principal $GROUP_ID \
&& boundary roles add-principals -id ${} -principal $GROUP_ID \
&& boundary roles add-principals -id ${} -principal $GROUP_ID

This hack requires that you have your KMS Recovery Config stored at var.recovery_config_path. It is an absolute path to a recovery kms config file like this:

kms "awskms" {
  purpose    = "recovery"
  key_id     = "global_root"
  kms_key_id = "arn:aws:kms:us-east-1:123456789012:key/05e633a3-ee51-4345-8c4f-19b7e525cfaf"
1 Like

@BrandonALXEllisSS Thanks! :grin:

Hey all,
We have just released the latest version of the Boundary Terraform Provider which now includes support for managed groups.

Please note I have not completed example usage yet - sorry about that, but the schema is pretty straight forward. Let us know if you have any issues!


I created manage groups using version 1.0.4
thank you!

1 Like