examples: added simple s3 for static website example

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba
2021-04-14 11:57:58 -07:00
parent 413017f7cb
commit 39f7170cc5
2 changed files with 71 additions and 9 deletions

View File

@@ -0,0 +1,33 @@
package main
import (
"dagger.io/aws"
"dagger.io/aws/s3"
)
// AWS Config for credentials and default region
awsConfig: aws.#Config & {
region: *"us-east-1" | string
}
// Name of the S3 bucket to use
bucket: *"hello-s3.infralabs.io" | string
name: string | *"world"
page: """
<html>
</head>
<title>Simple static website on S3</title>
</head>
<h1>Hello!</h1>
<li>Hey \(name)</li>
</html>
"""
deploy: s3.#Put & {
config: awsConfig
sourceInline: page
contentType: "text/html"
target: "s3://\(bucket)/index.html"
}