Class Key


  • public class Key
    extends com.pulumi.resources.CustomResource
    ## Example Usage ### Creating A New Key ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.serviceAccount.Account; import com.pulumi.gcp.serviceAccount.AccountArgs; import com.pulumi.gcp.serviceAccount.Key; import com.pulumi.gcp.serviceAccount.KeyArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var myaccount = new Account("myaccount", AccountArgs.builder() .accountId("myaccount") .displayName("My Service Account") .build()); var mykey = new Key("mykey", KeyArgs.builder() .serviceAccountId(myaccount.name()) .publicKeyType("TYPE_X509_PEM_FILE") .build()); } } ``` ## Import This resource does not support import.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Key​(java.lang.String name)  
      Key​(java.lang.String name, KeyArgs args)  
      Key​(java.lang.String name, KeyArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Key get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, KeyState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>>> keepers()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> keyAlgorithm()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> privateKey()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> privateKeyType()  
      com.pulumi.core.Output<java.lang.String> publicKey()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> publicKeyData()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> publicKeyType()  
      com.pulumi.core.Output<java.lang.String> serviceAccountId()  
      com.pulumi.core.Output<java.lang.String> validAfter()  
      com.pulumi.core.Output<java.lang.String> validBefore()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Key

        public Key​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Key

        public Key​(java.lang.String name,
                   KeyArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Key

        public Key​(java.lang.String name,
                   KeyArgs args,
                   @Nullable
                   com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • keepers

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>>> keepers()
        Returns:
        Arbitrary map of values that, when changed, will trigger a new key to be generated.
      • keyAlgorithm

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> keyAlgorithm()
        Returns:
        The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. Valid values are listed at [ServiceAccountPrivateKeyType](https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts.keys#ServiceAccountKeyAlgorithm) (only used on create)
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name used for this key pair
      • privateKey

        public com.pulumi.core.Output<java.lang.String> privateKey()
        Returns:
        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.
      • privateKeyType

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> privateKeyType()
        Returns:
        The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format.
      • publicKey

        public com.pulumi.core.Output<java.lang.String> publicKey()
        Returns:
        The public key, base64 encoded
      • publicKeyData

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> publicKeyData()
        Returns:
        Public key data to create a service account key for given service account. The expected format for this field is a base64 encoded X509_PEM and it conflicts with `public_key_type` and `private_key_type`.
      • publicKeyType

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> publicKeyType()
        Returns:
        The output format of the public key requested. TYPE_X509_PEM_FILE is the default output format.
      • serviceAccountId

        public com.pulumi.core.Output<java.lang.String> serviceAccountId()
        Returns:
        The Service account id of the Key. This can be a string in the format `{ACCOUNT}` or `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. If the `{ACCOUNT}`-only syntax is used, either the **full** email address of the service account or its name can be specified as a value, in which case the project will automatically be inferred from the account. Otherwise, if the `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}` syntax is used, the `{ACCOUNT}` specified can be the full email address of the service account or the service account's unique id. Substituting `-` as a wildcard for the `{PROJECT_ID}` will infer the project from the account.
      • validAfter

        public com.pulumi.core.Output<java.lang.String> validAfter()
        Returns:
        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".
      • validBefore

        public com.pulumi.core.Output<java.lang.String> validBefore()
        Returns:
        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".
      • get

        public static Key get​(java.lang.String name,
                              com.pulumi.core.Output<java.lang.String> id,
                              @Nullable
                              KeyState state,
                              @Nullable
                              com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.