2022-04-25 19:59:30 +00:00
|
|
|
import pulumi
|
|
|
|
import pulumi_aws as aws
|
|
|
|
|
|
|
|
site_bucket = aws.s3.Bucket("siteBucket")
|
|
|
|
test_file_asset = aws.s3.BucketObject("testFileAsset",
|
|
|
|
bucket=site_bucket.id,
|
|
|
|
source=pulumi.FileAsset("file.txt"))
|
|
|
|
test_string_asset = aws.s3.BucketObject("testStringAsset",
|
|
|
|
bucket=site_bucket.id,
|
|
|
|
source=pulumi.StringAsset("<h1>File contents</h1>"))
|
|
|
|
test_remote_asset = aws.s3.BucketObject("testRemoteAsset",
|
|
|
|
bucket=site_bucket.id,
|
2024-07-02 13:34:10 +00:00
|
|
|
source=pulumi.RemoteAsset("https://pulumi.test"))
|
2022-11-16 01:44:21 +00:00
|
|
|
test_file_archive = aws.lambda_.Function("testFileArchive",
|
|
|
|
role=site_bucket.arn,
|
|
|
|
code=pulumi.FileArchive("file.tar.gz"))
|
|
|
|
test_remote_archive = aws.lambda_.Function("testRemoteArchive",
|
|
|
|
role=site_bucket.arn,
|
|
|
|
code=pulumi.RemoteArchive("https://pulumi.test/foo.tar.gz"))
|
|
|
|
test_asset_archive = aws.lambda_.Function("testAssetArchive",
|
|
|
|
role=site_bucket.arn,
|
|
|
|
code=pulumi.AssetArchive({
|
2022-04-25 19:59:30 +00:00
|
|
|
"file.txt": pulumi.FileAsset("file.txt"),
|
|
|
|
"string.txt": pulumi.StringAsset("<h1>File contents</h1>"),
|
2024-07-02 13:34:10 +00:00
|
|
|
"remote.txt": pulumi.RemoteAsset("https://pulumi.test"),
|
2022-04-25 19:59:30 +00:00
|
|
|
"file.tar": pulumi.FileArchive("file.tar.gz"),
|
|
|
|
"remote.tar": pulumi.RemoteArchive("https://pulumi.test/foo.tar.gz"),
|
|
|
|
".nestedDir": pulumi.AssetArchive({
|
|
|
|
"file.txt": pulumi.FileAsset("file.txt"),
|
|
|
|
"string.txt": pulumi.StringAsset("<h1>File contents</h1>"),
|
2024-07-02 13:34:10 +00:00
|
|
|
"remote.txt": pulumi.RemoteAsset("https://pulumi.test"),
|
2022-04-25 19:59:30 +00:00
|
|
|
"file.tar": pulumi.FileArchive("file.tar.gz"),
|
|
|
|
"remote.tar": pulumi.RemoteArchive("https://pulumi.test/foo.tar.gz"),
|
|
|
|
}),
|
|
|
|
}))
|