Google Cloud Native is in preview. Google Cloud Classic is fully supported.
google-native.apikeys/v2.getKey
Explore with Pulumi AI
Google Cloud Native is in preview. Google Cloud Classic is fully supported.
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)
public static Output<GetKeyResult> getKey(GetKeyArgs args, InvokeOptions options)
fn::invoke:
  function: google-native:apikeys/v2:getKey
  arguments:
    # arguments dictionaryThe following arguments are supported:
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 GetKeyStringmethod.
- Name string
- The resource name of the key. The namehas the form:projects//locations/global/keys/. For example:projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2NOTE: Key is a global resource; hence the only supported value for location isglobal.
- Restrictions
Pulumi.Google Native. APIKeys. V2. Outputs. V2Restrictions Response 
- 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 GetKeyStringmethod.
- Name string
- The resource name of the key. The namehas the form:projects//locations/global/keys/. For example:projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2NOTE: Key is a global resource; hence the only supported value for location isglobal.
- 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 GetKeyStringmethod.
- name String
- The resource name of the key. The namehas the form:projects//locations/global/keys/. For example:projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2NOTE: Key is a global resource; hence the only supported value for location isglobal.
- 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 GetKeyStringmethod.
- name string
- The resource name of the key. The namehas the form:projects//locations/global/keys/. For example:projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2NOTE: Key is a global resource; hence the only supported value for location isglobal.
- 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 GetKeyStringmethod.
- name str
- The resource name of the key. The namehas the form:projects//locations/global/keys/. For example:projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2NOTE: Key is a global resource; hence the only supported value for location isglobal.
- 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 GetKeyStringmethod.
- name String
- The resource name of the key. The namehas the form:projects//locations/global/keys/. For example:projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2NOTE: Key is a global resource; hence the only supported value for location isglobal.
- 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.Google Native. APIKeys. V2. Inputs. V2Android Application Response> 
- A list of Android applications that are allowed to make API calls with this key.
- AllowedApplications []V2AndroidApplication Response 
- A list of Android applications that are allowed to make API calls with this key.
- allowedApplications List<V2AndroidApplication Response> 
- A list of Android applications that are allowed to make API calls with this key.
- allowedApplications V2AndroidApplication Response[] 
- A list of Android applications that are allowed to make API calls with this key.
- allowed_applications Sequence[V2AndroidApplication Response] 
- 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.GetSupportedLanguageTranslateTextGet*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 usegcloud services listto 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.GetSupportedLanguageTranslateTextGet*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 usegcloud services listto 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.GetSupportedLanguageTranslateTextGet*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 usegcloud services listto 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.GetSupportedLanguageTranslateTextGet*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 usegcloud services listto 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.GetSupportedLanguageTranslateTextGet*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 usegcloud services listto 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.GetSupportedLanguageTranslateTextGet*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 usegcloud services listto 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   
- AllowedBundle List<string>Ids 
- A list of bundle IDs that are allowed when making API calls with this key.
- AllowedBundle []stringIds 
- A list of bundle IDs that are allowed when making API calls with this key.
- allowedBundle List<String>Ids 
- A list of bundle IDs that are allowed when making API calls with this key.
- allowedBundle string[]Ids 
- A list of bundle IDs that are allowed when making API calls with this key.
- allowed_bundle_ Sequence[str]ids 
- A list of bundle IDs that are allowed when making API calls with this key.
- allowedBundle List<String>Ids 
- A list of bundle IDs that are allowed when making API calls with this key.
V2RestrictionsResponse 
- AndroidKey Pulumi.Restrictions Google Native. APIKeys. V2. Inputs. V2Android Key Restrictions Response 
- The Android apps that are allowed to use the key.
- ApiTargets List<Pulumi.Google Native. APIKeys. V2. Inputs. V2Api Target Response> 
- 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.
- BrowserKey Pulumi.Restrictions Google Native. APIKeys. V2. Inputs. V2Browser Key Restrictions Response 
- The HTTP referrers (websites) that are allowed to use the key.
- IosKey Pulumi.Restrictions Google Native. APIKeys. V2. Inputs. V2Ios Key Restrictions Response 
- The iOS apps that are allowed to use the key.
- ServerKey Pulumi.Restrictions Google Native. APIKeys. V2. Inputs. V2Server Key Restrictions Response 
- The IP addresses of callers that are allowed to use the key.
- AndroidKey V2AndroidRestrictions Key Restrictions Response 
- The Android apps that are allowed to use the key.
- ApiTargets []V2ApiTarget Response 
- 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.
- BrowserKey V2BrowserRestrictions Key Restrictions Response 
- The HTTP referrers (websites) that are allowed to use the key.
- IosKey V2IosRestrictions Key Restrictions Response 
- The iOS apps that are allowed to use the key.
- ServerKey V2ServerRestrictions Key Restrictions Response 
- The IP addresses of callers that are allowed to use the key.
- androidKey V2AndroidRestrictions Key Restrictions Response 
- The Android apps that are allowed to use the key.
- apiTargets List<V2ApiTarget Response> 
- 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.
- browserKey V2BrowserRestrictions Key Restrictions Response 
- The HTTP referrers (websites) that are allowed to use the key.
- iosKey V2IosRestrictions Key Restrictions Response 
- The iOS apps that are allowed to use the key.
- serverKey V2ServerRestrictions Key Restrictions Response 
- The IP addresses of callers that are allowed to use the key.
- androidKey V2AndroidRestrictions Key Restrictions Response 
- The Android apps that are allowed to use the key.
- apiTargets V2ApiTarget Response[] 
- 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.
- browserKey V2BrowserRestrictions Key Restrictions Response 
- The HTTP referrers (websites) that are allowed to use the key.
- iosKey V2IosRestrictions Key Restrictions Response 
- The iOS apps that are allowed to use the key.
- serverKey V2ServerRestrictions Key Restrictions Response 
- The IP addresses of callers that are allowed to use the key.
- android_key_ V2Androidrestrictions Key Restrictions Response 
- The Android apps that are allowed to use the key.
- api_targets Sequence[V2ApiTarget Response] 
- 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_ V2Browserrestrictions Key Restrictions Response 
- The HTTP referrers (websites) that are allowed to use the key.
- ios_key_ V2Iosrestrictions Key Restrictions Response 
- The iOS apps that are allowed to use the key.
- server_key_ V2Serverrestrictions Key Restrictions Response 
- The IP addresses of callers that are allowed to use the key.
- androidKey Property MapRestrictions 
- 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.
- browserKey Property MapRestrictions 
- The HTTP referrers (websites) that are allowed to use the key.
- iosKey Property MapRestrictions 
- The iOS apps that are allowed to use the key.
- serverKey Property MapRestrictions 
- 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 Cloud Native is in preview. Google Cloud Classic is fully supported.