Class ImportSource

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudfront.ImportSource
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
Direct Known Subclasses:
AssetImportSource, InlineImportSource, S3ImportSource

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-06T23:25:05.566Z") @Stability(Stable) public abstract class ImportSource extends software.amazon.jsii.JsiiObject
The data to be imported to the key value store.

Example:

 KeyValueStore storeAsset = KeyValueStore.Builder.create(this, "KeyValueStoreAsset")
         .keyValueStoreName("KeyValueStoreAsset")
         .source(ImportSource.fromAsset("path-to-data.json"))
         .build();
 KeyValueStore storeInline = KeyValueStore.Builder.create(this, "KeyValueStoreInline")
         .keyValueStoreName("KeyValueStoreInline")
         .source(ImportSource.fromInline(JSON.stringify(Map.of(
                 "data", List.of(Map.of(
                         "key", "key1",
                         "value", "value1"), Map.of(
                         "key", "key2",
                         "value", "value2"))))))
         .build();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    ImportSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    ImportSource(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    An import source that exists as a local file.
    fromAsset(String path, AssetOptions options)
    An import source that exists as a local file.
    fromBucket(IBucket bucket, String key)
    An import source that exists as an object in an S3 bucket.
    An import source that uses an inline string.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • ImportSource

      protected ImportSource(software.amazon.jsii.JsiiObjectRef objRef)
    • ImportSource

      protected ImportSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • ImportSource

      @Stability(Stable) protected ImportSource()
  • Method Details

    • fromAsset

      @Stability(Stable) @NotNull public static ImportSource fromAsset(@NotNull String path, @Nullable AssetOptions options)
      An import source that exists as a local file.

      Parameters:
      path - the path to the local file. This parameter is required.
      options - the configuration for the temporarily created S3 file.
    • fromAsset

      @Stability(Stable) @NotNull public static ImportSource fromAsset(@NotNull String path)
      An import source that exists as a local file.

      Parameters:
      path - the path to the local file. This parameter is required.
    • fromBucket

      @Stability(Stable) @NotNull public static ImportSource fromBucket(@NotNull IBucket bucket, @NotNull String key)
      An import source that exists as an object in an S3 bucket.

      Parameters:
      bucket - the S3 bucket that contains the data. This parameter is required.
      key - the key within the S3 bucket that contains the data. This parameter is required.
    • fromInline

      @Stability(Stable) @NotNull public static ImportSource fromInline(@NotNull String data)
      An import source that uses an inline string.

      Parameters:
      data - the contents of the KeyValueStore. This parameter is required.