stdlib: share aws config cli

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba 2021-03-18 15:53:26 -07:00
parent ea02b579d6
commit 54251f88b4
2 changed files with 22 additions and 8 deletions

View File

@ -1,7 +1,12 @@
package aws package aws
import "dagger.io/dagger" import (
"dagger.io/dagger"
"dagger.io/llb"
"dagger.io/alpine"
)
// Base AWS Config
#Config: { #Config: {
// AWS region // AWS region
region: string region: string
@ -10,3 +15,17 @@ import "dagger.io/dagger"
// AWS secret key // AWS secret key
secretKey: dagger.#Secret secretKey: dagger.#Secret
} }
// Re-usable aws-cli component
#CLI: {
#compute: [
llb.#Load & {
from: alpine.#Image & {
package: bash: "=5.1.0-r0"
package: jq: "=1.6-r1"
package: curl: "=7.74.0-r1"
package: "aws-cli": "=1.18.177-r0"
}
},
]
}

View File

@ -3,9 +3,8 @@ package cloudformation
import ( import (
"encoding/json" "encoding/json"
"dagger.io/alpine"
"dagger.io/aws"
"dagger.io/llb" "dagger.io/llb"
"dagger.io/aws"
) )
// AWS CloudFormation Stack // AWS CloudFormation Stack
@ -50,11 +49,7 @@ import (
outputs: { outputs: {
#compute: [ #compute: [
llb.#Load & { llb.#Load & {
from: alpine.#Image & { from: aws.#CLI
package: bash: "=5.1.0-r0"
package: jq: "=1.6-r1"
package: "aws-cli": "=1.18.177-r0"
}
}, },
llb.#Mkdir & { llb.#Mkdir & {
path: "/src" path: "/src"