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.84.0 (build 5404dcf)",
date="2023-06-19T16:30:39.387Z")
@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()));
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ModifierConstructorDescriptionprotected
InitSource
(String targetDirectory) protected
InitSource
(String targetDirectory, List<InitServiceRestartHandle> serviceHandles) protected
InitSource
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
InitSource
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic InitSource
Create an InitSource from an asset created from the given path.static InitSource
fromAsset
(String targetDirectory, String path, InitSourceAssetOptions options) Create an InitSource from an asset created from the given path.static InitSource
fromExistingAsset
(String targetDirectory, Asset asset) Extract a directory from an existing directory asset.static InitSource
fromExistingAsset
(String targetDirectory, Asset asset, InitSourceOptions options) Extract a directory from an existing directory asset.static InitSource
fromGitHub
(String targetDirectory, String owner, String repo) Extract a GitHub branch into a given directory.static InitSource
fromGitHub
(String targetDirectory, String owner, String repo, String refSpec) Extract a GitHub branch into a given directory.static InitSource
fromGitHub
(String targetDirectory, String owner, String repo, String refSpec, InitSourceOptions options) Extract a GitHub branch into a given directory.static InitSource
fromS3Object
(String targetDirectory, IBucket bucket, String key) Extract an archive stored in an S3 bucket into the given directory.static InitSource
fromS3Object
(String targetDirectory, IBucket bucket, String key, InitSourceOptions options) Extract an archive stored in an S3 bucket into the given directory.static InitSource
Retrieve a URL and extract it into the given directory.static InitSource
fromUrl
(String targetDirectory, String url, InitSourceOptions options) Retrieve a URL and extract it into the given directory.Returns the init element type for this element.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
-
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
- 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
Returns the init element type for this element.- Specified by:
getElementType
in classInitElement
-