Class ImportSource
The data to be imported to the key value store.
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class ImportSource : DeputyBase
Syntax (vb)
Public MustInherit Class ImportSource
Inherits DeputyBase
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
ImportSource() | |
ImportSource(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ImportSource(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
FromAsset(String, IAssetOptions) | An import source that exists as a local file. |
FromBucket(IBucket, String) | An import source that exists as an object in an S3 bucket. |
FromInline(String) | An import source that uses an inline string. |
Constructors
ImportSource()
protected ImportSource()
ImportSource(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ImportSource(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ImportSource(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ImportSource(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
FromAsset(String, IAssetOptions)
An import source that exists as a local file.
public static ImportSource FromAsset(string path, IAssetOptions options = null)
Parameters
- path System.String
the path to the local file.
- options IAssetOptions
the configuration for the temporarily created S3 file.
Returns
FromBucket(IBucket, String)
An import source that exists as an object in an S3 bucket.
public static ImportSource FromBucket(IBucket bucket, string key)
Parameters
- bucket IBucket
the S3 bucket that contains the data.
- key System.String
the key within the S3 bucket that contains the data.
Returns
FromInline(String)
An import source that uses an inline string.
public static ImportSource FromInline(string data)
Parameters
- data System.String
the contents of the KeyValueStore.
Returns