github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/assets-archives-pp/dotnet/assets-archives.cs (about)

     1  using System.Collections.Generic;
     2  using Pulumi;
     3  using Aws = Pulumi.Aws;
     4  
     5  return await Deployment.RunAsync(() => 
     6  {
     7      var siteBucket = new Aws.S3.Bucket("siteBucket");
     8  
     9      var testFileAsset = new Aws.S3.BucketObject("testFileAsset", new()
    10      {
    11          Bucket = siteBucket.Id,
    12          Source = new FileAsset("file.txt"),
    13      });
    14  
    15      var testStringAsset = new Aws.S3.BucketObject("testStringAsset", new()
    16      {
    17          Bucket = siteBucket.Id,
    18          Source = new StringAsset("<h1>File contents</h1>"),
    19      });
    20  
    21      var testRemoteAsset = new Aws.S3.BucketObject("testRemoteAsset", new()
    22      {
    23          Bucket = siteBucket.Id,
    24          Source = new RemoteAsset("https://pulumi.test"),
    25      });
    26  
    27      var testFileArchive = new Aws.Lambda.Function("testFileArchive", new()
    28      {
    29          Role = siteBucket.Arn,
    30          Code = new FileArchive("file.tar.gz"),
    31      });
    32  
    33      var testRemoteArchive = new Aws.Lambda.Function("testRemoteArchive", new()
    34      {
    35          Role = siteBucket.Arn,
    36          Code = new RemoteArchive("https://pulumi.test/foo.tar.gz"),
    37      });
    38  
    39      var testAssetArchive = new Aws.Lambda.Function("testAssetArchive", new()
    40      {
    41          Role = siteBucket.Arn,
    42          Code = new AssetArchive(new Dictionary<string, AssetOrArchive>
    43          {
    44              ["file.txt"] = new FileAsset("file.txt"),
    45              ["string.txt"] = new StringAsset("<h1>File contents</h1>"),
    46              ["remote.txt"] = new RemoteAsset("https://pulumi.test"),
    47              ["file.tar"] = new FileArchive("file.tar.gz"),
    48              ["remote.tar"] = new RemoteArchive("https://pulumi.test/foo.tar.gz"),
    49              [".nestedDir"] = new AssetArchive(new Dictionary<string, AssetOrArchive>
    50              {
    51                  ["file.txt"] = new FileAsset("file.txt"),
    52                  ["string.txt"] = new StringAsset("<h1>File contents</h1>"),
    53                  ["remote.txt"] = new RemoteAsset("https://pulumi.test"),
    54                  ["file.tar"] = new FileArchive("file.tar.gz"),
    55                  ["remote.tar"] = new RemoteArchive("https://pulumi.test/foo.tar.gz"),
    56              }),
    57          }),
    58      });
    59  
    60  });
    61