Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AWS Classic

v4.25.0 published on Friday, Oct 15, 2021 by Pulumi

PublicKey

Import

CloudFront Public Key can be imported using the id, e.g.

 $ pulumi import aws:cloudfront/publicKey:PublicKey example K3D5EWEUDCCXON

Example Usage

using System.IO;
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.CloudFront.PublicKey("example", new Aws.CloudFront.PublicKeyArgs
        {
            Comment = "test public key",
            EncodedKey = File.ReadAllText("public_key.pem"),
        });
    }

}
package main

import (
	"io/ioutil"

	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/cloudfront"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func readFileOrPanic(path string) pulumi.StringPtrInput {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		panic(err.Error())
	}
	return pulumi.String(string(data))
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudfront.NewPublicKey(ctx, "example", &cloudfront.PublicKeyArgs{
			Comment:    pulumi.String("test public key"),
			EncodedKey: readFileOrPanic("public_key.pem"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example = aws.cloudfront.PublicKey("example",
    comment="test public key",
    encoded_key=(lambda path: open(path).read())("public_key.pem"))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * from "fs";

const example = new aws.cloudfront.PublicKey("example", {
    comment: "test public key",
    encodedKey: fs.readFileSync("public_key.pem"),
});

Create a PublicKey Resource

new PublicKey(name: string, args: PublicKeyArgs, opts?: CustomResourceOptions);
@overload
def PublicKey(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              comment: Optional[str] = None,
              encoded_key: Optional[str] = None,
              name: Optional[str] = None,
              name_prefix: Optional[str] = None)
@overload
def PublicKey(resource_name: str,
              args: PublicKeyArgs,
              opts: Optional[ResourceOptions] = None)
func NewPublicKey(ctx *Context, name string, args PublicKeyArgs, opts ...ResourceOption) (*PublicKey, error)
public PublicKey(string name, PublicKeyArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args PublicKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args PublicKeyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args PublicKeyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PublicKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

PublicKey Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The PublicKey resource accepts the following input properties:

EncodedKey string
The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
Comment string
An optional comment about the public key.
Name string
The name for the public key. By default generated by this provider.
NamePrefix string
The name for the public key. Conflicts with name.
EncodedKey string
The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
Comment string
An optional comment about the public key.
Name string
The name for the public key. By default generated by this provider.
NamePrefix string
The name for the public key. Conflicts with name.
encodedKey string
The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
comment string
An optional comment about the public key.
name string
The name for the public key. By default generated by this provider.
namePrefix string
The name for the public key. Conflicts with name.
encoded_key str
The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
comment str
An optional comment about the public key.
name str
The name for the public key. By default generated by this provider.
name_prefix str
The name for the public key. Conflicts with name.

Outputs

All input properties are implicitly available as output properties. Additionally, the PublicKey resource produces the following output properties:

CallerReference string
Internal value used by CloudFront to allow future updates to the public key configuration.
Etag string
The current version of the public key. For example: E2QWRUHAPOMQZL.
Id string
The provider-assigned unique ID for this managed resource.
CallerReference string
Internal value used by CloudFront to allow future updates to the public key configuration.
Etag string
The current version of the public key. For example: E2QWRUHAPOMQZL.
Id string
The provider-assigned unique ID for this managed resource.
callerReference string
Internal value used by CloudFront to allow future updates to the public key configuration.
etag string
The current version of the public key. For example: E2QWRUHAPOMQZL.
id string
The provider-assigned unique ID for this managed resource.
caller_reference str
Internal value used by CloudFront to allow future updates to the public key configuration.
etag str
The current version of the public key. For example: E2QWRUHAPOMQZL.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing PublicKey Resource

Get an existing PublicKey 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?: PublicKeyState, opts?: CustomResourceOptions): PublicKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        caller_reference: Optional[str] = None,
        comment: Optional[str] = None,
        encoded_key: Optional[str] = None,
        etag: Optional[str] = None,
        name: Optional[str] = None,
        name_prefix: Optional[str] = None) -> PublicKey
func GetPublicKey(ctx *Context, name string, id IDInput, state *PublicKeyState, opts ...ResourceOption) (*PublicKey, error)
public static PublicKey Get(string name, Input<string> id, PublicKeyState? 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:

CallerReference string
Internal value used by CloudFront to allow future updates to the public key configuration.
Comment string
An optional comment about the public key.
EncodedKey string
The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
Etag string
The current version of the public key. For example: E2QWRUHAPOMQZL.
Name string
The name for the public key. By default generated by this provider.
NamePrefix string
The name for the public key. Conflicts with name.
CallerReference string
Internal value used by CloudFront to allow future updates to the public key configuration.
Comment string
An optional comment about the public key.
EncodedKey string
The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
Etag string
The current version of the public key. For example: E2QWRUHAPOMQZL.
Name string
The name for the public key. By default generated by this provider.
NamePrefix string
The name for the public key. Conflicts with name.
callerReference string
Internal value used by CloudFront to allow future updates to the public key configuration.
comment string
An optional comment about the public key.
encodedKey string
The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
etag string
The current version of the public key. For example: E2QWRUHAPOMQZL.
name string
The name for the public key. By default generated by this provider.
namePrefix string
The name for the public key. Conflicts with name.
caller_reference str
Internal value used by CloudFront to allow future updates to the public key configuration.
comment str
An optional comment about the public key.
encoded_key str
The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
etag str
The current version of the public key. For example: E2QWRUHAPOMQZL.
name str
The name for the public key. By default generated by this provider.
name_prefix str
The name for the public key. Conflicts with name.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.