cloudflavor / skycrane

IaC - Skycrane automates infrastructure
https://skycrane.io
Apache License 2.0
0 stars 0 forks source link

Feature/clo 57 starlark integration #25

Closed PI-Victor closed 2 months ago

PI-Victor commented 2 months ago

The CLI is now able to interpret a file (can be named anything) that has a starlark function call named 'module'. This function maps to an internal rust defined function that is able to parse and return the name of the module (cloud provider module) that is to be loaded and its version. The CLI is also capable of retrieving only functions that are defined in the CLI and ignore the rest.

e.g. for a file definition:

module(
    name = "hetzner",
    version = "0.1.0",
)

vm(
    name = "instance",
    image_id = "ami-0c55b159cbfafe1f0",
    instance_type = "t2.micro",
    subnet_id = "subnet-0c55b159cbfafe1f0",
    security_group_ids = ["sg-0c55b159cbfafe1f0"],
    key_name = "my-key",
    user_data = "//examples/hetzner:cloud_init",
)

It will ignore the 'vm" declaration. This is necessary because when evaluating the AstModule, all of the statements found in the config definition should also be in the globals, otherwise it wil panic.

Signed-off-by: Victor Palade victor@cloudflavor.io

linear[bot] commented 2 months ago

CLO-57 Starlark integration

PI-Victor commented 2 months ago

/triage /assign

PI-Victor commented 2 months ago

/label Feature

PI-Victor commented 2 months ago

/link starlark

PI-Victor commented 2 months ago

/merge

oscar-automaton[bot] commented 2 months ago

Skipping merge due to missing "approved" label

PI-Victor commented 2 months ago

/approve /merge

oscar-automaton[bot] commented 2 months ago

Skipping merge due to missing "approved" label

PI-Victor commented 2 months ago

*sigh, stupid bug /merge force

oscar-automaton[bot] commented 2 months ago

Force merging pull request