Conventions #2884
-
I've written a convention as part of a module and it resides within the rules directory
I've included the convention in the module configuration file ---
# Synopsis: Module configuration for config.datacenter.Rules.
apiVersion: github.com/microsoft/PSRule/v1
kind: ModuleConfig
metadata:
name: config.datacenter.Rules
spec:
binding:
targetName:
- ResourceName
- Host
targetType:
- ResourceType
convention:
include:
- match.name.key
rule:
baseline: config.datacenter.Rules When I load the module and then run From reading the docs I though including in the module config file would negate the need to include the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @sapritchard, thanks for the question. The config looks good excepting the indent on the ---
# Synopsis: Module configuration for config.datacenter.Rules.
apiVersion: github.com/microsoft/PSRule/v1
kind: ModuleConfig
metadata:
name: config.datacenter.Rules
spec:
binding:
targetName:
- ResourceName
- Host
targetType:
- ResourceType
convention:
include:
- match.name.key
rule:
baseline: config.datacenter.Rules If editing within VSCode, the extension should help by validating against the schema. PSRule v2 see: https://marketplace.visualstudio.com/items?itemName=bewhite.psrule-vscode Alternatively, you could manually validate against the schema if you are using different tooling. The schema is here: https://github.com/microsoft/PSRule/blob/release/v2.9.x/schemas/PSRule-language.schema.json |
Beta Was this translation helpful? Give feedback.
Hi @sapritchard, thanks for the question.
The config looks good excepting the indent on the
convention
key as it should be a peer ofbinding
orrule
; child ofspec
. Should be like:See https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Conventions/#using-within-modules
If editing within VSCode, the exten…