This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/pkg/alpha.dagger.io/azure/storage/st.cue
Andrea Luzzardi 282759c0e5 cue modules: move stdlib to pkg/alpha.dagger.io
In preparation for Europa, we will vendor multiple CUE modules:

- `pkg/alpha.dagger.io`: legacy non-europa packages
- `pkg/dagger.io`: core Europa packages
- `pkg/universe.dagger.io`: Europa universe

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2022-01-11 13:16:37 -08:00

53 lines
1.0 KiB
CUE

package storage
import (
"alpha.dagger.io/azure"
"alpha.dagger.io/os"
"alpha.dagger.io/dagger"
)
// Create a storage account
#StorageAccount: {
// Azure Config
config: azure.#Config
// ResourceGroup name
rgName: string & dagger.#Input
// StorageAccount location
stLocation: string & dagger.#Input
// StorageAccount name
stName: string & dagger.#Input
// StorageAccount Id
id: string & dagger.#Output
// Container image
ctr: os.#Container & {
image: azure.#CLI & {
"config": config
}
always: true
command: """
az storage account create -n "$AZURE_STORAGE_ACCOUNT" -g "$AZURE_DEFAULTS_GROUP" -l "$AZURE_DEFAULTS_LOCATION"
az storage account show -n "$AZURE_STORAGE_ACCOUNT" -g "$AZURE_DEFAULTS_GROUP" --query "id" -o json | jq -r . | tr -d "\n" > /storageAccountId
"""
env: {
AZURE_DEFAULTS_GROUP: rgName
AZURE_DEFAULTS_LOCATION: stLocation
AZURE_STORAGE_ACCOUNT: stName
}
}
// StorageAccount Id
id: ({
os.#File & {
from: ctr
path: "/storageAccountId"
}
}).contents
}