cluster_role_binding#

State module for managing Kubernetes ClusterRoleBinding.

async idem_k8s.states.k8s.rbac.v1.cluster_role_binding.present(hub, ctx, name: str, metadata: Dict, role_ref: Dict, subjects: List, resource_id: str = None) Dict[str, Any][source]#

Create a ClusterRoleBinding

Parameters:
  • name (str) – An Idem name of the resource.

  • resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.

  • metadata (dict) – Standard object’s metadata.

  • role_ref (dict) – RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.

  • subjects (list) – Subjects holds references to the objects the role applies to.

Returns:

Dict[str, Any]

Examples

resource_is_present:
  k8s.rbac.v1.cluster_role_binding.present:
      - name: idem-test-cluster-role-binding
      - metadata:
          annotations:
            rbac.authorization.kubernetes.io/autoupdate: 'true'
          labels:
            kubernetes.io/bootstrapping: rbac-defaults
          name: idem-test-cluster-role-binding
      - role_ref:
          api_group: rbac.authorization.k8s.io
          kind: ClusterRole
          name: idem-test-cluster-role-binding
      - subjects:
        - api_group: rbac.authorization.k8s.io
          kind: User
          name: idem-test-cluster-role-binding
async idem_k8s.states.k8s.rbac.v1.cluster_role_binding.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any][source]#

Delete a ClusterRoleBinding

Parameters:
  • name (str) – An Idem name of the resource.

  • resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.

Returns:

Dict[str, Any]

Examples

resource_is_absent:
  k8s.rbac.v1.cluster_role_binding.absent:
    - name: value
    - resource_id: value
async idem_k8s.states.k8s.rbac.v1.cluster_role_binding.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe the resource in a way that can be recreated/managed with the corresponding “present” function.

list or watch objects of kind ClusterRoleBinding

Returns:

Dict[str, Dict[str, Any]]

Examples

$ idem describe k8s.rbac.v1.cluster_role_binding