1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. kms
  5. getKMSKeyRing
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi

gcp.kms.getKMSKeyRing

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides access to Google Cloud Platform KMS KeyRing. For more information see the official documentation and API.

    A KeyRing is a grouping of CryptoKeys for organizational purposes. A KeyRing belongs to a Google Cloud Platform Project and resides in a specific location.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const myKeyRing = gcp.kms.getKMSKeyRing({
        name: "my-key-ring",
        location: "us-central1",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_key_ring = gcp.kms.get_kms_key_ring(name="my-key-ring",
        location="us-central1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kms.GetKMSKeyRing(ctx, &kms.GetKMSKeyRingArgs{
    			Name:     "my-key-ring",
    			Location: "us-central1",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var myKeyRing = Gcp.Kms.GetKMSKeyRing.Invoke(new()
        {
            Name = "my-key-ring",
            Location = "us-central1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.kms.KmsFunctions;
    import com.pulumi.gcp.kms.inputs.GetKMSKeyRingArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var myKeyRing = KmsFunctions.getKMSKeyRing(GetKMSKeyRingArgs.builder()
                .name("my-key-ring")
                .location("us-central1")
                .build());
    
        }
    }
    
    variables:
      myKeyRing:
        fn::invoke:
          Function: gcp:kms:getKMSKeyRing
          Arguments:
            name: my-key-ring
            location: us-central1
    

    Using getKMSKeyRing

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getKMSKeyRing(args: GetKMSKeyRingArgs, opts?: InvokeOptions): Promise<GetKMSKeyRingResult>
    function getKMSKeyRingOutput(args: GetKMSKeyRingOutputArgs, opts?: InvokeOptions): Output<GetKMSKeyRingResult>
    def get_kms_key_ring(location: Optional[str] = None,
                         name: Optional[str] = None,
                         project: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetKMSKeyRingResult
    def get_kms_key_ring_output(location: Optional[pulumi.Input[str]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         project: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetKMSKeyRingResult]
    func GetKMSKeyRing(ctx *Context, args *GetKMSKeyRingArgs, opts ...InvokeOption) (*GetKMSKeyRingResult, error)
    func GetKMSKeyRingOutput(ctx *Context, args *GetKMSKeyRingOutputArgs, opts ...InvokeOption) GetKMSKeyRingResultOutput

    > Note: This function is named GetKMSKeyRing in the Go SDK.

    public static class GetKMSKeyRing 
    {
        public static Task<GetKMSKeyRingResult> InvokeAsync(GetKMSKeyRingArgs args, InvokeOptions? opts = null)
        public static Output<GetKMSKeyRingResult> Invoke(GetKMSKeyRingInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKMSKeyRingResult> getKMSKeyRing(GetKMSKeyRingArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:kms/getKMSKeyRing:getKMSKeyRing
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Location string
    The Google Cloud Platform location for the KeyRing. A full list of valid locations can be found by running gcloud kms locations list.


    Name string
    The KeyRing's name. A KeyRing name must exist within the provided location and match the regular expression [a-zA-Z0-9_-]{1,63}
    Project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    Location string
    The Google Cloud Platform location for the KeyRing. A full list of valid locations can be found by running gcloud kms locations list.


    Name string
    The KeyRing's name. A KeyRing name must exist within the provided location and match the regular expression [a-zA-Z0-9_-]{1,63}
    Project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The Google Cloud Platform location for the KeyRing. A full list of valid locations can be found by running gcloud kms locations list.


    name String
    The KeyRing's name. A KeyRing name must exist within the provided location and match the regular expression [a-zA-Z0-9_-]{1,63}
    project String
    The project in which the resource belongs. If it is not provided, the provider project is used.
    location string
    The Google Cloud Platform location for the KeyRing. A full list of valid locations can be found by running gcloud kms locations list.


    name string
    The KeyRing's name. A KeyRing name must exist within the provided location and match the regular expression [a-zA-Z0-9_-]{1,63}
    project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    location str
    The Google Cloud Platform location for the KeyRing. A full list of valid locations can be found by running gcloud kms locations list.


    name str
    The KeyRing's name. A KeyRing name must exist within the provided location and match the regular expression [a-zA-Z0-9_-]{1,63}
    project str
    The project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The Google Cloud Platform location for the KeyRing. A full list of valid locations can be found by running gcloud kms locations list.


    name String
    The KeyRing's name. A KeyRing name must exist within the provided location and match the regular expression [a-zA-Z0-9_-]{1,63}
    project String
    The project in which the resource belongs. If it is not provided, the provider project is used.

    getKMSKeyRing Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Name string
    Project string
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Name string
    Project string
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    name String
    project String
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    name string
    project string
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    name str
    project str
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    name String
    project String

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi