1. Packages
  2. AWS
  3. API Docs
  4. cloudfront
  5. KeyvaluestoreKey
AWS v6.75.0 published on Wednesday, Apr 2, 2025 by Pulumi

aws.cloudfront.KeyvaluestoreKey

Explore with Pulumi AI

Resource for managing an AWS CloudFront KeyValueStore Key.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.cloudfront.KeyValueStore("example", {
    name: "ExampleKeyValueStore",
    comment: "This is an example key value store",
});
const exampleKeyvaluestoreKey = new aws.cloudfront.KeyvaluestoreKey("example", {
    keyValueStoreArn: example.arn,
    key: "Test Key",
    value: "Test Value",
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.cloudfront.KeyValueStore("example",
    name="ExampleKeyValueStore",
    comment="This is an example key value store")
example_keyvaluestore_key = aws.cloudfront.KeyvaluestoreKey("example",
    key_value_store_arn=example.arn,
    key="Test Key",
    value="Test Value")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := cloudfront.NewKeyValueStore(ctx, "example", &cloudfront.KeyValueStoreArgs{
			Name:    pulumi.String("ExampleKeyValueStore"),
			Comment: pulumi.String("This is an example key value store"),
		})
		if err != nil {
			return err
		}
		_, err = cloudfront.NewKeyvaluestoreKey(ctx, "example", &cloudfront.KeyvaluestoreKeyArgs{
			KeyValueStoreArn: example.Arn,
			Key:              pulumi.String("Test Key"),
			Value:            pulumi.String("Test Value"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.CloudFront.KeyValueStore("example", new()
    {
        Name = "ExampleKeyValueStore",
        Comment = "This is an example key value store",
    });

    var exampleKeyvaluestoreKey = new Aws.CloudFront.KeyvaluestoreKey("example", new()
    {
        KeyValueStoreArn = example.Arn,
        Key = "Test Key",
        Value = "Test Value",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudfront.KeyValueStore;
import com.pulumi.aws.cloudfront.KeyValueStoreArgs;
import com.pulumi.aws.cloudfront.KeyvaluestoreKey;
import com.pulumi.aws.cloudfront.KeyvaluestoreKeyArgs;
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 example = new KeyValueStore("example", KeyValueStoreArgs.builder()
            .name("ExampleKeyValueStore")
            .comment("This is an example key value store")
            .build());

        var exampleKeyvaluestoreKey = new KeyvaluestoreKey("exampleKeyvaluestoreKey", KeyvaluestoreKeyArgs.builder()
            .keyValueStoreArn(example.arn())
            .key("Test Key")
            .value("Test Value")
            .build());

    }
}
Copy
resources:
  example:
    type: aws:cloudfront:KeyValueStore
    properties:
      name: ExampleKeyValueStore
      comment: This is an example key value store
  exampleKeyvaluestoreKey:
    type: aws:cloudfront:KeyvaluestoreKey
    name: example
    properties:
      keyValueStoreArn: ${example.arn}
      key: Test Key
      value: Test Value
Copy

Create KeyvaluestoreKey Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new KeyvaluestoreKey(name: string, args: KeyvaluestoreKeyArgs, opts?: CustomResourceOptions);
@overload
def KeyvaluestoreKey(resource_name: str,
                     args: KeyvaluestoreKeyArgs,
                     opts: Optional[ResourceOptions] = None)

@overload
def KeyvaluestoreKey(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     key: Optional[str] = None,
                     key_value_store_arn: Optional[str] = None,
                     value: Optional[str] = None)
func NewKeyvaluestoreKey(ctx *Context, name string, args KeyvaluestoreKeyArgs, opts ...ResourceOption) (*KeyvaluestoreKey, error)
public KeyvaluestoreKey(string name, KeyvaluestoreKeyArgs args, CustomResourceOptions? opts = null)
public KeyvaluestoreKey(String name, KeyvaluestoreKeyArgs args)
public KeyvaluestoreKey(String name, KeyvaluestoreKeyArgs args, CustomResourceOptions options)
type: aws:cloudfront:KeyvaluestoreKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. KeyvaluestoreKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. KeyvaluestoreKeyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. KeyvaluestoreKeyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. KeyvaluestoreKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. KeyvaluestoreKeyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var keyvaluestoreKeyResource = new Aws.CloudFront.KeyvaluestoreKey("keyvaluestoreKeyResource", new()
{
    Key = "string",
    KeyValueStoreArn = "string",
    Value = "string",
});
Copy
example, err := cloudfront.NewKeyvaluestoreKey(ctx, "keyvaluestoreKeyResource", &cloudfront.KeyvaluestoreKeyArgs{
	Key:              pulumi.String("string"),
	KeyValueStoreArn: pulumi.String("string"),
	Value:            pulumi.String("string"),
})
Copy
var keyvaluestoreKeyResource = new KeyvaluestoreKey("keyvaluestoreKeyResource", KeyvaluestoreKeyArgs.builder()
    .key("string")
    .keyValueStoreArn("string")
    .value("string")
    .build());
Copy
keyvaluestore_key_resource = aws.cloudfront.KeyvaluestoreKey("keyvaluestoreKeyResource",
    key="string",
    key_value_store_arn="string",
    value="string")
Copy
const keyvaluestoreKeyResource = new aws.cloudfront.KeyvaluestoreKey("keyvaluestoreKeyResource", {
    key: "string",
    keyValueStoreArn: "string",
    value: "string",
});
Copy
type: aws:cloudfront:KeyvaluestoreKey
properties:
    key: string
    keyValueStoreArn: string
    value: string
Copy

KeyvaluestoreKey Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The KeyvaluestoreKey resource accepts the following input properties:

Key This property is required. string
Key to put.
KeyValueStoreArn This property is required. string
Amazon Resource Name (ARN) of the Key Value Store.
Value This property is required. string
Value to put.
Key This property is required. string
Key to put.
KeyValueStoreArn This property is required. string
Amazon Resource Name (ARN) of the Key Value Store.
Value This property is required. string
Value to put.
key This property is required. String
Key to put.
keyValueStoreArn This property is required. String
Amazon Resource Name (ARN) of the Key Value Store.
value This property is required. String
Value to put.
key This property is required. string
Key to put.
keyValueStoreArn This property is required. string
Amazon Resource Name (ARN) of the Key Value Store.
value This property is required. string
Value to put.
key This property is required. str
Key to put.
key_value_store_arn This property is required. str
Amazon Resource Name (ARN) of the Key Value Store.
value This property is required. str
Value to put.
key This property is required. String
Key to put.
keyValueStoreArn This property is required. String
Amazon Resource Name (ARN) of the Key Value Store.
value This property is required. String
Value to put.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
TotalSizeInBytes int
Total size of the Key Value Store in bytes.
Id string
The provider-assigned unique ID for this managed resource.
TotalSizeInBytes int
Total size of the Key Value Store in bytes.
id String
The provider-assigned unique ID for this managed resource.
totalSizeInBytes Integer
Total size of the Key Value Store in bytes.
id string
The provider-assigned unique ID for this managed resource.
totalSizeInBytes number
Total size of the Key Value Store in bytes.
id str
The provider-assigned unique ID for this managed resource.
total_size_in_bytes int
Total size of the Key Value Store in bytes.
id String
The provider-assigned unique ID for this managed resource.
totalSizeInBytes Number
Total size of the Key Value Store in bytes.

Look up Existing KeyvaluestoreKey Resource

Get an existing KeyvaluestoreKey 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?: KeyvaluestoreKeyState, opts?: CustomResourceOptions): KeyvaluestoreKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        key: Optional[str] = None,
        key_value_store_arn: Optional[str] = None,
        total_size_in_bytes: Optional[int] = None,
        value: Optional[str] = None) -> KeyvaluestoreKey
func GetKeyvaluestoreKey(ctx *Context, name string, id IDInput, state *KeyvaluestoreKeyState, opts ...ResourceOption) (*KeyvaluestoreKey, error)
public static KeyvaluestoreKey Get(string name, Input<string> id, KeyvaluestoreKeyState? state, CustomResourceOptions? opts = null)
public static KeyvaluestoreKey get(String name, Output<String> id, KeyvaluestoreKeyState state, CustomResourceOptions options)
resources:  _:    type: aws:cloudfront:KeyvaluestoreKey    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Key string
Key to put.
KeyValueStoreArn string
Amazon Resource Name (ARN) of the Key Value Store.
TotalSizeInBytes int
Total size of the Key Value Store in bytes.
Value string
Value to put.
Key string
Key to put.
KeyValueStoreArn string
Amazon Resource Name (ARN) of the Key Value Store.
TotalSizeInBytes int
Total size of the Key Value Store in bytes.
Value string
Value to put.
key String
Key to put.
keyValueStoreArn String
Amazon Resource Name (ARN) of the Key Value Store.
totalSizeInBytes Integer
Total size of the Key Value Store in bytes.
value String
Value to put.
key string
Key to put.
keyValueStoreArn string
Amazon Resource Name (ARN) of the Key Value Store.
totalSizeInBytes number
Total size of the Key Value Store in bytes.
value string
Value to put.
key str
Key to put.
key_value_store_arn str
Amazon Resource Name (ARN) of the Key Value Store.
total_size_in_bytes int
Total size of the Key Value Store in bytes.
value str
Value to put.
key String
Key to put.
keyValueStoreArn String
Amazon Resource Name (ARN) of the Key Value Store.
totalSizeInBytes Number
Total size of the Key Value Store in bytes.
value String
Value to put.

Import

Using pulumi import, import CloudFront KeyValueStore Key using the id. For example:

$ pulumi import aws:cloudfront/keyvaluestoreKey:KeyvaluestoreKey example arn:aws:cloudfront::111111111111:key-value-store/8562g61f-caba-2845-9d99-b97diwae5d3c,someKey
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.