key_ring#

Exec module for managing Cloud Key Management Service key rings.

async idem_gcp.exec.gcp.cloudkms.key_ring.get(hub, ctx, resource_id: str)[source]#

Returns a key ring by its Idem resource ID.

Parameters:

resource_id (str) – Idem resource ID. projects/{project id}/locations/{location id}/keyRings/{keyRing}

Returns:

Key resource

Examples

{% set project_id = 'project-name' %}
{% set location_id = 'us-east1' %}
{% set key_ring = 'key-ring' %}
get-key-ring:
    exec.run:
        - path: gcp.cloudkms.key_ring.get
        - kwargs:
              resource_id: projects/{{project_id}}/locations/{{location_id}}/keyRings/{{key_ring}}
async idem_gcp.exec.gcp.cloudkms.key_ring.list_(hub, ctx, location: str, filter_: (<class 'str'>, 'alias=filter') = None, order_by: str = None) Dict[str, Any][source]#

Retrieves key rings under specific location.

Parameters:
  • location (str) – Location ID to be searched for key rings.

  • filter (str, Optional) – Only include resources that match the filter in the response. For more information, see Sorting and filtering list results.

  • order_by (str, Optional) – Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see Sorting and filtering list results.

Examples

list-locations:
    exec.run:
       - path: gcp.cloudkms.location.list
       - kwargs:
             project: project-name

#!require:list-locations
list-key-rings:
    exec.run:
       - path: gcp.cloudkms.key_ring.list
       - kwargs:
             location: {% for v in hub.idem.arg_bind.resolve('${exec:list-locations}') -%}
                           {{ v['resource_id'] if v.get('display_name') == 'South Carolina' }}
                       {%- endfor %}

#!END

list-global-key-rings:
    exec.run:
       - path: gcp.cloudkms.key_ring.list
       - kwargs:
             location: projects/project-name/locations/global
             filter_: NOT name=projects/project-name/locations/global/keyRings/kr-global-test