Class KeyValueStoreProps
The properties to create a Key Value Store.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class KeyValueStoreProps : IKeyValueStoreProps
Syntax (vb)
Public Class KeyValueStoreProps Implements IKeyValueStoreProps
Remarks
ExampleMetadata: infused
Examples
var storeAsset = new KeyValueStore(this, "KeyValueStoreAsset", new KeyValueStoreProps {
KeyValueStoreName = "KeyValueStoreAsset",
Source = ImportSource.FromAsset("path-to-data.json")
});
var storeInline = new KeyValueStore(this, "KeyValueStoreInline", new KeyValueStoreProps {
KeyValueStoreName = "KeyValueStoreInline",
Source = ImportSource.FromInline(JSON.Stringify(new Dictionary<string, IDictionary<string, string>[]> {
{ "data", new [] { new Struct {
Key = "key1",
Value = "value1"
}, new Struct {
Key = "key2",
Value = "value2"
} } }
}))
});
Synopsis
Constructors
| KeyValueStoreProps() | The properties to create a Key Value Store. |
Properties
| Comment | A comment for the Key Value Store. |
| KeyValueStoreName | The unique name of the Key Value Store. |
| Source | The import source for the Key Value Store. |
Constructors
KeyValueStoreProps()
The properties to create a Key Value Store.
public KeyValueStoreProps()
Remarks
ExampleMetadata: infused
Examples
var storeAsset = new KeyValueStore(this, "KeyValueStoreAsset", new KeyValueStoreProps {
KeyValueStoreName = "KeyValueStoreAsset",
Source = ImportSource.FromAsset("path-to-data.json")
});
var storeInline = new KeyValueStore(this, "KeyValueStoreInline", new KeyValueStoreProps {
KeyValueStoreName = "KeyValueStoreInline",
Source = ImportSource.FromInline(JSON.Stringify(new Dictionary<string, IDictionary<string, string>[]> {
{ "data", new [] { new Struct {
Key = "key1",
Value = "value1"
}, new Struct {
Key = "key2",
Value = "value2"
} } }
}))
});
Properties
Comment
A comment for the Key Value Store.
public string? Comment { get; set; }
Property Value
Remarks
Default: No comment will be specified
KeyValueStoreName
The unique name of the Key Value Store.
public string? KeyValueStoreName { get; set; }
Property Value
Remarks
Default: A generated name
Source
The import source for the Key Value Store.
public ImportSource? Source { get; set; }
Property Value
Remarks
This will populate the initial items in the Key Value Store. The source data must be in a valid JSON format.
Default: No data will be imported to the store