Skip to content
v2.277.0

FileSource Struct ​

Describe the source of a file asset.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cloud_assembly_schema } from 'aws-cdk-lib';
const fileSource: cloud_assembly_schema.FileSource = {
  executable: ['executable'],
  packaging: cloud_assembly_schema.FileAssetPackaging.FILE,
  path: 'path',
};
python
from aws_cdk.cloud_assembly_schema import FileSource
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cloud_assembly_schema

file_source = FileSource(
    executable=["executable"],
    packaging=cloud_assembly_schema.FileAssetPackaging.FILE,
    path="path"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cloud_assembly_schema.*;

FileSource fileSource = FileSource.builder()
        .executable(List.of("executable"))
        .packaging(FileAssetPackaging.FILE)
        .path("path")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Cloud_assembly_schema;

var fileSource = new FileSource {
    Executable = new [] { "executable" },
    Packaging = FileAssetPackaging.FILE,
    Path = "path"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

fileSource := &FileSource{
	Executable: []*string{
		jsii.String("executable"),
	},
	Packaging: awscdk.Cloud_assembly_schema.FileAssetPackaging_FILE,
	Path: jsii.String("path"),
}

Properties ​

executableoptionalstring[]executableoptionaltyping.List[str]executableoptionalList<String>Executableoptionalstring[]Executableoptional*[]*string#
External command which will produce the file asset to upload.

Default: Exactly one of executable and path is required.

packagingoptionalFileAssetPackagingpackagingoptionalFileAssetPackagingpackagingoptionalFileAssetPackagingPackagingoptionalFileAssetPackagingPackagingoptionalFileAssetPackaging= FILE#
Packaging method.

Only allowed when path is specified.

pathoptionalstringpathoptionalstrpathoptionalStringPathoptionalstringPathoptional*string#
The filesystem object to upload.

Default: Exactly one of executable and path is required.

This path is relative to the asset manifest location.