examples/simple-s3: easier example to understand simple use case

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba
2021-05-11 15:03:28 -07:00
parent 42cf2c18d4
commit 9cab6146ce
3 changed files with 24 additions and 22 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"dagger.io/aws"
"dagger.io/aws/s3"
"dagger.io/dagger"
)
// AWS Config for credentials and default region
@@ -11,24 +12,14 @@ awsConfig: aws.#Config & {
}
// Name of the S3 bucket to use
bucket: *"hello-s3.infralabs.io" | string
bucket: *"dagger-io-examples" | string
name: string | *"world"
page: """
<html>
</head>
<title>Simple static website on S3</title>
</head>
<h1>Hello!</h1>
<li>Hey \(name)</li>
</html>
"""
source: dagger.#Artifact
url: "\(deploy.url)index.html"
deploy: s3.#Put & {
config: awsConfig
sourceInline: page
always: true
"source": source
contentType: "text/html"
target: "s3://\(bucket)/index.html"
target: "s3://\(bucket)/"
}

View File

@@ -0,0 +1,9 @@
<html>
</head>
<title>My Simple Website</title>
</head>
<h1>Shopping list</h1>
<li>Salad</li>
<li>Eggs</li>
<li>Potatoes</li>
</html>