2022-04-25 19:59:30 +00:00
|
|
|
using System.Collections.Generic;
|
2023-03-24 11:43:46 +00:00
|
|
|
using System.Linq;
|
2022-04-25 19:59:30 +00:00
|
|
|
using Pulumi;
|
|
|
|
using Aws = Pulumi.Aws;
|
|
|
|
|
2022-07-21 19:04:02 +00:00
|
|
|
return await Deployment.RunAsync(() =>
|
2022-04-25 19:59:30 +00:00
|
|
|
{
|
2022-07-21 19:04:02 +00:00
|
|
|
var siteBucket = new Aws.S3.Bucket("siteBucket");
|
|
|
|
|
|
|
|
var testFileAsset = new Aws.S3.BucketObject("testFileAsset", new()
|
2022-04-25 19:59:30 +00:00
|
|
|
{
|
2022-07-21 19:04:02 +00:00
|
|
|
Bucket = siteBucket.Id,
|
|
|
|
Source = new FileAsset("file.txt"),
|
|
|
|
});
|
|
|
|
|
|
|
|
var testStringAsset = new Aws.S3.BucketObject("testStringAsset", new()
|
|
|
|
{
|
|
|
|
Bucket = siteBucket.Id,
|
|
|
|
Source = new StringAsset("<h1>File contents</h1>"),
|
|
|
|
});
|
|
|
|
|
|
|
|
var testRemoteAsset = new Aws.S3.BucketObject("testRemoteAsset", new()
|
|
|
|
{
|
|
|
|
Bucket = siteBucket.Id,
|
|
|
|
Source = new RemoteAsset("https://pulumi.test"),
|
|
|
|
});
|
|
|
|
|
2022-11-16 01:44:21 +00:00
|
|
|
var testFileArchive = new Aws.Lambda.Function("testFileArchive", new()
|
2022-07-21 19:04:02 +00:00
|
|
|
{
|
2022-11-16 01:44:21 +00:00
|
|
|
Role = siteBucket.Arn,
|
|
|
|
Code = new FileArchive("file.tar.gz"),
|
2022-07-21 19:04:02 +00:00
|
|
|
});
|
|
|
|
|
2022-11-16 01:44:21 +00:00
|
|
|
var testRemoteArchive = new Aws.Lambda.Function("testRemoteArchive", new()
|
2022-07-21 19:04:02 +00:00
|
|
|
{
|
2022-11-16 01:44:21 +00:00
|
|
|
Role = siteBucket.Arn,
|
|
|
|
Code = new RemoteArchive("https://pulumi.test/foo.tar.gz"),
|
2022-07-21 19:04:02 +00:00
|
|
|
});
|
|
|
|
|
2022-11-16 01:44:21 +00:00
|
|
|
var testAssetArchive = new Aws.Lambda.Function("testAssetArchive", new()
|
2022-07-21 19:04:02 +00:00
|
|
|
{
|
2022-11-16 01:44:21 +00:00
|
|
|
Role = siteBucket.Arn,
|
|
|
|
Code = new AssetArchive(new Dictionary<string, AssetOrArchive>
|
2022-04-25 19:59:30 +00:00
|
|
|
{
|
2022-07-21 19:04:02 +00:00
|
|
|
["file.txt"] = new FileAsset("file.txt"),
|
|
|
|
["string.txt"] = new StringAsset("<h1>File contents</h1>"),
|
|
|
|
["remote.txt"] = new RemoteAsset("https://pulumi.test"),
|
|
|
|
["file.tar"] = new FileArchive("file.tar.gz"),
|
|
|
|
["remote.tar"] = new RemoteArchive("https://pulumi.test/foo.tar.gz"),
|
|
|
|
[".nestedDir"] = new AssetArchive(new Dictionary<string, AssetOrArchive>
|
2022-04-25 19:59:30 +00:00
|
|
|
{
|
2022-07-21 19:04:02 +00:00
|
|
|
["file.txt"] = new FileAsset("file.txt"),
|
|
|
|
["string.txt"] = new StringAsset("<h1>File contents</h1>"),
|
|
|
|
["remote.txt"] = new RemoteAsset("https://pulumi.test"),
|
|
|
|
["file.tar"] = new FileArchive("file.tar.gz"),
|
|
|
|
["remote.tar"] = new RemoteArchive("https://pulumi.test/foo.tar.gz"),
|
2022-04-25 19:59:30 +00:00
|
|
|
}),
|
2022-07-21 19:04:02 +00:00
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
2022-04-25 19:59:30 +00:00
|
|
|
|