From 54251f88b431e790374957e6dcb820584715468a Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Thu, 18 Mar 2021 15:53:26 -0700 Subject: [PATCH] stdlib: share aws config cli Signed-off-by: Sam Alba --- stdlib/aws/aws.cue | 21 +++++++++++++++++++- stdlib/aws/cloudformation/cloudformation.cue | 9 ++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/stdlib/aws/aws.cue b/stdlib/aws/aws.cue index a9d8bc20..4f6bbf6c 100644 --- a/stdlib/aws/aws.cue +++ b/stdlib/aws/aws.cue @@ -1,7 +1,12 @@ package aws -import "dagger.io/dagger" +import ( + "dagger.io/dagger" + "dagger.io/llb" + "dagger.io/alpine" +) +// Base AWS Config #Config: { // AWS region region: string @@ -10,3 +15,17 @@ import "dagger.io/dagger" // AWS secret key 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" + } + }, + ] +} diff --git a/stdlib/aws/cloudformation/cloudformation.cue b/stdlib/aws/cloudformation/cloudformation.cue index 39e1f6bb..2b504895 100644 --- a/stdlib/aws/cloudformation/cloudformation.cue +++ b/stdlib/aws/cloudformation/cloudformation.cue @@ -3,9 +3,8 @@ package cloudformation import ( "encoding/json" - "dagger.io/alpine" - "dagger.io/aws" "dagger.io/llb" + "dagger.io/aws" ) // AWS CloudFormation Stack @@ -50,11 +49,7 @@ import ( outputs: { #compute: [ llb.#Load & { - from: alpine.#Image & { - package: bash: "=5.1.0-r0" - package: jq: "=1.6-r1" - package: "aws-cli": "=1.18.177-r0" - } + from: aws.#CLI }, llb.#Mkdir & { path: "/src"