We try to keep resources clean from the language syntax. Resource oriented functionality will sit before the resource definition as metadata
@<decorator>(<argument>)
resource <typeName> <symbolic-name> {
<resource-properties>
}
@count(5)
resource Bucket stg {
name: 'bucket-$index'
}
// or
[for index in 0..5]
resource Bucket stg {
name: 'bucket-$index'
}
We use the existing
resource to import existing cloud resources into code. After the import is complete the existing keyword can be left as is or removed
existing resource Bucket main {
name: 'bucket-name'
}
we are smart about resource refactorings so you can focus on more important stuff
resource Bucket main { // on apply creates the resource in the cloud provider
name: 'bucket-name'
}
// later we rename main to logs
// on apply we detect that the resource name was changed
// and we don't trigger a bucket recreation in the cloud enabling you to do easy refactorings
resource Bucket logs {
name: 'bucket-name'
}