Show / Hide Table of Contents

Class CryptoKey

A CryptoKey represents a logical key that can be used for cryptographic operations.

Note: CryptoKeys cannot be deleted from Google Cloud Platform. Destroying a provider-managed CryptoKey will remove it from state and delete all CryptoKeyVersions, rendering the key unusable, but will not delete the resource on the server. When the provider destroys these keys, any data previously encrypted with these keys will be irrecoverable. For this reason, it is strongly recommended that you add lifecycle hooks to the resource to prevent accidental destruction.

To get more information about CryptoKey, see:

  • API documentation
  • How-to Guides
  • Creating a key

Example Usage - Kms Crypto Key Basic

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var keyring = new Gcp.Kms.KeyRing("keyring", new Gcp.Kms.KeyRingArgs
    {
        Location = "global",
    });
    var example_key = new Gcp.Kms.CryptoKey("example-key", new Gcp.Kms.CryptoKeyArgs
    {
        KeyRing = keyring.Id,
        RotationPeriod = "100000s",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
CryptoKey
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Gcp.Kms
Assembly: Pulumi.Gcp.dll
Syntax
public class CryptoKey : CustomResource

Constructors

View Source

CryptoKey(String, CryptoKeyArgs, CustomResourceOptions)

Create a CryptoKey resource with the given unique name, arguments, and options.

Declaration
public CryptoKey(string name, CryptoKeyArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

CryptoKeyArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

KeyRing

The KeyRing that this key belongs to. Format: 'projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}'.

Declaration
public Output<string> KeyRing { get; }
Property Value
Type Description
Output<System.String>
View Source

Labels

Labels with user-defined metadata to apply to this resource.

Declaration
public Output<ImmutableDictionary<string, string>> Labels { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>>
View Source

Name

The resource name for the CryptoKey.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Purpose

The immutable purpose of this CryptoKey. See the purpose reference for possible inputs.

Declaration
public Output<string> Purpose { get; }
Property Value
Type Description
Output<System.String>
View Source

RotationPeriod

Every time this period passes, generate a new CryptoKeyVersion and set it as the primary. The first rotation will take place after the specified period. The rotation period has the format of a decimal number with up to 9 fractional digits, followed by the letter s (seconds). It must be greater than a day (ie, 86400).

Declaration
public Output<string> RotationPeriod { get; }
Property Value
Type Description
Output<System.String>
View Source

SelfLink

Declaration
public Output<string> SelfLink { get; }
Property Value
Type Description
Output<System.String>
View Source

VersionTemplate

A template describing settings for new crypto key versions. Structure is documented below.

Declaration
public Output<CryptoKeyVersionTemplate> VersionTemplate { get; }
Property Value
Type Description
Output<CryptoKeyVersionTemplate>

Methods

View Source

Get(String, Input<String>, CryptoKeyState, CustomResourceOptions)

Get an existing CryptoKey resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static CryptoKey Get(string name, Input<string> id, CryptoKeyState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

CryptoKeyState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
CryptoKey
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.