Package com.pulumi.aws.cloudfront
Class PublicKey
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.cloudfront.PublicKey
-
public class PublicKey extends com.pulumi.resources.CustomResource## Example Usage The following example below creates a CloudFront public key.
## Import Using `pulumi import`, import CloudFront Public Key using the `id`. For example: ```sh $ pulumi import aws:cloudfront/publicKey:PublicKey example K3D5EWEUDCCXON ```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()); } }
-
-
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 PublicKeyget(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()
-
-
-
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.
-
-