mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-14 23:17:15 +00:00
7e82a982e4
* fix service account key data source name * switch id to name * update docs * doc format * fixes for validation and tests * last fixes for service account key data source
1.5 KiB
1.5 KiB
layout | page_title | sidebar_current | description |
---|---|---|---|
Google: google_service_account_key | docs-google-datasource-service-account-key | Get a Google Cloud Platform service account Public Key |
google_service_account_key
Get service account public key. For more information, see the official documentation and API.
Example Usage
resource "google_service_account" "myaccount" {
account_id = "dev-foo-account"
}
resource "google_service_account_key" "mykey" {
service_account_id = "${google_service_account.myaccount.name}"
}
data "google_service_account_key" "mykey" {
name = "${google_service_account_key.mykey.name}"
public_key_type = "TYPE_X509_PEM_FILE"
}
Argument Reference
The following arguments are supported:
-
name
- (Required) The name of the service account key. This must have formatprojects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{KEYID}
, where{ACCOUNT}
is the email address or unique id of the service account. -
project
- (Optional) The ID of the project that the service account will be created in. Defaults to the provider project configuration. -
public_key_type
(Optional) The output format of the public key requested. X509_PEM is the default output format.
Attributes Reference
The following attributes are exported in addition to the arguments listed above:
public_key
- The public key, base64 encoded