Configure Pulumi CrossGuard policy pack in TypeScript to enforce S3 bucket encryption

domain: pulumi.com/docs/iac/using-pulumi/crossguard · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a CrossGuard policy pack directory and run `pulumi policy new aws-typescript` to scaffold a TypeScript policy pack with a `PulumiPolicy.yaml` and `index.ts`.
  2. In `index.ts` define a `ResourceValidationPolicy` that targets `aws.s3.BucketV2` and checks that `serverSideEncryptionConfiguration` is set, calling `reportViolation` if absent.
  3. Run `npm install` in the policy pack directory, then test locally with `pulumi preview --policy-pack .` from a Pulumi stack directory.
  4. Publish the policy pack to the Pulumi Cloud with `pulumi policy publish`; it becomes available for organization-wide enforcement.
  5. Enforce the published policy pack on a specific stack group in the Pulumi Cloud UI under Policies, or at the org level to apply to all stacks.
  6. Use `pulumi policy ls` to list published policy packs and their versions, and `pulumi policy enable <org>/<pack> <version>` to set the active enforced version.

Known gotchas

Related routes

Configure Pulumi CrossGuard policy pack to enforce that all S3 buckets have versioning enabled and that no IAM policies use wildcard actions, with advisory and mandatory enforcement levels
pulumi.com · 5 steps · unrated
Implement a Pulumi component resource in TypeScript that encapsulates an S3 bucket, bucket policy, and CloudFront distribution as a reusable abstraction
pulumi.com · 5 steps · unrated
Configure ClearKey as a testing content-protection mechanism for CENC-encrypted content
w3.org · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans