Class InitSource

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ec2.InitElement
software.amazon.awscdk.services.ec2.InitSource
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:16.046Z") @Stability(Stable) public abstract class InitSource extends InitElement
Extract an archive into a directory.

Example:

 Bucket myBucket;
 InitServiceRestartHandle handle = new InitServiceRestartHandle();
 CloudFormationInit.fromElements(InitFile.fromString("/etc/nginx/nginx.conf", "...", InitFileOptions.builder().serviceRestartHandles(List.of(handle)).build()), InitSource.fromS3Object("/var/www/html", myBucket, "html.zip", InitSourceOptions.builder().serviceRestartHandles(List.of(handle)).build()), InitService.enable("nginx", InitServiceOptions.builder()
         .serviceRestartHandle(handle)
         .build()));
 
  • Constructor Details

    • InitSource

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

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

      @Stability(Stable) protected InitSource(@NotNull String targetDirectory, @Nullable List<InitServiceRestartHandle> serviceHandles)
      Parameters:
      targetDirectory - This parameter is required.
      serviceHandles -
    • InitSource

      @Stability(Stable) protected InitSource(@NotNull String targetDirectory)
      Parameters:
      targetDirectory - This parameter is required.
  • Method Details

    • fromAsset

      @Stability(Stable) @NotNull public static InitSource fromAsset(@NotNull String targetDirectory, @NotNull String path, @Nullable InitSourceAssetOptions options)
      Create an InitSource from an asset created from the given path.

      Parameters:
      targetDirectory - This parameter is required.
      path - This parameter is required.
      options -
    • fromAsset

      @Stability(Stable) @NotNull public static InitSource fromAsset(@NotNull String targetDirectory, @NotNull String path)
      Create an InitSource from an asset created from the given path.

      Parameters:
      targetDirectory - This parameter is required.
      path - This parameter is required.
    • fromExistingAsset

      @Stability(Stable) @NotNull public static InitSource fromExistingAsset(@NotNull String targetDirectory, @NotNull Asset asset, @Nullable InitSourceOptions options)
      Extract a directory from an existing directory asset.

      Parameters:
      targetDirectory - This parameter is required.
      asset - This parameter is required.
      options -
    • fromExistingAsset

      @Stability(Stable) @NotNull public static InitSource fromExistingAsset(@NotNull String targetDirectory, @NotNull Asset asset)
      Extract a directory from an existing directory asset.

      Parameters:
      targetDirectory - This parameter is required.
      asset - This parameter is required.
    • fromGitHub

      @Stability(Stable) @NotNull public static InitSource fromGitHub(@NotNull String targetDirectory, @NotNull String owner, @NotNull String repo, @Nullable String refSpec, @Nullable InitSourceOptions options)
      Extract a GitHub branch into a given directory.

      Parameters:
      targetDirectory - This parameter is required.
      owner - This parameter is required.
      repo - This parameter is required.
      refSpec -
      options -
    • fromGitHub

      @Stability(Stable) @NotNull public static InitSource fromGitHub(@NotNull String targetDirectory, @NotNull String owner, @NotNull String repo, @Nullable String refSpec)
      Extract a GitHub branch into a given directory.

      Parameters:
      targetDirectory - This parameter is required.
      owner - This parameter is required.
      repo - This parameter is required.
      refSpec -
    • fromGitHub

      @Stability(Stable) @NotNull public static InitSource fromGitHub(@NotNull String targetDirectory, @NotNull String owner, @NotNull String repo)
      Extract a GitHub branch into a given directory.

      Parameters:
      targetDirectory - This parameter is required.
      owner - This parameter is required.
      repo - This parameter is required.
    • fromS3Object

      @Stability(Stable) @NotNull public static InitSource fromS3Object(@NotNull String targetDirectory, @NotNull IBucket bucket, @NotNull String key, @Nullable InitSourceOptions options)
      Extract an archive stored in an S3 bucket into the given directory.

      Parameters:
      targetDirectory - This parameter is required.
      bucket - This parameter is required.
      key - This parameter is required.
      options -
    • fromS3Object

      @Stability(Stable) @NotNull public static InitSource fromS3Object(@NotNull String targetDirectory, @NotNull IBucket bucket, @NotNull String key)
      Extract an archive stored in an S3 bucket into the given directory.

      Parameters:
      targetDirectory - This parameter is required.
      bucket - This parameter is required.
      key - This parameter is required.
    • fromUrl

      @Stability(Stable) @NotNull public static InitSource fromUrl(@NotNull String targetDirectory, @NotNull String url, @Nullable InitSourceOptions options)
      Retrieve a URL and extract it into the given directory.

      Parameters:
      targetDirectory - This parameter is required.
      url - This parameter is required.
      options -
    • fromUrl

      @Stability(Stable) @NotNull public static InitSource fromUrl(@NotNull String targetDirectory, @NotNull String url)
      Retrieve a URL and extract it into the given directory.

      Parameters:
      targetDirectory - This parameter is required.
      url - This parameter is required.
    • getElementType

      @Stability(Stable) @NotNull public String getElementType()
      Returns the init element type for this element.
      Specified by:
      getElementType in class InitElement