[x] Add initialConfig property to AnalyzerInfo gRPC message which is returned when retrieving policy pack metadata. This initialConfig represents any config that was specified programmatically to the Policy Pack, for Policy Packs that support programmatic configuration like AWSGuard.
[x] Take initialConfig into account when reconciling default values and any externally specified config.
[x] Add constructor arg to the PolicyPack class that accepts an initialConfig.
[x] Pass the initialConfig along with the GetAnalzyerInfo gRPC.
In pulumi/pulumi-policy-aws:
[x] Rewrite policies to use config system.
[x] Refactor how we register policies internally.
[x] Translate the config args that are passed to the AWSGuard constructor into a form acceptable for initialConfig, and pass the initialConfig to the base PolicyPack class's constructor (PolicyPack).
[x] Update unit tests to be able to specify config values that will be available to the policy handler's args.getConfig().
As part of this, consider consolidating any utility/helper code in
@pulumi/policy
to make it easy to author other Policy Packs in a similar manner.Tasks:
In
pulumi/pulumi
(PR https://github.com/pulumi/pulumi/pull/4233):[x] Add
initialConfig
property toAnalyzerInfo
gRPC message which is returned when retrieving policy pack metadata. ThisinitialConfig
represents any config that was specified programmatically to the Policy Pack, for Policy Packs that support programmatic configuration like AWSGuard.[x] Take
initialConfig
into account when reconciling default values and any externally specified config.In
pulumi/pulumi-policy
(PR https://github.com/pulumi/pulumi-policy/pull/220):[x] Add constructor arg to the
PolicyPack
class that accepts aninitialConfig
.[x] Pass the
initialConfig
along with theGetAnalzyerInfo
gRPC.In
pulumi/pulumi-policy-aws
:[x] Rewrite policies to use config system.
[x] Refactor how we register policies internally.
[x] Translate the config args that are passed to the
AWSGuard
constructor into a form acceptable forinitialConfig
, and pass theinitialConfig
to the basePolicyPack
class's constructor (PolicyPack
).[x] Update unit tests to be able to specify config values that will be available to the policy handler's
args.getConfig()
.