ContinueOps

    continueops

    by: ContinueOps·Resilience & Disaster Recovery

    Published
    Published 4 days ago
    Version
    0.4.0
    Source
    app.terraform.io/continueops/continueops
    Documentation

    continueops_rbac_binding (Resource)

    Grants a role on a set of runbooks to a subject: every member, an IdP group, or one person.

    • Subject: subject_kind = "all_members"; "group" with subject_group (and optionally connection_id to only match the group from one SSO connection); or "user" with subject_user_id.
    • Scope: scope_kind = "tenant" (every runbook); "tag" with scope_tag_id (runbooks carrying the tag); or "terraform_managed" (runbook templates written by Terraform, see managed_by on continueops_runbook_template).

    Bindings only restrict anyone while continueops_rbac_settings has runbook_default_access = "bindings"; with the default, members, every member keeps full access and bindings are prepared but inert.

    Changing the subject or the scope replaces the binding (briefly removing that access); role_id and description change in place.

    Example Usage

    data "continueops_rbac_role" "editor" {
      key = "runbook_editor"
    }
    
    # Members of an IdP group may edit the runbooks carrying a tag.
    resource "continueops_rbac_binding" "payments_owners" {
      role_id       = data.continueops_rbac_role.editor.id
      subject_kind  = "group"
      subject_group = "CO-Payments-Runbook-Owners"
      scope_kind    = "tag"
      scope_tag_id  = continueops_tag.payments_critical.id
      description   = "Payments team owns its runbooks"
    }
    
    # Every member may run the runbooks Terraform manages.
    resource "continueops_rbac_binding" "everyone_runs_managed" {
      role_id      = continueops_rbac_role.operator.id
      subject_kind = "all_members"
      scope_kind   = "terraform_managed"
    }

    Schema

    Required

    • role_id (String) Id of the role granted: a continueops_rbac_role resource, or a built-in role via the continueops_rbac_role data source. Can be changed in place.
    • scope_kind (String) Which runbooks: tenant, tag or terraform_managed.
    • subject_kind (String) Who gets the role: all_members, group or user.

    Optional

    • connection_id (String) Only with subject_kind = "group": match the group only for people who signed in through this continueops_sso_connection. Null: the group from any connection.
    • description (String) Why the binding exists.
    • scope_tag_id (String) Id of the continueops_tag. Required when scope_kind is tag, otherwise not allowed.
    • subject_group (String) The IdP group, as the IdP sends it. Required when subject_kind is group, otherwise not allowed.
    • subject_user_id (String) User id of the person. Required when subject_kind is user, otherwise not allowed.
    • timeouts (Attributes) (see below for nested schema)

    Read-Only

    • created_at (String) When the binding was created (RFC 3339, UTC).
    • created_by (String) User id of whoever created it (the API key's owner).
    • id (String) Binding id (UUID).
    • tenant_id (String) Id of the tenant (UUID).

    Nested Schema for timeouts

    Optional:

    • create (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    • delete (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    • read (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    • update (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

    Import

    Import is supported using the following syntax:

    In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

    import {
      to = continueops_rbac_binding.example
      id = "00000000-0000-4000-8000-000000000000"
    }

    The terraform import command can be used, for example:

    # Import by id (UUID).
    terraform import continueops_rbac_binding.example 00000000-0000-4000-8000-000000000000