astonishing-cpu-1506
02/29/2024, 1:00 PMbillions-river-87988
03/01/2024, 5:24 PMastonishing-cpu-1506
03/02/2024, 4:17 PMastonishing-cpu-1506
03/03/2024, 2:23 PM// Copyright 2016-2022, Pulumi Corporation. All rights reserved.
import * as azure from "@pulumi/azure-native";
import * as policy from "@pulumi/policy";
const azureAlwaysFailPolicy: policy.ResourceValidationPolicy = {
name: "azure-always-fail-policy",
description: "Ensures that Azure resources have a 'cloud' tag with the value 'azure'.",
enforcementLevel: "mandatory",
validateResource: policy.validateResourceOfType(azure.resources.Resource, (resource, args, reportViolation) => {
reportViolation(`This policy always fails: [${resource}]`, args.urn); // same effect if I throw here
}),
};
export const policies = new policy.PolicyPack("azure-always-fail", {
policies: [azureAlwaysFailPolicy],
});
All policies pass and show green checkmarks in the CLI output. I'm a bit puzzled
Policies:
✅ azure-always-fail@v0.0.1 (local: ../../poc-azure-pulumi-policy/azure/always-fail)
✅ azure-tags@v0.0.1 (local: ../../poc-azure-pulumi-policy/azure/tags)
Am I missing something with the structure of my index.ts
file?astonishing-cpu-1506
03/03/2024, 2:25 PMbillions-river-87988
03/05/2024, 1:25 AMastonishing-cpu-1506
03/07/2024, 6:05 PMNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by