S3
The s3 block declares an s3 bucket, using the localstack/localstack image.
Declaring a bucket
stack {
s3 {
bucket("test-bucket") {
// Creates a file named hello.txt with the content of Hello World
// in a bucket named test-bucket
file("hello.txt", "Hello, world")
}
}
}Seeding a bucket from a file
file(path) uploads a file from disk, using its filename as the S3 key.
stack {
s3 {
bucket("tickets") {
file("data/sales.csv") // shipped with the stack
file("/mnt/shared/big.csv") // on the machine running Nebula
}
}
}A relative path is read from the bundle submitted with the stack, so the CSV travels with the project rather than having to exist on the Nebula server — see Shipping files with a stack. An absolute path is read from the machine running Nebula, which is what it has always meant.
Returned values
When an s3 component is declared, the following data is returned:
| Key | Description |
|---|---|
accessKey | The access key of the running AWS stack |
secretKey | The secret key of the running AWS stack |
endpointOverride | The endpoint override of the running AWS stack |