Class InitSource
Extract an archive into a directory.
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class InitSource : InitElement
Syntax (vb)
Public MustInherit Class InitSource
Inherits InitElement
Remarks
ExampleMetadata: infused
Examples
Bucket myBucket;
var handle = new InitServiceRestartHandle();
CloudFormationInit.FromElements(InitFile.FromString("/etc/nginx/nginx.conf", "...", new InitFileOptions { ServiceRestartHandles = new [] { handle } }), InitSource.FromS3Object("/var/www/html", myBucket, "html.zip", new InitSourceOptions { ServiceRestartHandles = new [] { handle } }), InitService.Enable("nginx", new InitServiceOptions {
ServiceRestartHandle = handle
}));
Synopsis
Constructors
InitSource(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
InitSource(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
InitSource(String, InitServiceRestartHandle[]) |
Properties
ElementType | Returns the init element type for this element. |
Methods
FromAsset(String, String, IInitSourceAssetOptions) | Create an InitSource from an asset created from the given path. |
FromExistingAsset(String, Asset, IInitSourceOptions) | Extract a directory from an existing directory asset. |
FromGitHub(String, String, String, String, IInitSourceOptions) | Extract a GitHub branch into a given directory. |
FromS3Object(String, IBucket, String, IInitSourceOptions) | Extract an archive stored in an S3 bucket into the given directory. |
FromUrl(String, String, IInitSourceOptions) | Retrieve a URL and extract it into the given directory. |
Constructors
InitSource(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected InitSource(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
InitSource(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected InitSource(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
InitSource(String, InitServiceRestartHandle[])
protected InitSource(string targetDirectory, InitServiceRestartHandle[] serviceHandles = null)
Parameters
- targetDirectory System.String
- serviceHandles InitServiceRestartHandle[]
Properties
ElementType
Returns the init element type for this element.
public override string ElementType { get; }
Property Value
System.String
Overrides
Methods
FromAsset(String, String, IInitSourceAssetOptions)
Create an InitSource from an asset created from the given path.
public static InitSource FromAsset(string targetDirectory, string path, IInitSourceAssetOptions options = null)
Parameters
- targetDirectory System.String
- path System.String
- options IInitSourceAssetOptions
Returns
FromExistingAsset(String, Asset, IInitSourceOptions)
Extract a directory from an existing directory asset.
public static InitSource FromExistingAsset(string targetDirectory, Asset asset, IInitSourceOptions options = null)
Parameters
- targetDirectory System.String
- asset Asset
- options IInitSourceOptions
Returns
FromGitHub(String, String, String, String, IInitSourceOptions)
Extract a GitHub branch into a given directory.
public static InitSource FromGitHub(string targetDirectory, string owner, string repo, string refSpec = null, IInitSourceOptions options = null)
Parameters
- targetDirectory System.String
- owner System.String
- repo System.String
- refSpec System.String
- options IInitSourceOptions
Returns
FromS3Object(String, IBucket, String, IInitSourceOptions)
Extract an archive stored in an S3 bucket into the given directory.
public static InitSource FromS3Object(string targetDirectory, IBucket bucket, string key, IInitSourceOptions options = null)
Parameters
- targetDirectory System.String
- bucket IBucket
- key System.String
- options IInitSourceOptions
Returns
FromUrl(String, String, IInitSourceOptions)
Retrieve a URL and extract it into the given directory.
public static InitSource FromUrl(string targetDirectory, string url, IInitSourceOptions options = null)
Parameters
- targetDirectory System.String
- url System.String
- options IInitSourceOptions
Returns