Google Cloud Native is in preview. Google Cloud Classic is fully supported.
google-native.iam/v1.Key
Explore with Pulumi AI
Google Cloud Native is in preview. Google Cloud Classic is fully supported.
Creates a ServiceAccountKey. Auto-naming is currently not supported for this resource.
Create Key Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Key(name: string, args: KeyArgs, opts?: CustomResourceOptions);@overload
def Key(resource_name: str,
        args: KeyArgs,
        opts: Optional[ResourceOptions] = None)
@overload
def Key(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        service_account_id: Optional[str] = None,
        key_algorithm: Optional[KeyKeyAlgorithm] = None,
        private_key_type: Optional[KeyPrivateKeyType] = None,
        project: Optional[str] = None)func NewKey(ctx *Context, name string, args KeyArgs, opts ...ResourceOption) (*Key, error)public Key(string name, KeyArgs args, CustomResourceOptions? opts = null)type: google-native:iam/v1:Key
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var google_nativeKeyResource = new GoogleNative.IAM.V1.Key("google-nativeKeyResource", new()
{
    ServiceAccountId = "string",
    KeyAlgorithm = GoogleNative.IAM.V1.KeyKeyAlgorithm.KeyAlgUnspecified,
    PrivateKeyType = GoogleNative.IAM.V1.KeyPrivateKeyType.TypeUnspecified,
    Project = "string",
});
example, err := iam.NewKey(ctx, "google-nativeKeyResource", &iam.KeyArgs{
	ServiceAccountId: pulumi.String("string"),
	KeyAlgorithm:     iam.KeyKeyAlgorithmKeyAlgUnspecified,
	PrivateKeyType:   iam.KeyPrivateKeyTypeTypeUnspecified,
	Project:          pulumi.String("string"),
})
var google_nativeKeyResource = new Key("google-nativeKeyResource", KeyArgs.builder()
    .serviceAccountId("string")
    .keyAlgorithm("KEY_ALG_UNSPECIFIED")
    .privateKeyType("TYPE_UNSPECIFIED")
    .project("string")
    .build());
google_native_key_resource = google_native.iam.v1.Key("google-nativeKeyResource",
    service_account_id="string",
    key_algorithm=google_native.iam.v1.KeyKeyAlgorithm.KEY_ALG_UNSPECIFIED,
    private_key_type=google_native.iam.v1.KeyPrivateKeyType.TYPE_UNSPECIFIED,
    project="string")
const google_nativeKeyResource = new google_native.iam.v1.Key("google-nativeKeyResource", {
    serviceAccountId: "string",
    keyAlgorithm: google_native.iam.v1.KeyKeyAlgorithm.KeyAlgUnspecified,
    privateKeyType: google_native.iam.v1.KeyPrivateKeyType.TypeUnspecified,
    project: "string",
});
type: google-native:iam/v1:Key
properties:
    keyAlgorithm: KEY_ALG_UNSPECIFIED
    privateKeyType: TYPE_UNSPECIFIED
    project: string
    serviceAccountId: string
Key Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Key resource accepts the following input properties:
- ServiceAccount stringId 
- KeyAlgorithm Pulumi.Google Native. IAM. V1. Key Key Algorithm 
- Which type of key and algorithm to use for the key. The default is currently a 2K RSA key. However this may change in the future.
- PrivateKey Pulumi.Type Google Native. IAM. V1. Key Private Key Type 
- The output format of the private key. The default value is TYPE_GOOGLE_CREDENTIALS_FILE, which is the Google Credentials File format.
- Project string
- ServiceAccount stringId 
- KeyAlgorithm KeyKey Algorithm 
- Which type of key and algorithm to use for the key. The default is currently a 2K RSA key. However this may change in the future.
- PrivateKey KeyType Private Key Type 
- The output format of the private key. The default value is TYPE_GOOGLE_CREDENTIALS_FILE, which is the Google Credentials File format.
- Project string
- serviceAccount StringId 
- keyAlgorithm KeyKey Algorithm 
- Which type of key and algorithm to use for the key. The default is currently a 2K RSA key. However this may change in the future.
- privateKey KeyType Private Key Type 
- The output format of the private key. The default value is TYPE_GOOGLE_CREDENTIALS_FILE, which is the Google Credentials File format.
- project String
- serviceAccount stringId 
- keyAlgorithm KeyKey Algorithm 
- Which type of key and algorithm to use for the key. The default is currently a 2K RSA key. However this may change in the future.
- privateKey KeyType Private Key Type 
- The output format of the private key. The default value is TYPE_GOOGLE_CREDENTIALS_FILE, which is the Google Credentials File format.
- project string
- service_account_ strid 
- key_algorithm KeyKey Algorithm 
- Which type of key and algorithm to use for the key. The default is currently a 2K RSA key. However this may change in the future.
- private_key_ Keytype Private Key Type 
- The output format of the private key. The default value is TYPE_GOOGLE_CREDENTIALS_FILE, which is the Google Credentials File format.
- project str
- serviceAccount StringId 
- keyAlgorithm "KEY_ALG_UNSPECIFIED" | "KEY_ALG_RSA_1024" | "KEY_ALG_RSA_2048"
- Which type of key and algorithm to use for the key. The default is currently a 2K RSA key. However this may change in the future.
- privateKey "TYPE_UNSPECIFIED" | "TYPE_PKCS12_FILE" | "TYPE_GOOGLE_CREDENTIALS_FILE"Type 
- The output format of the private key. The default value is TYPE_GOOGLE_CREDENTIALS_FILE, which is the Google Credentials File format.
- project String
Outputs
All input properties are implicitly available as output properties. Additionally, the Key resource produces the following output properties:
- Disabled bool
- The key status.
- Id string
- The provider-assigned unique ID for this managed resource.
- KeyOrigin string
- The key origin.
- KeyType string
- The key type.
- Name string
- The resource name of the service account key in the following format projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}.
- PrivateKey stringData 
- The private key data. Only provided in CreateServiceAccountKeyresponses. Make sure to keep the private key data secure because it allows for the assertion of the service account identity. When base64 decoded, the private key data can be used to authenticate with Google API client libraries and with gcloud auth activate-service-account.
- PublicKey stringData 
- The public key data. Only provided in GetServiceAccountKeyresponses.
- ValidAfter stringTime 
- The key can be used after this timestamp.
- ValidBefore stringTime 
- The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
- Disabled bool
- The key status.
- Id string
- The provider-assigned unique ID for this managed resource.
- KeyOrigin string
- The key origin.
- KeyType string
- The key type.
- Name string
- The resource name of the service account key in the following format projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}.
- PrivateKey stringData 
- The private key data. Only provided in CreateServiceAccountKeyresponses. Make sure to keep the private key data secure because it allows for the assertion of the service account identity. When base64 decoded, the private key data can be used to authenticate with Google API client libraries and with gcloud auth activate-service-account.
- PublicKey stringData 
- The public key data. Only provided in GetServiceAccountKeyresponses.
- ValidAfter stringTime 
- The key can be used after this timestamp.
- ValidBefore stringTime 
- The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
- disabled Boolean
- The key status.
- id String
- The provider-assigned unique ID for this managed resource.
- keyOrigin String
- The key origin.
- keyType String
- The key type.
- name String
- The resource name of the service account key in the following format projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}.
- privateKey StringData 
- The private key data. Only provided in CreateServiceAccountKeyresponses. Make sure to keep the private key data secure because it allows for the assertion of the service account identity. When base64 decoded, the private key data can be used to authenticate with Google API client libraries and with gcloud auth activate-service-account.
- publicKey StringData 
- The public key data. Only provided in GetServiceAccountKeyresponses.
- validAfter StringTime 
- The key can be used after this timestamp.
- validBefore StringTime 
- The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
- disabled boolean
- The key status.
- id string
- The provider-assigned unique ID for this managed resource.
- keyOrigin string
- The key origin.
- keyType string
- The key type.
- name string
- The resource name of the service account key in the following format projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}.
- privateKey stringData 
- The private key data. Only provided in CreateServiceAccountKeyresponses. Make sure to keep the private key data secure because it allows for the assertion of the service account identity. When base64 decoded, the private key data can be used to authenticate with Google API client libraries and with gcloud auth activate-service-account.
- publicKey stringData 
- The public key data. Only provided in GetServiceAccountKeyresponses.
- validAfter stringTime 
- The key can be used after this timestamp.
- validBefore stringTime 
- The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
- disabled bool
- The key status.
- id str
- The provider-assigned unique ID for this managed resource.
- key_origin str
- The key origin.
- key_type str
- The key type.
- name str
- The resource name of the service account key in the following format projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}.
- private_key_ strdata 
- The private key data. Only provided in CreateServiceAccountKeyresponses. Make sure to keep the private key data secure because it allows for the assertion of the service account identity. When base64 decoded, the private key data can be used to authenticate with Google API client libraries and with gcloud auth activate-service-account.
- public_key_ strdata 
- The public key data. Only provided in GetServiceAccountKeyresponses.
- valid_after_ strtime 
- The key can be used after this timestamp.
- valid_before_ strtime 
- The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
- disabled Boolean
- The key status.
- id String
- The provider-assigned unique ID for this managed resource.
- keyOrigin String
- The key origin.
- keyType String
- The key type.
- name String
- The resource name of the service account key in the following format projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}.
- privateKey StringData 
- The private key data. Only provided in CreateServiceAccountKeyresponses. Make sure to keep the private key data secure because it allows for the assertion of the service account identity. When base64 decoded, the private key data can be used to authenticate with Google API client libraries and with gcloud auth activate-service-account.
- publicKey StringData 
- The public key data. Only provided in GetServiceAccountKeyresponses.
- validAfter StringTime 
- The key can be used after this timestamp.
- validBefore StringTime 
- The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
Supporting Types
KeyKeyAlgorithm, KeyKeyAlgorithmArgs      
- KeyAlg Unspecified 
- KEY_ALG_UNSPECIFIEDAn unspecified key algorithm.
- KeyAlg Rsa1024 
- KEY_ALG_RSA_10241k RSA Key.
- KeyAlg Rsa2048 
- KEY_ALG_RSA_20482k RSA Key.
- KeyKey Algorithm Key Alg Unspecified 
- KEY_ALG_UNSPECIFIEDAn unspecified key algorithm.
- KeyKey Algorithm Key Alg Rsa1024 
- KEY_ALG_RSA_10241k RSA Key.
- KeyKey Algorithm Key Alg Rsa2048 
- KEY_ALG_RSA_20482k RSA Key.
- KeyAlg Unspecified 
- KEY_ALG_UNSPECIFIEDAn unspecified key algorithm.
- KeyAlg Rsa1024 
- KEY_ALG_RSA_10241k RSA Key.
- KeyAlg Rsa2048 
- KEY_ALG_RSA_20482k RSA Key.
- KeyAlg Unspecified 
- KEY_ALG_UNSPECIFIEDAn unspecified key algorithm.
- KeyAlg Rsa1024 
- KEY_ALG_RSA_10241k RSA Key.
- KeyAlg Rsa2048 
- KEY_ALG_RSA_20482k RSA Key.
- KEY_ALG_UNSPECIFIED
- KEY_ALG_UNSPECIFIEDAn unspecified key algorithm.
- KEY_ALG_RSA1024
- KEY_ALG_RSA_10241k RSA Key.
- KEY_ALG_RSA2048
- KEY_ALG_RSA_20482k RSA Key.
- "KEY_ALG_UNSPECIFIED"
- KEY_ALG_UNSPECIFIEDAn unspecified key algorithm.
- "KEY_ALG_RSA_1024"
- KEY_ALG_RSA_10241k RSA Key.
- "KEY_ALG_RSA_2048"
- KEY_ALG_RSA_20482k RSA Key.
KeyPrivateKeyType, KeyPrivateKeyTypeArgs        
- TypeUnspecified 
- TYPE_UNSPECIFIEDUnspecified. Equivalent to TYPE_GOOGLE_CREDENTIALS_FILE.
- TypePkcs12File 
- TYPE_PKCS12_FILEPKCS12 format. The password for the PKCS12 file is notasecret. For more information, see https://tools.ietf.org/html/rfc7292.
- TypeGoogle Credentials File 
- TYPE_GOOGLE_CREDENTIALS_FILEGoogle Credentials File format.
- KeyPrivate Key Type Type Unspecified 
- TYPE_UNSPECIFIEDUnspecified. Equivalent to TYPE_GOOGLE_CREDENTIALS_FILE.
- KeyPrivate Key Type Type Pkcs12File 
- TYPE_PKCS12_FILEPKCS12 format. The password for the PKCS12 file is notasecret. For more information, see https://tools.ietf.org/html/rfc7292.
- KeyPrivate Key Type Type Google Credentials File 
- TYPE_GOOGLE_CREDENTIALS_FILEGoogle Credentials File format.
- TypeUnspecified 
- TYPE_UNSPECIFIEDUnspecified. Equivalent to TYPE_GOOGLE_CREDENTIALS_FILE.
- TypePkcs12File 
- TYPE_PKCS12_FILEPKCS12 format. The password for the PKCS12 file is notasecret. For more information, see https://tools.ietf.org/html/rfc7292.
- TypeGoogle Credentials File 
- TYPE_GOOGLE_CREDENTIALS_FILEGoogle Credentials File format.
- TypeUnspecified 
- TYPE_UNSPECIFIEDUnspecified. Equivalent to TYPE_GOOGLE_CREDENTIALS_FILE.
- TypePkcs12File 
- TYPE_PKCS12_FILEPKCS12 format. The password for the PKCS12 file is notasecret. For more information, see https://tools.ietf.org/html/rfc7292.
- TypeGoogle Credentials File 
- TYPE_GOOGLE_CREDENTIALS_FILEGoogle Credentials File format.
- TYPE_UNSPECIFIED
- TYPE_UNSPECIFIEDUnspecified. Equivalent to TYPE_GOOGLE_CREDENTIALS_FILE.
- TYPE_PKCS12_FILE
- TYPE_PKCS12_FILEPKCS12 format. The password for the PKCS12 file is notasecret. For more information, see https://tools.ietf.org/html/rfc7292.
- TYPE_GOOGLE_CREDENTIALS_FILE
- TYPE_GOOGLE_CREDENTIALS_FILEGoogle Credentials File format.
- "TYPE_UNSPECIFIED"
- TYPE_UNSPECIFIEDUnspecified. Equivalent to TYPE_GOOGLE_CREDENTIALS_FILE.
- "TYPE_PKCS12_FILE"
- TYPE_PKCS12_FILEPKCS12 format. The password for the PKCS12 file is notasecret. For more information, see https://tools.ietf.org/html/rfc7292.
- "TYPE_GOOGLE_CREDENTIALS_FILE"
- TYPE_GOOGLE_CREDENTIALS_FILEGoogle Credentials File format.
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.