Key
Creates and manages service account key-pairs, which allow the user to establish identity of a service account outside of GCP. For more information, see the official documentation and API.
Create a Key Resource
new Key(name: string, args: KeyArgs, opts?: CustomResourceOptions);def Key(resource_name, opts=None, key_algorithm=None, private_key_type=None, public_key_type=None, service_account_id=None, __props__=None);public Key(string name, KeyArgs args, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
Key Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Key resource accepts the following input properties:
- Service
Account stringId The Service account id of the Key Pair. This can be a string in the format
{ACCOUNT}orprojects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}, where{ACCOUNT}is the email address or unique id of the service account. If the{ACCOUNT}syntax is used, the project will be inferred from the account.- Key
Algorithm string The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. Valid values are listed at ServiceAccountPrivateKeyType (only used on create)
- Private
Key stringType The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format.
- Public
Key stringType The output format of the public key requested. X509_PEM is the default output format.
- Service
Account stringId The Service account id of the Key Pair. This can be a string in the format
{ACCOUNT}orprojects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}, where{ACCOUNT}is the email address or unique id of the service account. If the{ACCOUNT}syntax is used, the project will be inferred from the account.- Key
Algorithm string The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. Valid values are listed at ServiceAccountPrivateKeyType (only used on create)
- Private
Key stringType The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format.
- Public
Key stringType The output format of the public key requested. X509_PEM is the default output format.
- service
Account stringId The Service account id of the Key Pair. This can be a string in the format
{ACCOUNT}orprojects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}, where{ACCOUNT}is the email address or unique id of the service account. If the{ACCOUNT}syntax is used, the project will be inferred from the account.- key
Algorithm string The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. Valid values are listed at ServiceAccountPrivateKeyType (only used on create)
- private
Key stringType The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format.
- public
Key stringType The output format of the public key requested. X509_PEM is the default output format.
- service_
account_ strid The Service account id of the Key Pair. This can be a string in the format
{ACCOUNT}orprojects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}, where{ACCOUNT}is the email address or unique id of the service account. If the{ACCOUNT}syntax is used, the project will be inferred from the account.- key_
algorithm str The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. Valid values are listed at ServiceAccountPrivateKeyType (only used on create)
- private_
key_ strtype The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format.
- public_
key_ strtype The output format of the public key requested. X509_PEM is the default output format.
Outputs
All input properties are implicitly available as output properties. Additionally, the Key resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
The name used for this key pair
- Private
Key string The private key in JSON format, base64 encoded. This is what you normally get as a file when creating service account keys through the CLI or web console. This is only populated when creating a new key.
- Public
Key string The public key, base64 encoded
- Valid
After string The key can be used after this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- Valid
Before string The key can be used before this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
The name used for this key pair
- Private
Key string The private key in JSON format, base64 encoded. This is what you normally get as a file when creating service account keys through the CLI or web console. This is only populated when creating a new key.
- Public
Key string The public key, base64 encoded
- Valid
After string The key can be used after this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- Valid
Before string The key can be used before this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
The name used for this key pair
- private
Key string The private key in JSON format, base64 encoded. This is what you normally get as a file when creating service account keys through the CLI or web console. This is only populated when creating a new key.
- public
Key string The public key, base64 encoded
- valid
After string The key can be used after this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- valid
Before string The key can be used before this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
The name used for this key pair
- private_
key str The private key in JSON format, base64 encoded. This is what you normally get as a file when creating service account keys through the CLI or web console. This is only populated when creating a new key.
- public_
key str The public key, base64 encoded
- valid_
after str The key can be used after this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- valid_
before str The key can be used before this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
Look up an Existing Key Resource
Get an existing Key resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: KeyState, opts?: CustomResourceOptions): Keystatic get(resource_name, id, opts=None, key_algorithm=None, name=None, private_key=None, private_key_type=None, public_key=None, public_key_type=None, service_account_id=None, valid_after=None, valid_before=None, __props__=None);public static Key Get(string name, Input<string> id, KeyState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Key
Algorithm string The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. Valid values are listed at ServiceAccountPrivateKeyType (only used on create)
- Name string
The name used for this key pair
- Private
Key string The private key in JSON format, base64 encoded. This is what you normally get as a file when creating service account keys through the CLI or web console. This is only populated when creating a new key.
- Private
Key stringType The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format.
- Public
Key string The public key, base64 encoded
- Public
Key stringType The output format of the public key requested. X509_PEM is the default output format.
- Service
Account stringId The Service account id of the Key Pair. This can be a string in the format
{ACCOUNT}orprojects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}, where{ACCOUNT}is the email address or unique id of the service account. If the{ACCOUNT}syntax is used, the project will be inferred from the account.- Valid
After string The key can be used after this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- Valid
Before string The key can be used before this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- Key
Algorithm string The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. Valid values are listed at ServiceAccountPrivateKeyType (only used on create)
- Name string
The name used for this key pair
- Private
Key string The private key in JSON format, base64 encoded. This is what you normally get as a file when creating service account keys through the CLI or web console. This is only populated when creating a new key.
- Private
Key stringType The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format.
- Public
Key string The public key, base64 encoded
- Public
Key stringType The output format of the public key requested. X509_PEM is the default output format.
- Service
Account stringId The Service account id of the Key Pair. This can be a string in the format
{ACCOUNT}orprojects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}, where{ACCOUNT}is the email address or unique id of the service account. If the{ACCOUNT}syntax is used, the project will be inferred from the account.- Valid
After string The key can be used after this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- Valid
Before string The key can be used before this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- key
Algorithm string The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. Valid values are listed at ServiceAccountPrivateKeyType (only used on create)
- name string
The name used for this key pair
- private
Key string The private key in JSON format, base64 encoded. This is what you normally get as a file when creating service account keys through the CLI or web console. This is only populated when creating a new key.
- private
Key stringType The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format.
- public
Key string The public key, base64 encoded
- public
Key stringType The output format of the public key requested. X509_PEM is the default output format.
- service
Account stringId The Service account id of the Key Pair. This can be a string in the format
{ACCOUNT}orprojects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}, where{ACCOUNT}is the email address or unique id of the service account. If the{ACCOUNT}syntax is used, the project will be inferred from the account.- valid
After string The key can be used after this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- valid
Before string The key can be used before this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- key_
algorithm str The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. Valid values are listed at ServiceAccountPrivateKeyType (only used on create)
- name str
The name used for this key pair
- private_
key str The private key in JSON format, base64 encoded. This is what you normally get as a file when creating service account keys through the CLI or web console. This is only populated when creating a new key.
- private_
key_ strtype The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format.
- public_
key str The public key, base64 encoded
- public_
key_ strtype The output format of the public key requested. X509_PEM is the default output format.
- service_
account_ strid The Service account id of the Key Pair. This can be a string in the format
{ACCOUNT}orprojects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}, where{ACCOUNT}is the email address or unique id of the service account. If the{ACCOUNT}syntax is used, the project will be inferred from the account.- valid_
after str The key can be used after this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
- valid_
before str The key can be used before this timestamp. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.