InitSource Class
Extract an archive into a directory.
Example
ts
declare const myBucket: s3.Bucket;
const handle = new ec2.InitServiceRestartHandle();
ec2.CloudFormationInit.fromElements(
ec2.InitFile.fromString('/etc/nginx/nginx.conf', '...', { serviceRestartHandles: [handle] }),
ec2.InitSource.fromS3Object('/var/www/html', myBucket, 'html.zip', { serviceRestartHandles: [handle] }),
ec2.InitService.enable('nginx', {
serviceRestartHandle: handle,
})
);
Properties
Returns the init element type for this element.
Methods
fromAsset(targetDirectory: string, path: string, options?: InitSourceAssetOptions): InitSource // chainable@staticmethod def from_asset(target_directory: str, path: str, options: typing.Optional[InitSourceAssetOptions] = None) -> InitSourcepublic static InitSource fromAsset(String targetDirectory, String path, InitSourceAssetOptions options)public static InitSource FromAsset(string targetDirectory, string path, InitSourceAssetOptions? options = null)func FromAsset(TargetDirectory *string, Path *string, Options InitSourceAssetOptions) InitSourcestatic#Create an InitSource from an asset created from the given path.
fromExistingAsset(targetDirectory: string, asset: Asset, options?: InitSourceOptions): InitSource // chainable@staticmethod def from_existing_asset(target_directory: str, asset: Asset, options: typing.Optional[InitSourceOptions] = None) -> InitSourcepublic static InitSource fromExistingAsset(String targetDirectory, Asset asset, InitSourceOptions options)public static InitSource FromExistingAsset(string targetDirectory, Asset asset, InitSourceOptions? options = null)func FromExistingAsset(TargetDirectory *string, Asset Asset, Options InitSourceOptions) InitSourcestatic#Extract a directory from an existing directory asset.
fromGitHub(targetDirectory: string, owner: string, repo: string, refSpec?: string, options?: InitSourceOptions): InitSource // chainable@staticmethod def from_git_hub(target_directory: str, owner: str, repo: str, ref_spec: typing.Optional[str] = None, options: typing.Optional[InitSourceOptions] = None) -> InitSourcepublic static InitSource fromGitHub(String targetDirectory, String owner, String repo, String refSpec, InitSourceOptions options)public static InitSource FromGitHub(string targetDirectory, string owner, string repo, string? refSpec = null, InitSourceOptions? options = null)func FromGitHub(TargetDirectory *string, Owner *string, Repo *string, RefSpec *string, Options InitSourceOptions) InitSourcestatic#Extract a GitHub branch into a given directory.
fromS3Object(targetDirectory: string, bucket: IBucket, key: string, options?: InitSourceOptions): InitSource // chainable@staticmethod def from_s3_object(target_directory: str, bucket: IBucket, key: str, options: typing.Optional[InitSourceOptions] = None) -> InitSourcepublic static InitSource fromS3Object(String targetDirectory, IBucket bucket, String key, InitSourceOptions options)public static InitSource FromS3Object(string targetDirectory, IBucket bucket, string key, InitSourceOptions? options = null)func FromS3Object(TargetDirectory *string, Bucket IBucket, Key *string, Options InitSourceOptions) InitSourcestatic#Extract an archive stored in an S3 bucket into the given directory.
fromUrl(targetDirectory: string, url: string, options?: InitSourceOptions): InitSource // chainable@staticmethod def from_url(target_directory: str, url: str, options: typing.Optional[InitSourceOptions] = None) -> InitSourcepublic static InitSource fromUrl(String targetDirectory, String url, InitSourceOptions options)public static InitSource FromUrl(string targetDirectory, string url, InitSourceOptions? options = null)func FromUrl(TargetDirectory *string, Url *string, Options InitSourceOptions) InitSourcestatic#Retrieve a URL and extract it into the given directory.