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/stdlib/azure/resourcegroup/rg.cue
Sujay Pillai 5908aa628e Adding support for azure and create a resource group
Signed-off-by: Sujay Pillai <sujayopillai@gmail.com>
2021-08-11 01:20:16 +08:00

43 lines
746 B
CUE

package resourcegroup
import (
"alpha.dagger.io/os"
"alpha.dagger.io/azure"
)
// Create a resource group
#ResourceGroup: {
// Azure Config
config: azure.#Config
// ResourceGroup name
rgName: string @dagger(input)
// ResourceGroup location
rgLocation: string @dagger(input)
// Container image
ctr: os.#Container & {
image: azure.#CLI & {
"config": config
}
// Path of the shell to execute
shell: path: "/bin/bash"
always: true
command: """
az group create -l "\(rgLocation)" -n "\(rgName)"
az group show -n "\(rgName)" --query "id" -o json | jq -r . | tr -d "\n" > /resourceGroupId
"""
}
// Resource Id
id: {
os.#File & {
from: ctr
path: "/resourceGroupId"
}
}.contents @dagger(output)
}