AWS SDK Version 4 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Specifies the key value store resource to add to your account. In your account, the key value store names must be unique. You can also import key value store data in JSON format from an S3 bucket by providing a valid ImportSource that you own.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to CreateKeyValueStoreAsync.

Namespace: Amazon.CloudFront
Assembly: AWSSDK.CloudFront.dll
Version: 3.x.y.z

Syntax

C#
public virtual CreateKeyValueStoreResponse CreateKeyValueStore(
         CreateKeyValueStoreRequest request
)

Parameters

request
Type: Amazon.CloudFront.Model.CreateKeyValueStoreRequest

Container for the necessary parameters to execute the CreateKeyValueStore service method.

Return Value


The response from the CreateKeyValueStore service method, as returned by CloudFront.

Exceptions

ExceptionCondition
AccessDeniedException Access denied.
EntityAlreadyExistsException The entity already exists. You must provide a unique entity.
EntityLimitExceededException The entity limit has been exceeded.
EntitySizeLimitExceededException The entity size limit was exceeded.
InvalidArgumentException An argument is invalid.
UnsupportedOperationException This operation is not supported in this Amazon Web Services Region.

Examples

Use the following command to create a KeyValueStore.

To create a KeyValueStore


var client = new AmazonCloudFrontClient();
var response = client.CreateFunction(new CreateFunctionRequest 
{
    FunctionCode = new MemoryStream(function-code.js),
    FunctionConfig = new FunctionConfig {
        Comment = "my-function-comment",
        KeyValueStoreAssociations = new KeyValueStoreAssociations {
            Items = new List<KeyValueStoreAssociation> {
                new KeyValueStoreAssociation { KeyValueStoreARN = "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889" }
            },
            Quantity = 1
        },
        Runtime = "cloudfront-js-2.0"
    },
    Name = "my-function-name"
});

string eTag = response.ETag;
FunctionSummary functionSummary = response.FunctionSummary;
string location = response.Location;

            

Version Information

.NET Framework:
Supported in: 4.7.2 and newer

See Also