1. Packages
  2. Google Cloud Native
  3. API Docs
  4. apikeys
  5. apikeys/v2
  6. getKey

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi

google-native.apikeys/v2.getKey

Explore with Pulumi AI

google-native logo

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi

    Gets the metadata for an API key. The key string of the API key isn’t included in the response. NOTE: Key is a global resource; hence the only supported value for location is global.

    Using getKey

    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 getKey(args: GetKeyArgs, opts?: InvokeOptions): Promise<GetKeyResult>
    function getKeyOutput(args: GetKeyOutputArgs, opts?: InvokeOptions): Output<GetKeyResult>
    def get_key(key_id: Optional[str] = None,
                location: Optional[str] = None,
                project: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetKeyResult
    def get_key_output(key_id: Optional[pulumi.Input[str]] = None,
                location: Optional[pulumi.Input[str]] = None,
                project: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetKeyResult]
    func LookupKey(ctx *Context, args *LookupKeyArgs, opts ...InvokeOption) (*LookupKeyResult, error)
    func LookupKeyOutput(ctx *Context, args *LookupKeyOutputArgs, opts ...InvokeOption) LookupKeyResultOutput

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

    public static class GetKey 
    {
        public static Task<GetKeyResult> InvokeAsync(GetKeyArgs args, InvokeOptions? opts = null)
        public static Output<GetKeyResult> Invoke(GetKeyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKeyResult> getKey(GetKeyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: google-native:apikeys/v2:getKey
      arguments:
        # arguments dictionary

    The following arguments are supported:

    KeyId string
    Location string
    Project string
    KeyId string
    Location string
    Project string
    keyId String
    location String
    project String
    keyId string
    location string
    project string
    keyId String
    location String
    project String

    getKey Result

    The following output properties are available:

    Annotations Dictionary<string, string>
    Annotations is an unstructured key-value map stored with a policy that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.
    CreateTime string
    A timestamp identifying the time this key was originally created.
    DeleteTime string
    A timestamp when this key was deleted. If the resource is not deleted, this must be empty.
    DisplayName string
    Human-readable display name of this key that you can modify. The maximum length is 63 characters.
    Etag string
    A checksum computed by the server based on the current value of the Key resource. This may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. See https://google.aip.dev/154.
    KeyString string
    An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
    Name string
    The resource name of the key. The name has the form: projects//locations/global/keys/. For example: projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2 NOTE: Key is a global resource; hence the only supported value for location is global.
    Restrictions Pulumi.GoogleNative.APIKeys.V2.Outputs.V2RestrictionsResponse
    Key restrictions.
    Uid string
    Unique id in UUID4 format.
    UpdateTime string
    A timestamp identifying the time this key was last updated.
    Annotations map[string]string
    Annotations is an unstructured key-value map stored with a policy that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.
    CreateTime string
    A timestamp identifying the time this key was originally created.
    DeleteTime string
    A timestamp when this key was deleted. If the resource is not deleted, this must be empty.
    DisplayName string
    Human-readable display name of this key that you can modify. The maximum length is 63 characters.
    Etag string
    A checksum computed by the server based on the current value of the Key resource. This may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. See https://google.aip.dev/154.
    KeyString string
    An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
    Name string
    The resource name of the key. The name has the form: projects//locations/global/keys/. For example: projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2 NOTE: Key is a global resource; hence the only supported value for location is global.
    Restrictions V2RestrictionsResponse
    Key restrictions.
    Uid string
    Unique id in UUID4 format.
    UpdateTime string
    A timestamp identifying the time this key was last updated.
    annotations Map<String,String>
    Annotations is an unstructured key-value map stored with a policy that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.
    createTime String
    A timestamp identifying the time this key was originally created.
    deleteTime String
    A timestamp when this key was deleted. If the resource is not deleted, this must be empty.
    displayName String
    Human-readable display name of this key that you can modify. The maximum length is 63 characters.
    etag String
    A checksum computed by the server based on the current value of the Key resource. This may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. See https://google.aip.dev/154.
    keyString String
    An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
    name String
    The resource name of the key. The name has the form: projects//locations/global/keys/. For example: projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2 NOTE: Key is a global resource; hence the only supported value for location is global.
    restrictions V2RestrictionsResponse
    Key restrictions.
    uid String
    Unique id in UUID4 format.
    updateTime String
    A timestamp identifying the time this key was last updated.
    annotations {[key: string]: string}
    Annotations is an unstructured key-value map stored with a policy that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.
    createTime string
    A timestamp identifying the time this key was originally created.
    deleteTime string
    A timestamp when this key was deleted. If the resource is not deleted, this must be empty.
    displayName string
    Human-readable display name of this key that you can modify. The maximum length is 63 characters.
    etag string
    A checksum computed by the server based on the current value of the Key resource. This may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. See https://google.aip.dev/154.
    keyString string
    An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
    name string
    The resource name of the key. The name has the form: projects//locations/global/keys/. For example: projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2 NOTE: Key is a global resource; hence the only supported value for location is global.
    restrictions V2RestrictionsResponse
    Key restrictions.
    uid string
    Unique id in UUID4 format.
    updateTime string
    A timestamp identifying the time this key was last updated.
    annotations Mapping[str, str]
    Annotations is an unstructured key-value map stored with a policy that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.
    create_time str
    A timestamp identifying the time this key was originally created.
    delete_time str
    A timestamp when this key was deleted. If the resource is not deleted, this must be empty.
    display_name str
    Human-readable display name of this key that you can modify. The maximum length is 63 characters.
    etag str
    A checksum computed by the server based on the current value of the Key resource. This may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. See https://google.aip.dev/154.
    key_string str
    An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
    name str
    The resource name of the key. The name has the form: projects//locations/global/keys/. For example: projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2 NOTE: Key is a global resource; hence the only supported value for location is global.
    restrictions V2RestrictionsResponse
    Key restrictions.
    uid str
    Unique id in UUID4 format.
    update_time str
    A timestamp identifying the time this key was last updated.
    annotations Map<String>
    Annotations is an unstructured key-value map stored with a policy that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects.
    createTime String
    A timestamp identifying the time this key was originally created.
    deleteTime String
    A timestamp when this key was deleted. If the resource is not deleted, this must be empty.
    displayName String
    Human-readable display name of this key that you can modify. The maximum length is 63 characters.
    etag String
    A checksum computed by the server based on the current value of the Key resource. This may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. See https://google.aip.dev/154.
    keyString String
    An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
    name String
    The resource name of the key. The name has the form: projects//locations/global/keys/. For example: projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2 NOTE: Key is a global resource; hence the only supported value for location is global.
    restrictions Property Map
    Key restrictions.
    uid String
    Unique id in UUID4 format.
    updateTime String
    A timestamp identifying the time this key was last updated.

    Supporting Types

    V2AndroidApplicationResponse

    PackageName string
    The package name of the application.
    Sha1Fingerprint string
    The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.
    PackageName string
    The package name of the application.
    Sha1Fingerprint string
    The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.
    packageName String
    The package name of the application.
    sha1Fingerprint String
    The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.
    packageName string
    The package name of the application.
    sha1Fingerprint string
    The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.
    package_name str
    The package name of the application.
    sha1_fingerprint str
    The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.
    packageName String
    The package name of the application.
    sha1Fingerprint String
    The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.

    V2AndroidKeyRestrictionsResponse

    AllowedApplications List<Pulumi.GoogleNative.APIKeys.V2.Inputs.V2AndroidApplicationResponse>
    A list of Android applications that are allowed to make API calls with this key.
    AllowedApplications []V2AndroidApplicationResponse
    A list of Android applications that are allowed to make API calls with this key.
    allowedApplications List<V2AndroidApplicationResponse>
    A list of Android applications that are allowed to make API calls with this key.
    allowedApplications V2AndroidApplicationResponse[]
    A list of Android applications that are allowed to make API calls with this key.
    allowed_applications Sequence[V2AndroidApplicationResponse]
    A list of Android applications that are allowed to make API calls with this key.
    allowedApplications List<Property Map>
    A list of Android applications that are allowed to make API calls with this key.

    V2ApiTargetResponse

    Methods List<string>
    Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*
    Service string
    The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.
    Methods []string
    Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*
    Service string
    The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.
    methods List<String>
    Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*
    service String
    The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.
    methods string[]
    Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*
    service string
    The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.
    methods Sequence[str]
    Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*
    service str
    The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.
    methods List<String>
    Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*
    service String
    The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.

    V2BrowserKeyRestrictionsResponse

    AllowedReferrers List<string>
    A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.
    AllowedReferrers []string
    A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.
    allowedReferrers List<String>
    A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.
    allowedReferrers string[]
    A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.
    allowed_referrers Sequence[str]
    A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.
    allowedReferrers List<String>
    A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.

    V2IosKeyRestrictionsResponse

    AllowedBundleIds List<string>
    A list of bundle IDs that are allowed when making API calls with this key.
    AllowedBundleIds []string
    A list of bundle IDs that are allowed when making API calls with this key.
    allowedBundleIds List<String>
    A list of bundle IDs that are allowed when making API calls with this key.
    allowedBundleIds string[]
    A list of bundle IDs that are allowed when making API calls with this key.
    allowed_bundle_ids Sequence[str]
    A list of bundle IDs that are allowed when making API calls with this key.
    allowedBundleIds List<String>
    A list of bundle IDs that are allowed when making API calls with this key.

    V2RestrictionsResponse

    AndroidKeyRestrictions Pulumi.GoogleNative.APIKeys.V2.Inputs.V2AndroidKeyRestrictionsResponse
    The Android apps that are allowed to use the key.
    ApiTargets List<Pulumi.GoogleNative.APIKeys.V2.Inputs.V2ApiTargetResponse>
    A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
    BrowserKeyRestrictions Pulumi.GoogleNative.APIKeys.V2.Inputs.V2BrowserKeyRestrictionsResponse
    The HTTP referrers (websites) that are allowed to use the key.
    IosKeyRestrictions Pulumi.GoogleNative.APIKeys.V2.Inputs.V2IosKeyRestrictionsResponse
    The iOS apps that are allowed to use the key.
    ServerKeyRestrictions Pulumi.GoogleNative.APIKeys.V2.Inputs.V2ServerKeyRestrictionsResponse
    The IP addresses of callers that are allowed to use the key.
    AndroidKeyRestrictions V2AndroidKeyRestrictionsResponse
    The Android apps that are allowed to use the key.
    ApiTargets []V2ApiTargetResponse
    A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
    BrowserKeyRestrictions V2BrowserKeyRestrictionsResponse
    The HTTP referrers (websites) that are allowed to use the key.
    IosKeyRestrictions V2IosKeyRestrictionsResponse
    The iOS apps that are allowed to use the key.
    ServerKeyRestrictions V2ServerKeyRestrictionsResponse
    The IP addresses of callers that are allowed to use the key.
    androidKeyRestrictions V2AndroidKeyRestrictionsResponse
    The Android apps that are allowed to use the key.
    apiTargets List<V2ApiTargetResponse>
    A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
    browserKeyRestrictions V2BrowserKeyRestrictionsResponse
    The HTTP referrers (websites) that are allowed to use the key.
    iosKeyRestrictions V2IosKeyRestrictionsResponse
    The iOS apps that are allowed to use the key.
    serverKeyRestrictions V2ServerKeyRestrictionsResponse
    The IP addresses of callers that are allowed to use the key.
    androidKeyRestrictions V2AndroidKeyRestrictionsResponse
    The Android apps that are allowed to use the key.
    apiTargets V2ApiTargetResponse[]
    A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
    browserKeyRestrictions V2BrowserKeyRestrictionsResponse
    The HTTP referrers (websites) that are allowed to use the key.
    iosKeyRestrictions V2IosKeyRestrictionsResponse
    The iOS apps that are allowed to use the key.
    serverKeyRestrictions V2ServerKeyRestrictionsResponse
    The IP addresses of callers that are allowed to use the key.
    android_key_restrictions V2AndroidKeyRestrictionsResponse
    The Android apps that are allowed to use the key.
    api_targets Sequence[V2ApiTargetResponse]
    A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
    browser_key_restrictions V2BrowserKeyRestrictionsResponse
    The HTTP referrers (websites) that are allowed to use the key.
    ios_key_restrictions V2IosKeyRestrictionsResponse
    The iOS apps that are allowed to use the key.
    server_key_restrictions V2ServerKeyRestrictionsResponse
    The IP addresses of callers that are allowed to use the key.
    androidKeyRestrictions Property Map
    The Android apps that are allowed to use the key.
    apiTargets List<Property Map>
    A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
    browserKeyRestrictions Property Map
    The HTTP referrers (websites) that are allowed to use the key.
    iosKeyRestrictions Property Map
    The iOS apps that are allowed to use the key.
    serverKeyRestrictions Property Map
    The IP addresses of callers that are allowed to use the key.

    V2ServerKeyRestrictionsResponse

    AllowedIps List<string>
    A list of the caller IP addresses that are allowed to make API calls with this key.
    AllowedIps []string
    A list of the caller IP addresses that are allowed to make API calls with this key.
    allowedIps List<String>
    A list of the caller IP addresses that are allowed to make API calls with this key.
    allowedIps string[]
    A list of the caller IP addresses that are allowed to make API calls with this key.
    allowed_ips Sequence[str]
    A list of the caller IP addresses that are allowed to make API calls with this key.
    allowedIps List<String>
    A list of the caller IP addresses that are allowed to make API calls with this key.

    Package Details

    Repository
    Google Cloud Native pulumi/pulumi-google-native
    License
    Apache-2.0
    google-native logo

    Google Cloud Native is in preview. Google Cloud Classic is fully supported.

    Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi