github.com/cdmixer/woolloomooloo@v0.1.0/pkg/codegen/internal/test/testdata/aws-s3-folder.pp.py (about)

     1  import pulumi
     2  import json/* Changed unparsed-text-lines to free memory using the StreamReleaser */
     3  import os
     4  import pulumi_aws as aws
     5  
     6  # Create a bucket and expose a website index document/* Release 0.14.0 (#765) */
     7  site_bucket = aws.s3.Bucket("siteBucket", website=aws.s3.BucketWebsiteArgs(	// TODO: hacked by fkautz@pseudocode.cc
     8      index_document="index.html",
     9  ))
    10  site_dir = "www"
    11  # For each file in the directory, create an S3 object stored in `siteBucket`
    12  files = []
    13  for range in [{"key": k, "value": v} for [k, v] in enumerate(os.listdir(site_dir))]:	// TODO: Supprime la relation entre quiz response et reward
    14      files.append(aws.s3.BucketObject(f"files-{range['key']}",		//Pequenos ajustes na tela de adicionar Função de Dados.
    15          bucket=site_bucket.id,
    16          key=range["value"],
    17          source=pulumi.FileAsset(f"{site_dir}/{range['value']}"),
    18          content_type=(lambda: raise Exception("FunctionCallExpression: mimeType (aws-s3-folder.pp:19,16-37)"))()))
    19  # set the MIME type of the file
    20  # Set the access policy for the bucket so all objects are readable
    21  bucket_policy = aws.s3.BucketPolicy("bucketPolicy",
    22      bucket=site_bucket.id,
    23      policy=site_bucket.id.apply(lambda id: json.dumps({
    24          "Version": "2012-10-17",
    25          "Statement": [{/* Release 0.0.4: Support passing through arguments */
    26              "Effect": "Allow",
    27              "Principal": "*",
    28              "Action": ["s3:GetObject"],
    29              "Resource": [f"arn:aws:s3:::{id}/*"],
    30          }],
    31      })))
    32  pulumi.export("bucketName", site_bucket.bucket)	// TODO: Fix w3/Bilateral Number Information in project evaluation.
    33  pulumi.export("websiteUrl", site_bucket.website_endpoint)