-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource Annotations #1
Labels
Comments
@anthony-c-martin - any issues with me closing this one? I think all the scenarios are taken into account by the looping & conditionals spec |
bhsubra
added a commit
that referenced
this issue
Aug 1, 2022
16 tasks
ghost
locked as resolved and limited conversation to collaborators
May 30, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Proposal - Control Flow via Annotations
Resource Annotations
resource
declarations can be annotated with optional annotations - starting with#
, and only permitted directly before a resource is declared. Generally these annotations can be thought of as providing metadata about the resource rather than directly manipulating config. The following annotations are built into the language:#type <type provider>
- declares the type of the resource#if <expression>
- takes an expression which determines whether to conditionally deploy a resource.#repeat <identifier>(, <index>) in <array/object>
- takes an array or object, and provides an identifier which can be used to iterate over properties or keys respectively. Optionally provides an index identifier.Extensibility
Custom annotations are allowed on a type-by-type basis. It is the responsibility of the type provider to indicate which annotations are allowed, to provide validation, and to instruct the compiler what effect the annotation will have on the resource.
To give some examples, in an ARM-specific implementation, we might have:
#parent <identifier>
- declares that the resource is a child of a given other resource#repeatMode
/#repeatBatch
- gives more control over how loops are evaluated in ARM#default
/#inherit
)Theoretically if we're using the annotations to build a deployment graph for an engine other than the ARM deployment engine, we may want to prevent some combinations from existing and blocking this at compile time - for example if trying to use a 'serial' copy mode to generate something which isn't an ARM template.
Example
The text was updated successfully, but these errors were encountered: