Class PublicKey


  • public class PublicKey
    extends com.pulumi.resources.CustomResource
    ## Example Usage The following example below creates a CloudFront public key.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cloudfront.PublicKey;
     import com.pulumi.aws.cloudfront.PublicKeyArgs;
     import com.pulumi.std.StdFunctions;
     import com.pulumi.std.inputs.FileArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     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 example = new PublicKey("example", PublicKeyArgs.builder()
                 .comment("test public key")
                 .encodedKey(StdFunctions.file(FileArgs.builder()
                     .input("public_key.pem")
                     .build()).result())
                 .name("test_key")
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import CloudFront Public Key using the `id`. For example: ```sh $ pulumi import aws:cloudfront/publicKey:PublicKey example K3D5EWEUDCCXON ```
    • 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
      PublicKey​(java.lang.String name)  
      PublicKey​(java.lang.String name, PublicKeyArgs args)  
      PublicKey​(java.lang.String name, PublicKeyArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> callerReference()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> comment()  
      com.pulumi.core.Output<java.lang.String> encodedKey()  
      com.pulumi.core.Output<java.lang.String> etag()  
      static PublicKey get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, PublicKeyState 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.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> namePrefix()  
      • Methods inherited from class com.pulumi.resources.CustomResource

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

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

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

      • PublicKey

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

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

        public PublicKey​(java.lang.String name,
                         PublicKeyArgs 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

      • callerReference

        public com.pulumi.core.Output<java.lang.String> callerReference()
        Returns:
        Internal value used by CloudFront to allow future updates to the public key configuration.
      • comment

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> comment()
        Returns:
        An optional comment about the public key.
      • encodedKey

        public com.pulumi.core.Output<java.lang.String> encodedKey()
        Returns:
        The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
      • etag

        public com.pulumi.core.Output<java.lang.String> etag()
        Returns:
        The current version of the public key. For example: `E2QWRUHAPOMQZL`.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name for the public key. By default generated by this provider. Note: Do not set if using the key's id in another resource (e.g. KeyGroup) since it will result in a dependency error from AWS. Instead, it is recommended to use Pulumi autonaming by leaving this property unset (default behavior) or set the `namePrefix` property to allow the provider to autoname the resource.
      • namePrefix

        public com.pulumi.core.Output<java.lang.String> namePrefix()
        Returns:
        The name for the public key. Conflicts with `name`. **NOTE:** When setting `encodedKey` value, there needs a newline at the end of string. Otherwise, multiple runs of pulumi will want to recreate the `aws.cloudfront.PublicKey` resource.
      • get

        public static PublicKey get​(java.lang.String name,
                                    com.pulumi.core.Output<java.lang.String> id,
                                    @Nullable
                                    PublicKeyState 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.