@jjrawlins/cdk-diff-pr-github-action 0.0.1-beta → 0.0.2-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/.jsii +162 -9
  2. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.jsii +163 -10
  3. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.jsii +4070 -0
  4. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.junie/guidelines.md +62 -0
  5. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.tool-versions +3 -0
  6. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.jsii +3946 -0
  7. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.junie/guidelines.md +62 -0
  8. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.tool-versions +3 -0
  9. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.jsii +3917 -0
  10. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.junie/guidelines.md +62 -0
  11. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.tool-versions +3 -0
  12. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/API.md +276 -0
  13. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/LICENSE +202 -0
  14. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/README.md +146 -0
  15. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffIamTemplate.d.ts +8 -0
  16. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffIamTemplate.js +96 -0
  17. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffStackWorkflow.d.ts +22 -0
  18. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffStackWorkflow.js +144 -0
  19. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/cdk-changeset-script.d.ts +9 -0
  20. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/cdk-changeset-script.js +256 -0
  21. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/describe-cfn-changeset.d.ts +1 -0
  22. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/describe-cfn-changeset.js +204 -0
  23. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/index.d.ts +2 -0
  24. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/index.js +19 -0
  25. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/package.json +137 -0
  26. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/yalc.lock +10 -0
  27. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/yalc.sig +1 -0
  28. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/API.md +276 -0
  29. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/LICENSE +202 -0
  30. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/README.md +146 -0
  31. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffIamTemplate.d.ts +10 -0
  32. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffIamTemplate.js +96 -0
  33. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffStackWorkflow.d.ts +22 -0
  34. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffStackWorkflow.js +144 -0
  35. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/cdk-changeset-script.d.ts +9 -0
  36. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/cdk-changeset-script.js +256 -0
  37. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/describe-cfn-changeset.d.ts +1 -0
  38. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/describe-cfn-changeset.js +204 -0
  39. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/detect-drift.d.ts +1 -0
  40. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/detect-drift.js +122 -0
  41. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/index.d.ts +2 -0
  42. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/index.js +19 -0
  43. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/package.json +137 -0
  44. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/yalc.lock +10 -0
  45. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/yalc.sig +1 -0
  46. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/API.md +298 -0
  47. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/LICENSE +202 -0
  48. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/README.md +146 -0
  49. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffIamTemplate.d.ts +10 -0
  50. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffIamTemplate.js +101 -0
  51. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffStackWorkflow.d.ts +22 -0
  52. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffStackWorkflow.js +144 -0
  53. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDriftIamTemplate.d.ts +10 -0
  54. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDriftIamTemplate.js +76 -0
  55. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/cdk-changeset-script.d.ts +9 -0
  56. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/cdk-changeset-script.js +256 -0
  57. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/describe-cfn-changeset.d.ts +1 -0
  58. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/describe-cfn-changeset.js +204 -0
  59. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/detect-drift.d.ts +1 -0
  60. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/detect-drift.js +122 -0
  61. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/index.d.ts +3 -0
  62. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/index.js +20 -0
  63. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/package.json +136 -0
  64. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/yalc.lock +10 -0
  65. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/.yalc/@jjrawlins/cdk-diff-pr-github-action/yalc.sig +1 -0
  66. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/API.md +131 -11
  67. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/README.md +5 -5
  68. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffIamTemplate.d.ts +3 -1
  69. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDiffIamTemplate.js +9 -4
  70. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDriftIamTemplate.d.ts +10 -0
  71. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/CdkDriftIamTemplate.js +76 -0
  72. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/detect-drift.d.ts +1 -0
  73. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/bin/detect-drift.js +122 -0
  74. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/index.d.ts +1 -0
  75. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/lib/index.js +2 -1
  76. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/package.json +1 -2
  77. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/yalc.lock +1 -1
  78. package/.yalc/@jjrawlins/cdk-diff-pr-github-action/yalc.sig +1 -1
  79. package/API.md +125 -5
  80. package/README.md +5 -5
  81. package/lib/CdkDiffIamTemplate.d.ts +3 -1
  82. package/lib/CdkDiffIamTemplate.js +9 -4
  83. package/lib/CdkDiffStackWorkflow.d.ts +2 -2
  84. package/lib/CdkDiffStackWorkflow.js +18 -19
  85. package/lib/CdkDriftIamTemplate.d.ts +10 -0
  86. package/lib/CdkDriftIamTemplate.js +76 -0
  87. package/lib/bin/detect-drift.d.ts +1 -0
  88. package/lib/bin/detect-drift.js +122 -0
  89. package/lib/index.d.ts +1 -0
  90. package/lib/index.js +2 -1
  91. package/package.json +1 -1
  92. package/yalc.lock +1 -1
package/.jsii CHANGED
@@ -3548,7 +3548,7 @@
3548
3548
  },
3549
3549
  "name": "@jjrawlins/cdk-diff-pr-github-action",
3550
3550
  "readme": {
3551
- "markdown": "# cdk-diff-pr-github-action\n\nA small Projen-based helper library that wires a GitHub workflow to create a CloudFormation Change Set for a CDK stack on every pull request, then comments the formatted diff back on the PR. It also provides a ready‑to‑deploy IAM template you can use to grant the minimal permissions required for the workflow to create and inspect change sets.\n\nThis package exposes two constructs:\n\n- `CdkDiffStackWorkflow` — Generates one GitHub Actions workflow per stack that:\n - Assumes your GitHub OIDC role\n - Optionally chains into a separate CDK deploy role\n - Runs `cdk deploy --no-execute` to create a change set\n - Runs a generated script to render the change set as an HTML table and posts it to the PR and to the GitHub Step Summary\n - Cleans up the change set\n\n- `CdkDiffIamTemplate` — Emits a CloudFormation template file (`cdk-diff-workflow-iam-template.yaml`) containing an example IAM role policy with the minimal permissions to create, describe, and delete CloudFormation change sets and read common CDK bootstrap resources. You can launch this in your account and then reference the created role.\n\n## Quick start\n\n1) Add the constructs to your Projen project (in `.projenrc.ts`).\n2) Synthesize with `npx projen`.\n3) Commit the generated files.\n4) Open a pull request — the workflow will create a change set and comment the diff.\n\n## Usage: CdkDiffStackWorkflow\n\n`CdkDiffStackWorkflow` renders a workflow per stack named `diff-<StackName>.yml` under `.github/workflows/`. It also generates a helper script at `.github/workflows/scripts/describe-cfn-changeset.ts` that formats the change set output and takes care of posting the PR comment and Step Summary.\n\nExample `.projenrc.ts`:\n\n```ts\nimport { awscdk } from 'projen';\nimport { CdkDiffStackWorkflow } from '@jjrawlins/cdk-diff-pr-github-action';\n\nconst project = new awscdk.AwsCdkConstructLibrary({\n // ... your usual settings ...\n name: 'my-lib',\n defaultReleaseBranch: 'main',\n cdkVersion: '2.85.0',\n github: true,\n});\n\nnew CdkDiffStackWorkflow({\n project,\n // Stacks to diff on PRs\n stacks: [\n {\n stackName: 'MyAppStack',\n cdkDiffRoleToAssumeArn: 'arn:aws:iam::123456789012:role/cdk-diff-role',\n cdkDiffRoleToAssumeRegion: 'us-east-1',\n // Optional per‑stack OIDC override (if not using the defaults below)\n // oidcRoleArn: 'arn:aws:iam::123456789012:role/github-oidc-role',\n // oidcRegion: 'us-east-1',\n },\n ],\n // Default OIDC role/region used by all stacks unless overridden per‑stack\n oidcRoleArn: 'arn:aws:iam::123456789012:role/github-oidc-role',\n oidcRegion: 'us-east-1',\n // Optional: Node version used in the workflow (default: '24.x')\n // nodeVersion: '20.x',\n // Optional: Yarn command to run CDK (default: 'cdk')\n // cdkYarnCommand: 'cdk',\n // Optional: Where to place the helper script\n // scriptOutputPath: '.github/workflows/scripts/describe-cfn-changeset.ts',\n});\n\nproject.synth();\n```\n\n### Required properties\n- `project` (AwsCdkTypeScriptApp) — Your Projen project instance.\n- `stacks` (array) — One entry per CDK stack you want a diff for.\n- OIDC configuration: either\n - Provide `oidcRoleArn` and `oidcRegion` at the top level, or\n - Provide `oidcRoleArn` and `oidcRegion` on every stack item.\n\nIf neither the defaults nor all per‑stack values are supplied, the construct throws with a helpful error.\n\n### Stack item fields\n- `stackName` — The CDK stack name to create the change set for.\n- `cdkDiffRoleToAssumeArn` — The ARN of the role used to create the change set (role chaining after OIDC).\n- `cdkDiffRoleToAssumeRegion` — The region for that role.\n- `oidcRoleArn` (optional) — Per‑stack override for the OIDC role.\n- `oidcRegion` (optional) — Per‑stack override for the OIDC region.\n\n### What gets generated\n- `.github/workflows/diff-<StackName>.yml` — One workflow per stack, triggered on PR open/sync/reopen.\n- `.github/workflows/scripts/describe-cfn-changeset.ts` — A helper script that:\n - Polls `DescribeChangeSet` until terminal\n - Filters out ignorable logical IDs or resource types using environment variables `IGNORE_LOGICAL_IDS` and `IGNORE_RESOURCE_TYPES`\n - Renders an HTML table with actions, logical IDs, types, replacements, and changed properties\n - Prints the HTML, appends to the GitHub Step Summary, and (if `GITHUB_TOKEN` and `GITHUB_COMMENT_URL` are present) posts a PR comment\n\n### Environment variables used by the script\n- `STACK_NAME` (required) — Stack name to describe.\n- `CHANGE_SET_NAME` (default: same as `STACK_NAME`).\n- `AWS_REGION` — Region for CloudFormation API calls. The workflow sets this via the credentials action.\n- `GITHUB_TOKEN` (optional) — If set with `GITHUB_COMMENT_URL`, posts a PR comment.\n- `GITHUB_COMMENT_URL` (optional) — PR comments URL.\n- `GITHUB_STEP_SUMMARY` (optional) — When present, appends the HTML to the step summary file.\n- `IGNORE_LOGICAL_IDS` (optional) — Comma‑separated logical IDs to ignore (default includes `CDKMetadata`).\n- `IGNORE_RESOURCE_TYPES` (optional) — Comma‑separated resource types to ignore (e.g., `AWS::CDK::Metadata`).\n\n## Usage: CdkDiffIamTemplate\n\nAdd `CdkDiffIamTemplate` to your Projen project to emit an example IAM template you can deploy in your account:\n\n```ts\nimport { awscdk } from 'projen';\nimport { CdkDiffIamTemplate } from '@jjrawlins/cdk-diff-pr-github-action';\n\nconst project = new awscdk.AwsCdkConstructLibrary({\n // ...\n});\n\nnew CdkDiffIamTemplate({ project });\n\nproject.synth();\n```\n\nThis will write `cdk-diff-workflow-iam-template.yaml` at the project root. The template defines:\n- A parameter `GitHubOIDCRoleArn` — pass the ARN of your existing GitHub OIDC role that will assume the change set role.\n- An IAM role `CdkChangesetRole` with minimal permissions for:\n - CloudFormation Change Set operations\n - Access to common CDK bootstrap S3 buckets and SSM parameters\n - `iam:PassRole` to `cloudformation.amazonaws.com`\n- Outputs exporting the role name and ARN.\n\nYou can deploy the file via CloudFormation/StackSets and then use the created role ARN as the `cdkDiffRoleToAssumeArn` in your workflow configuration.\n\n## Testing\n\nThis repository includes Jest tests that snapshot the synthesized outputs from Projen and assert that:\n- Workflows are created per stack and contain all expected steps.\n- Only one script file is generated.\n- Per‑stack OIDC overrides are respected.\n- Helpful validation errors are thrown for missing OIDC settings.\n- The IAM template file contains the expected resources and outputs.\n\nRun tests with:\n\n```bash\nyarn test\n```\n\n## Notes\n- This package assumes your repository is configured with GitHub Actions and that you have a GitHub OIDC role configured in AWS.\n- The generated script uses the AWS SDK v3 for CloudFormation and posts comments using the GitHub REST API.\n"
3551
+ "markdown": "# cdk-diff-pr-github-action\n\nA small Projen-based helper library that wires a GitHub workflow to create a CloudFormation Change Set for a CDK stack on every pull request, then comments the formatted diff back on the PR. It also provides a ready‑to‑deploy IAM template you can use to grant the minimal permissions required for the workflow to create and inspect change sets.\n\nThis package exposes two constructs:\n\n- `CdkDiffStackWorkflow` — Generates one GitHub Actions workflow per stack that:\n - Assumes your GitHub OIDC role\n - Optionally chains into a separate CDK deploy role\n - Runs `cdk deploy --no-execute` to create a change set\n - Runs a generated script to render the change set as an HTML table and posts it to the PR and to the GitHub Step Summary\n - Cleans up the change set\n\n- `CdkDiffIamTemplate` — Emits a CloudFormation template file (`cdk-diff-workflow-iam-template.yaml`) containing an example IAM role policy with the minimal permissions to create, describe, and delete CloudFormation change sets and read common CDK bootstrap resources. You can launch this in your account and then reference the created role.\n\n## Quick start\n\n1) Add the constructs to your Projen project (in `.projenrc.ts`).\n2) Synthesize with `npx projen`.\n3) Commit the generated files.\n4) Open a pull request — the workflow will create a change set and comment the diff.\n\n## Usage: CdkDiffStackWorkflow\n\n`CdkDiffStackWorkflow` renders a workflow per stack named `diff-<StackName>.yml` under `.github/workflows/`. It also generates a helper script at `.github/workflows/scripts/describe-cfn-changeset.ts` that formats the change set output and takes care of posting the PR comment and Step Summary.\n\nExample `.projenrc.ts`:\n\n```ts\nimport { awscdk } from 'projen';\nimport { CdkDiffStackWorkflow } from '@jjrawlins/cdk-diff-pr-github-action';\n\nconst project = new awscdk.AwsCdkConstructLibrary({\n // ... your usual settings ...\n name: 'my-lib',\n defaultReleaseBranch: 'main',\n cdkVersion: '2.85.0',\n github: true,\n});\n\nnew CdkDiffStackWorkflow({\n project,\n // Stacks to diff on PRs\n stacks: [\n {\n stackName: 'MyAppStack',\n changesetRoleToAssumeArn: 'arn:aws:iam::123456789012:role/cdk-diff-role',\n changesetRoleToAssumeRegion: 'us-east-1',\n // Optional per‑stack OIDC override (if not using the defaults below)\n // oidcRoleArn: 'arn:aws:iam::123456789012:role/github-oidc-role',\n // oidcRegion: 'us-east-1',\n },\n ],\n // Default OIDC role/region used by all stacks unless overridden per‑stack\n oidcRoleArn: 'arn:aws:iam::123456789012:role/github-oidc-role',\n oidcRegion: 'us-east-1',\n // Optional: Node version used in the workflow (default: '24.x')\n // nodeVersion: '20.x',\n // Optional: Yarn command to run CDK (default: 'cdk')\n // cdkYarnCommand: 'cdk',\n // Optional: Where to place the helper script\n // scriptOutputPath: '.github/workflows/scripts/describe-cfn-changeset.ts',\n});\n\nproject.synth();\n```\n\n### Required properties\n- `project` (AwsCdkTypeScriptApp) — Your Projen project instance.\n- `stacks` (array) — One entry per CDK stack you want a diff for.\n- OIDC configuration: either\n - Provide `oidcRoleArn` and `oidcRegion` at the top level, or\n - Provide `oidcRoleArn` and `oidcRegion` on every stack item.\n\nIf neither the defaults nor all per‑stack values are supplied, the construct throws with a helpful error.\n\n### Stack item fields\n- `stackName` — The CDK stack name to create the change set for.\n- `changesetRoleToAssumeArn` — The ARN of the role used to create the change set (role chaining after OIDC).\n- `changesetRoleToAssumeRegion` — The region for that role.\n- `oidcRoleArn` (optional) — Per‑stack override for the OIDC role.\n- `oidcRegion` (optional) — Per‑stack override for the OIDC region.\n\n### What gets generated\n- `.github/workflows/diff-<StackName>.yml` — One workflow per stack, triggered on PR open/sync/reopen.\n- `.github/workflows/scripts/describe-cfn-changeset.ts` — A helper script that:\n - Polls `DescribeChangeSet` until terminal\n - Filters out ignorable logical IDs or resource types using environment variables `IGNORE_LOGICAL_IDS` and `IGNORE_RESOURCE_TYPES`\n - Renders an HTML table with actions, logical IDs, types, replacements, and changed properties\n - Prints the HTML, appends to the GitHub Step Summary, and (if `GITHUB_TOKEN` and `GITHUB_COMMENT_URL` are present) posts a PR comment\n\n### Environment variables used by the script\n- `STACK_NAME` (required) — Stack name to describe.\n- `CHANGE_SET_NAME` (default: same as `STACK_NAME`).\n- `AWS_REGION` — Region for CloudFormation API calls. The workflow sets this via the credentials action.\n- `GITHUB_TOKEN` (optional) — If set with `GITHUB_COMMENT_URL`, posts a PR comment.\n- `GITHUB_COMMENT_URL` (optional) — PR comments URL.\n- `GITHUB_STEP_SUMMARY` (optional) — When present, appends the HTML to the step summary file.\n- `IGNORE_LOGICAL_IDS` (optional) — Comma‑separated logical IDs to ignore (default includes `CDKMetadata`).\n- `IGNORE_RESOURCE_TYPES` (optional) — Comma‑separated resource types to ignore (e.g., `AWS::CDK::Metadata`).\n\n## Usage: CdkDiffIamTemplate\n\nAdd `CdkDiffIamTemplate` to your Projen project to emit an example IAM template you can deploy in your account:\n\n```ts\nimport { awscdk } from 'projen';\nimport { CdkDiffIamTemplate } from '@jjrawlins/cdk-diff-pr-github-action';\n\nconst project = new awscdk.AwsCdkConstructLibrary({\n // ...\n});\n\nnew CdkDiffIamTemplate({ project });\n\nproject.synth();\n```\n\nThis will write `cdk-diff-workflow-iam-template.yaml` at the project root. The template defines:\n- A parameter `GitHubOIDCRoleArn` — pass the ARN of your existing GitHub OIDC role that will assume the change set role.\n- An IAM role `CdkChangesetRole` with minimal permissions for:\n - CloudFormation Change Set operations\n - Access to common CDK bootstrap S3 buckets and SSM parameters\n - `iam:PassRole` to `cloudformation.amazonaws.com`\n- Outputs exporting the role name and ARN.\n\nYou can deploy the file via CloudFormation/StackSets and then use the created role ARN as the `changesetRoleToAssumeArn` in your workflow configuration.\n\n## Testing\n\nThis repository includes Jest tests that snapshot the synthesized outputs from Projen and assert that:\n- Workflows are created per stack and contain all expected steps.\n- Only one script file is generated.\n- Per‑stack OIDC overrides are respected.\n- Helpful validation errors are thrown for missing OIDC settings.\n- The IAM template file contains the expected resources and outputs.\n\nRun tests with:\n\n```bash\nyarn test\n```\n\n## Notes\n- This package assumes your repository is configured with GitHub Actions and that you have a GitHub OIDC role configured in AWS.\n- The generated script uses the AWS SDK v3 for CloudFormation and posts comments using the GitHub REST API.\n"
3552
3552
  },
3553
3553
  "repository": {
3554
3554
  "type": "git",
@@ -3573,7 +3573,7 @@
3573
3573
  },
3574
3574
  "locationInModule": {
3575
3575
  "filename": "src/CdkDiffIamTemplate.ts",
3576
- "line": 10
3576
+ "line": 12
3577
3577
  },
3578
3578
  "parameters": [
3579
3579
  {
@@ -3587,7 +3587,7 @@
3587
3587
  "kind": "class",
3588
3588
  "locationInModule": {
3589
3589
  "filename": "src/CdkDiffIamTemplate.ts",
3590
- "line": 9
3590
+ "line": 11
3591
3591
  },
3592
3592
  "name": "CdkDiffIamTemplate",
3593
3593
  "symbolId": "src/CdkDiffIamTemplate:CdkDiffIamTemplate"
@@ -3606,6 +3606,36 @@
3606
3606
  },
3607
3607
  "name": "CdkDiffIamTemplateProps",
3608
3608
  "properties": [
3609
+ {
3610
+ "abstract": true,
3611
+ "docs": {
3612
+ "stability": "stable"
3613
+ },
3614
+ "immutable": true,
3615
+ "locationInModule": {
3616
+ "filename": "src/CdkDiffIamTemplate.ts",
3617
+ "line": 8
3618
+ },
3619
+ "name": "oidcRegion",
3620
+ "type": {
3621
+ "primitive": "string"
3622
+ }
3623
+ },
3624
+ {
3625
+ "abstract": true,
3626
+ "docs": {
3627
+ "stability": "stable"
3628
+ },
3629
+ "immutable": true,
3630
+ "locationInModule": {
3631
+ "filename": "src/CdkDiffIamTemplate.ts",
3632
+ "line": 7
3633
+ },
3634
+ "name": "oidcRoleArn",
3635
+ "type": {
3636
+ "primitive": "string"
3637
+ }
3638
+ },
3609
3639
  {
3610
3640
  "abstract": true,
3611
3641
  "docs": {
@@ -3631,8 +3661,7 @@
3631
3661
  "filename": "src/CdkDiffIamTemplate.ts",
3632
3662
  "line": 5
3633
3663
  },
3634
- "name": "outputPath",
3635
- "optional": true,
3664
+ "name": "roleName",
3636
3665
  "type": {
3637
3666
  "primitive": "string"
3638
3667
  }
@@ -3647,7 +3676,7 @@
3647
3676
  "filename": "src/CdkDiffIamTemplate.ts",
3648
3677
  "line": 6
3649
3678
  },
3650
- "name": "stackName",
3679
+ "name": "outputPath",
3651
3680
  "optional": true,
3652
3681
  "type": {
3653
3682
  "primitive": "string"
@@ -3680,7 +3709,7 @@
3680
3709
  "filename": "src/CdkDiffStackWorkflow.ts",
3681
3710
  "line": 11
3682
3711
  },
3683
- "name": "cdkDiffRoleToAssumeArn",
3712
+ "name": "changesetRoleToAssumeArn",
3684
3713
  "type": {
3685
3714
  "primitive": "string"
3686
3715
  }
@@ -3695,7 +3724,7 @@
3695
3724
  "filename": "src/CdkDiffStackWorkflow.ts",
3696
3725
  "line": 12
3697
3726
  },
3698
- "name": "cdkDiffRoleToAssumeRegion",
3727
+ "name": "changesetRoleToAssumeRegion",
3699
3728
  "type": {
3700
3729
  "primitive": "string"
3701
3730
  }
@@ -3910,8 +3939,132 @@
3910
3939
  }
3911
3940
  ],
3912
3941
  "symbolId": "src/CdkDiffStackWorkflow:CdkDiffStackWorkflowProps"
3942
+ },
3943
+ "@jjrawlins/cdk-diff-pr-github-action.CdkDriftIamTemplate": {
3944
+ "assembly": "@jjrawlins/cdk-diff-pr-github-action",
3945
+ "docs": {
3946
+ "stability": "stable"
3947
+ },
3948
+ "fqn": "@jjrawlins/cdk-diff-pr-github-action.CdkDriftIamTemplate",
3949
+ "initializer": {
3950
+ "docs": {
3951
+ "stability": "stable"
3952
+ },
3953
+ "locationInModule": {
3954
+ "filename": "src/CdkDriftIamTemplate.ts",
3955
+ "line": 12
3956
+ },
3957
+ "parameters": [
3958
+ {
3959
+ "name": "props",
3960
+ "type": {
3961
+ "fqn": "@jjrawlins/cdk-diff-pr-github-action.CdkDriftIamTemplateProps"
3962
+ }
3963
+ }
3964
+ ]
3965
+ },
3966
+ "kind": "class",
3967
+ "locationInModule": {
3968
+ "filename": "src/CdkDriftIamTemplate.ts",
3969
+ "line": 11
3970
+ },
3971
+ "name": "CdkDriftIamTemplate",
3972
+ "symbolId": "src/CdkDriftIamTemplate:CdkDriftIamTemplate"
3973
+ },
3974
+ "@jjrawlins/cdk-diff-pr-github-action.CdkDriftIamTemplateProps": {
3975
+ "assembly": "@jjrawlins/cdk-diff-pr-github-action",
3976
+ "datatype": true,
3977
+ "docs": {
3978
+ "stability": "stable"
3979
+ },
3980
+ "fqn": "@jjrawlins/cdk-diff-pr-github-action.CdkDriftIamTemplateProps",
3981
+ "kind": "interface",
3982
+ "locationInModule": {
3983
+ "filename": "src/CdkDriftIamTemplate.ts",
3984
+ "line": 3
3985
+ },
3986
+ "name": "CdkDriftIamTemplateProps",
3987
+ "properties": [
3988
+ {
3989
+ "abstract": true,
3990
+ "docs": {
3991
+ "stability": "stable"
3992
+ },
3993
+ "immutable": true,
3994
+ "locationInModule": {
3995
+ "filename": "src/CdkDriftIamTemplate.ts",
3996
+ "line": 8
3997
+ },
3998
+ "name": "oidcRegion",
3999
+ "type": {
4000
+ "primitive": "string"
4001
+ }
4002
+ },
4003
+ {
4004
+ "abstract": true,
4005
+ "docs": {
4006
+ "stability": "stable"
4007
+ },
4008
+ "immutable": true,
4009
+ "locationInModule": {
4010
+ "filename": "src/CdkDriftIamTemplate.ts",
4011
+ "line": 7
4012
+ },
4013
+ "name": "oidcRoleArn",
4014
+ "type": {
4015
+ "primitive": "string"
4016
+ }
4017
+ },
4018
+ {
4019
+ "abstract": true,
4020
+ "docs": {
4021
+ "stability": "stable"
4022
+ },
4023
+ "immutable": true,
4024
+ "locationInModule": {
4025
+ "filename": "src/CdkDriftIamTemplate.ts",
4026
+ "line": 4
4027
+ },
4028
+ "name": "project",
4029
+ "type": {
4030
+ "primitive": "any"
4031
+ }
4032
+ },
4033
+ {
4034
+ "abstract": true,
4035
+ "docs": {
4036
+ "stability": "stable"
4037
+ },
4038
+ "immutable": true,
4039
+ "locationInModule": {
4040
+ "filename": "src/CdkDriftIamTemplate.ts",
4041
+ "line": 5
4042
+ },
4043
+ "name": "roleName",
4044
+ "type": {
4045
+ "primitive": "string"
4046
+ }
4047
+ },
4048
+ {
4049
+ "abstract": true,
4050
+ "docs": {
4051
+ "stability": "stable"
4052
+ },
4053
+ "immutable": true,
4054
+ "locationInModule": {
4055
+ "filename": "src/CdkDriftIamTemplate.ts",
4056
+ "line": 6
4057
+ },
4058
+ "name": "outputPath",
4059
+ "optional": true,
4060
+ "type": {
4061
+ "primitive": "string"
4062
+ }
4063
+ }
4064
+ ],
4065
+ "symbolId": "src/CdkDriftIamTemplate:CdkDriftIamTemplateProps"
3913
4066
  }
3914
4067
  },
3915
4068
  "version": "0.0.0",
3916
- "fingerprint": "tHH4O3w5aknRRboRsohbwELbBny5Nck+ehKsoWl+2Rw="
4069
+ "fingerprint": "jeIoS9wFV5gvSB5n6I47EQ8xc8cvuCuUbHfjjZ0ESFg="
3917
4070
  }
@@ -3548,7 +3548,7 @@
3548
3548
  },
3549
3549
  "name": "@jjrawlins/cdk-diff-pr-github-action",
3550
3550
  "readme": {
3551
- "markdown": "# cdk-diff-pr-github-action\n\nA small Projen-based helper library that wires a GitHub workflow to create a CloudFormation Change Set for a CDK stack on every pull request, then comments the formatted diff back on the PR. It also provides a ready‑to‑deploy IAM template you can use to grant the minimal permissions required for the workflow to create and inspect change sets.\n\nThis package exposes two constructs:\n\n- `CdkDiffStackWorkflow` — Generates one GitHub Actions workflow per stack that:\n - Assumes your GitHub OIDC role\n - Optionally chains into a separate CDK deploy role\n - Runs `cdk deploy --no-execute` to create a change set\n - Runs a generated script to render the change set as an HTML table and posts it to the PR and to the GitHub Step Summary\n - Cleans up the change set\n\n- `CdkDiffIamTemplate` — Emits a CloudFormation template file (`cdk-diff-workflow-iam-template.yaml`) containing an example IAM role policy with the minimal permissions to create, describe, and delete CloudFormation change sets and read common CDK bootstrap resources. You can launch this in your account and then reference the created role.\n\n## Quick start\n\n1) Add the constructs to your Projen project (in `.projenrc.ts`).\n2) Synthesize with `npx projen`.\n3) Commit the generated files.\n4) Open a pull request — the workflow will create a change set and comment the diff.\n\n## Usage: CdkDiffStackWorkflow\n\n`CdkDiffStackWorkflow` renders a workflow per stack named `diff-<StackName>.yml` under `.github/workflows/`. It also generates a helper script at `.github/workflows/scripts/describe-cfn-changeset.ts` that formats the change set output and takes care of posting the PR comment and Step Summary.\n\nExample `.projenrc.ts`:\n\n```ts\nimport { awscdk } from 'projen';\nimport { CdkDiffStackWorkflow } from '@jjrawlins/cdk-diff-pr-github-action';\n\nconst project = new awscdk.AwsCdkConstructLibrary({\n // ... your usual settings ...\n name: 'my-lib',\n defaultReleaseBranch: 'main',\n cdkVersion: '2.85.0',\n github: true,\n});\n\nnew CdkDiffStackWorkflow({\n project,\n // Stacks to diff on PRs\n stacks: [\n {\n stackName: 'MyAppStack',\n cdkDiffRoleToAssumeArn: 'arn:aws:iam::123456789012:role/cdk-diff-role',\n cdkDiffRoleToAssumeRegion: 'us-east-1',\n // Optional per‑stack OIDC override (if not using the defaults below)\n // oidcRoleArn: 'arn:aws:iam::123456789012:role/github-oidc-role',\n // oidcRegion: 'us-east-1',\n },\n ],\n // Default OIDC role/region used by all stacks unless overridden per‑stack\n oidcRoleArn: 'arn:aws:iam::123456789012:role/github-oidc-role',\n oidcRegion: 'us-east-1',\n // Optional: Node version used in the workflow (default: '24.x')\n // nodeVersion: '20.x',\n // Optional: Yarn command to run CDK (default: 'cdk')\n // cdkYarnCommand: 'cdk',\n // Optional: Where to place the helper script\n // scriptOutputPath: '.github/workflows/scripts/describe-cfn-changeset.ts',\n});\n\nproject.synth();\n```\n\n### Required properties\n- `project` (AwsCdkTypeScriptApp) — Your Projen project instance.\n- `stacks` (array) — One entry per CDK stack you want a diff for.\n- OIDC configuration: either\n - Provide `oidcRoleArn` and `oidcRegion` at the top level, or\n - Provide `oidcRoleArn` and `oidcRegion` on every stack item.\n\nIf neither the defaults nor all per‑stack values are supplied, the construct throws with a helpful error.\n\n### Stack item fields\n- `stackName` — The CDK stack name to create the change set for.\n- `cdkDiffRoleToAssumeArn` — The ARN of the role used to create the change set (role chaining after OIDC).\n- `cdkDiffRoleToAssumeRegion` — The region for that role.\n- `oidcRoleArn` (optional) — Per‑stack override for the OIDC role.\n- `oidcRegion` (optional) — Per‑stack override for the OIDC region.\n\n### What gets generated\n- `.github/workflows/diff-<StackName>.yml` — One workflow per stack, triggered on PR open/sync/reopen.\n- `.github/workflows/scripts/describe-cfn-changeset.ts` — A helper script that:\n - Polls `DescribeChangeSet` until terminal\n - Filters out ignorable logical IDs or resource types using environment variables `IGNORE_LOGICAL_IDS` and `IGNORE_RESOURCE_TYPES`\n - Renders an HTML table with actions, logical IDs, types, replacements, and changed properties\n - Prints the HTML, appends to the GitHub Step Summary, and (if `GITHUB_TOKEN` and `GITHUB_COMMENT_URL` are present) posts a PR comment\n\n### Environment variables used by the script\n- `STACK_NAME` (required) — Stack name to describe.\n- `CHANGE_SET_NAME` (default: same as `STACK_NAME`).\n- `AWS_REGION` — Region for CloudFormation API calls. The workflow sets this via the credentials action.\n- `GITHUB_TOKEN` (optional) — If set with `GITHUB_COMMENT_URL`, posts a PR comment.\n- `GITHUB_COMMENT_URL` (optional) — PR comments URL.\n- `GITHUB_STEP_SUMMARY` (optional) — When present, appends the HTML to the step summary file.\n- `IGNORE_LOGICAL_IDS` (optional) — Comma‑separated logical IDs to ignore (default includes `CDKMetadata`).\n- `IGNORE_RESOURCE_TYPES` (optional) — Comma‑separated resource types to ignore (e.g., `AWS::CDK::Metadata`).\n\n## Usage: CdkDiffIamTemplate\n\nAdd `CdkDiffIamTemplate` to your Projen project to emit an example IAM template you can deploy in your account:\n\n```ts\nimport { awscdk } from 'projen';\nimport { CdkDiffIamTemplate } from '@jjrawlins/cdk-diff-pr-github-action';\n\nconst project = new awscdk.AwsCdkConstructLibrary({\n // ...\n});\n\nnew CdkDiffIamTemplate({ project });\n\nproject.synth();\n```\n\nThis will write `cdk-diff-workflow-iam-template.yaml` at the project root. The template defines:\n- A parameter `GitHubOIDCRoleArn` — pass the ARN of your existing GitHub OIDC role that will assume the change set role.\n- An IAM role `CdkChangesetRole` with minimal permissions for:\n - CloudFormation Change Set operations\n - Access to common CDK bootstrap S3 buckets and SSM parameters\n - `iam:PassRole` to `cloudformation.amazonaws.com`\n- Outputs exporting the role name and ARN.\n\nYou can deploy the file via CloudFormation/StackSets and then use the created role ARN as the `cdkDiffRoleToAssumeArn` in your workflow configuration.\n\n## Testing\n\nThis repository includes Jest tests that snapshot the synthesized outputs from Projen and assert that:\n- Workflows are created per stack and contain all expected steps.\n- Only one script file is generated.\n- Per‑stack OIDC overrides are respected.\n- Helpful validation errors are thrown for missing OIDC settings.\n- The IAM template file contains the expected resources and outputs.\n\nRun tests with:\n\n```bash\nyarn test\n```\n\n## Notes\n- This package assumes your repository is configured with GitHub Actions and that you have a GitHub OIDC role configured in AWS.\n- The generated script uses the AWS SDK v3 for CloudFormation and posts comments using the GitHub REST API.\n"
3551
+ "markdown": "# cdk-diff-pr-github-action\n\nA small Projen-based helper library that wires a GitHub workflow to create a CloudFormation Change Set for a CDK stack on every pull request, then comments the formatted diff back on the PR. It also provides a ready‑to‑deploy IAM template you can use to grant the minimal permissions required for the workflow to create and inspect change sets.\n\nThis package exposes two constructs:\n\n- `CdkDiffStackWorkflow` — Generates one GitHub Actions workflow per stack that:\n - Assumes your GitHub OIDC role\n - Optionally chains into a separate CDK deploy role\n - Runs `cdk deploy --no-execute` to create a change set\n - Runs a generated script to render the change set as an HTML table and posts it to the PR and to the GitHub Step Summary\n - Cleans up the change set\n\n- `CdkDiffIamTemplate` — Emits a CloudFormation template file (`cdk-diff-workflow-iam-template.yaml`) containing an example IAM role policy with the minimal permissions to create, describe, and delete CloudFormation change sets and read common CDK bootstrap resources. You can launch this in your account and then reference the created role.\n\n## Quick start\n\n1) Add the constructs to your Projen project (in `.projenrc.ts`).\n2) Synthesize with `npx projen`.\n3) Commit the generated files.\n4) Open a pull request — the workflow will create a change set and comment the diff.\n\n## Usage: CdkDiffStackWorkflow\n\n`CdkDiffStackWorkflow` renders a workflow per stack named `diff-<StackName>.yml` under `.github/workflows/`. It also generates a helper script at `.github/workflows/scripts/describe-cfn-changeset.ts` that formats the change set output and takes care of posting the PR comment and Step Summary.\n\nExample `.projenrc.ts`:\n\n```ts\nimport { awscdk } from 'projen';\nimport { CdkDiffStackWorkflow } from '@jjrawlins/cdk-diff-pr-github-action';\n\nconst project = new awscdk.AwsCdkConstructLibrary({\n // ... your usual settings ...\n name: 'my-lib',\n defaultReleaseBranch: 'main',\n cdkVersion: '2.85.0',\n github: true,\n});\n\nnew CdkDiffStackWorkflow({\n project,\n // Stacks to diff on PRs\n stacks: [\n {\n stackName: 'MyAppStack',\n changesetRoleToAssumeArn: 'arn:aws:iam::123456789012:role/cdk-diff-role',\n changesetRoleToAssumeRegion: 'us-east-1',\n // Optional per‑stack OIDC override (if not using the defaults below)\n // oidcRoleArn: 'arn:aws:iam::123456789012:role/github-oidc-role',\n // oidcRegion: 'us-east-1',\n },\n ],\n // Default OIDC role/region used by all stacks unless overridden per‑stack\n oidcRoleArn: 'arn:aws:iam::123456789012:role/github-oidc-role',\n oidcRegion: 'us-east-1',\n // Optional: Node version used in the workflow (default: '24.x')\n // nodeVersion: '20.x',\n // Optional: Yarn command to run CDK (default: 'cdk')\n // cdkYarnCommand: 'cdk',\n // Optional: Where to place the helper script\n // scriptOutputPath: '.github/workflows/scripts/describe-cfn-changeset.ts',\n});\n\nproject.synth();\n```\n\n### Required properties\n- `project` (AwsCdkTypeScriptApp) — Your Projen project instance.\n- `stacks` (array) — One entry per CDK stack you want a diff for.\n- OIDC configuration: either\n - Provide `oidcRoleArn` and `oidcRegion` at the top level, or\n - Provide `oidcRoleArn` and `oidcRegion` on every stack item.\n\nIf neither the defaults nor all per‑stack values are supplied, the construct throws with a helpful error.\n\n### Stack item fields\n- `stackName` — The CDK stack name to create the change set for.\n- `changesetRoleToAssumeArn` — The ARN of the role used to create the change set (role chaining after OIDC).\n- `changesetRoleToAssumeRegion` — The region for that role.\n- `oidcRoleArn` (optional) — Per‑stack override for the OIDC role.\n- `oidcRegion` (optional) — Per‑stack override for the OIDC region.\n\n### What gets generated\n- `.github/workflows/diff-<StackName>.yml` — One workflow per stack, triggered on PR open/sync/reopen.\n- `.github/workflows/scripts/describe-cfn-changeset.ts` — A helper script that:\n - Polls `DescribeChangeSet` until terminal\n - Filters out ignorable logical IDs or resource types using environment variables `IGNORE_LOGICAL_IDS` and `IGNORE_RESOURCE_TYPES`\n - Renders an HTML table with actions, logical IDs, types, replacements, and changed properties\n - Prints the HTML, appends to the GitHub Step Summary, and (if `GITHUB_TOKEN` and `GITHUB_COMMENT_URL` are present) posts a PR comment\n\n### Environment variables used by the script\n- `STACK_NAME` (required) — Stack name to describe.\n- `CHANGE_SET_NAME` (default: same as `STACK_NAME`).\n- `AWS_REGION` — Region for CloudFormation API calls. The workflow sets this via the credentials action.\n- `GITHUB_TOKEN` (optional) — If set with `GITHUB_COMMENT_URL`, posts a PR comment.\n- `GITHUB_COMMENT_URL` (optional) — PR comments URL.\n- `GITHUB_STEP_SUMMARY` (optional) — When present, appends the HTML to the step summary file.\n- `IGNORE_LOGICAL_IDS` (optional) — Comma‑separated logical IDs to ignore (default includes `CDKMetadata`).\n- `IGNORE_RESOURCE_TYPES` (optional) — Comma‑separated resource types to ignore (e.g., `AWS::CDK::Metadata`).\n\n## Usage: CdkDiffIamTemplate\n\nAdd `CdkDiffIamTemplate` to your Projen project to emit an example IAM template you can deploy in your account:\n\n```ts\nimport { awscdk } from 'projen';\nimport { CdkDiffIamTemplate } from '@jjrawlins/cdk-diff-pr-github-action';\n\nconst project = new awscdk.AwsCdkConstructLibrary({\n // ...\n});\n\nnew CdkDiffIamTemplate({ project });\n\nproject.synth();\n```\n\nThis will write `cdk-diff-workflow-iam-template.yaml` at the project root. The template defines:\n- A parameter `GitHubOIDCRoleArn` — pass the ARN of your existing GitHub OIDC role that will assume the change set role.\n- An IAM role `CdkChangesetRole` with minimal permissions for:\n - CloudFormation Change Set operations\n - Access to common CDK bootstrap S3 buckets and SSM parameters\n - `iam:PassRole` to `cloudformation.amazonaws.com`\n- Outputs exporting the role name and ARN.\n\nYou can deploy the file via CloudFormation/StackSets and then use the created role ARN as the `changesetRoleToAssumeArn` in your workflow configuration.\n\n## Testing\n\nThis repository includes Jest tests that snapshot the synthesized outputs from Projen and assert that:\n- Workflows are created per stack and contain all expected steps.\n- Only one script file is generated.\n- Per‑stack OIDC overrides are respected.\n- Helpful validation errors are thrown for missing OIDC settings.\n- The IAM template file contains the expected resources and outputs.\n\nRun tests with:\n\n```bash\nyarn test\n```\n\n## Notes\n- This package assumes your repository is configured with GitHub Actions and that you have a GitHub OIDC role configured in AWS.\n- The generated script uses the AWS SDK v3 for CloudFormation and posts comments using the GitHub REST API.\n"
3552
3552
  },
3553
3553
  "repository": {
3554
3554
  "type": "git",
@@ -3573,7 +3573,7 @@
3573
3573
  },
3574
3574
  "locationInModule": {
3575
3575
  "filename": "src/CdkDiffIamTemplate.ts",
3576
- "line": 10
3576
+ "line": 12
3577
3577
  },
3578
3578
  "parameters": [
3579
3579
  {
@@ -3587,7 +3587,7 @@
3587
3587
  "kind": "class",
3588
3588
  "locationInModule": {
3589
3589
  "filename": "src/CdkDiffIamTemplate.ts",
3590
- "line": 9
3590
+ "line": 11
3591
3591
  },
3592
3592
  "name": "CdkDiffIamTemplate",
3593
3593
  "symbolId": "src/CdkDiffIamTemplate:CdkDiffIamTemplate"
@@ -3606,6 +3606,36 @@
3606
3606
  },
3607
3607
  "name": "CdkDiffIamTemplateProps",
3608
3608
  "properties": [
3609
+ {
3610
+ "abstract": true,
3611
+ "docs": {
3612
+ "stability": "stable"
3613
+ },
3614
+ "immutable": true,
3615
+ "locationInModule": {
3616
+ "filename": "src/CdkDiffIamTemplate.ts",
3617
+ "line": 8
3618
+ },
3619
+ "name": "oidcRegion",
3620
+ "type": {
3621
+ "primitive": "string"
3622
+ }
3623
+ },
3624
+ {
3625
+ "abstract": true,
3626
+ "docs": {
3627
+ "stability": "stable"
3628
+ },
3629
+ "immutable": true,
3630
+ "locationInModule": {
3631
+ "filename": "src/CdkDiffIamTemplate.ts",
3632
+ "line": 7
3633
+ },
3634
+ "name": "oidcRoleArn",
3635
+ "type": {
3636
+ "primitive": "string"
3637
+ }
3638
+ },
3609
3639
  {
3610
3640
  "abstract": true,
3611
3641
  "docs": {
@@ -3631,8 +3661,7 @@
3631
3661
  "filename": "src/CdkDiffIamTemplate.ts",
3632
3662
  "line": 5
3633
3663
  },
3634
- "name": "outputPath",
3635
- "optional": true,
3664
+ "name": "roleName",
3636
3665
  "type": {
3637
3666
  "primitive": "string"
3638
3667
  }
@@ -3647,7 +3676,7 @@
3647
3676
  "filename": "src/CdkDiffIamTemplate.ts",
3648
3677
  "line": 6
3649
3678
  },
3650
- "name": "stackName",
3679
+ "name": "outputPath",
3651
3680
  "optional": true,
3652
3681
  "type": {
3653
3682
  "primitive": "string"
@@ -3680,7 +3709,7 @@
3680
3709
  "filename": "src/CdkDiffStackWorkflow.ts",
3681
3710
  "line": 11
3682
3711
  },
3683
- "name": "cdkDiffRoleToAssumeArn",
3712
+ "name": "changesetRoleToAssumeArn",
3684
3713
  "type": {
3685
3714
  "primitive": "string"
3686
3715
  }
@@ -3695,7 +3724,7 @@
3695
3724
  "filename": "src/CdkDiffStackWorkflow.ts",
3696
3725
  "line": 12
3697
3726
  },
3698
- "name": "cdkDiffRoleToAssumeRegion",
3727
+ "name": "changesetRoleToAssumeRegion",
3699
3728
  "type": {
3700
3729
  "primitive": "string"
3701
3730
  }
@@ -3910,8 +3939,132 @@
3910
3939
  }
3911
3940
  ],
3912
3941
  "symbolId": "src/CdkDiffStackWorkflow:CdkDiffStackWorkflowProps"
3942
+ },
3943
+ "@jjrawlins/cdk-diff-pr-github-action.CdkDriftIamTemplate": {
3944
+ "assembly": "@jjrawlins/cdk-diff-pr-github-action",
3945
+ "docs": {
3946
+ "stability": "stable"
3947
+ },
3948
+ "fqn": "@jjrawlins/cdk-diff-pr-github-action.CdkDriftIamTemplate",
3949
+ "initializer": {
3950
+ "docs": {
3951
+ "stability": "stable"
3952
+ },
3953
+ "locationInModule": {
3954
+ "filename": "src/CdkDriftIamTemplate.ts",
3955
+ "line": 12
3956
+ },
3957
+ "parameters": [
3958
+ {
3959
+ "name": "props",
3960
+ "type": {
3961
+ "fqn": "@jjrawlins/cdk-diff-pr-github-action.CdkDriftIamTemplateProps"
3962
+ }
3963
+ }
3964
+ ]
3965
+ },
3966
+ "kind": "class",
3967
+ "locationInModule": {
3968
+ "filename": "src/CdkDriftIamTemplate.ts",
3969
+ "line": 11
3970
+ },
3971
+ "name": "CdkDriftIamTemplate",
3972
+ "symbolId": "src/CdkDriftIamTemplate:CdkDriftIamTemplate"
3973
+ },
3974
+ "@jjrawlins/cdk-diff-pr-github-action.CdkDriftIamTemplateProps": {
3975
+ "assembly": "@jjrawlins/cdk-diff-pr-github-action",
3976
+ "datatype": true,
3977
+ "docs": {
3978
+ "stability": "stable"
3979
+ },
3980
+ "fqn": "@jjrawlins/cdk-diff-pr-github-action.CdkDriftIamTemplateProps",
3981
+ "kind": "interface",
3982
+ "locationInModule": {
3983
+ "filename": "src/CdkDriftIamTemplate.ts",
3984
+ "line": 3
3985
+ },
3986
+ "name": "CdkDriftIamTemplateProps",
3987
+ "properties": [
3988
+ {
3989
+ "abstract": true,
3990
+ "docs": {
3991
+ "stability": "stable"
3992
+ },
3993
+ "immutable": true,
3994
+ "locationInModule": {
3995
+ "filename": "src/CdkDriftIamTemplate.ts",
3996
+ "line": 8
3997
+ },
3998
+ "name": "oidcRegion",
3999
+ "type": {
4000
+ "primitive": "string"
4001
+ }
4002
+ },
4003
+ {
4004
+ "abstract": true,
4005
+ "docs": {
4006
+ "stability": "stable"
4007
+ },
4008
+ "immutable": true,
4009
+ "locationInModule": {
4010
+ "filename": "src/CdkDriftIamTemplate.ts",
4011
+ "line": 7
4012
+ },
4013
+ "name": "oidcRoleArn",
4014
+ "type": {
4015
+ "primitive": "string"
4016
+ }
4017
+ },
4018
+ {
4019
+ "abstract": true,
4020
+ "docs": {
4021
+ "stability": "stable"
4022
+ },
4023
+ "immutable": true,
4024
+ "locationInModule": {
4025
+ "filename": "src/CdkDriftIamTemplate.ts",
4026
+ "line": 4
4027
+ },
4028
+ "name": "project",
4029
+ "type": {
4030
+ "primitive": "any"
4031
+ }
4032
+ },
4033
+ {
4034
+ "abstract": true,
4035
+ "docs": {
4036
+ "stability": "stable"
4037
+ },
4038
+ "immutable": true,
4039
+ "locationInModule": {
4040
+ "filename": "src/CdkDriftIamTemplate.ts",
4041
+ "line": 5
4042
+ },
4043
+ "name": "roleName",
4044
+ "type": {
4045
+ "primitive": "string"
4046
+ }
4047
+ },
4048
+ {
4049
+ "abstract": true,
4050
+ "docs": {
4051
+ "stability": "stable"
4052
+ },
4053
+ "immutable": true,
4054
+ "locationInModule": {
4055
+ "filename": "src/CdkDriftIamTemplate.ts",
4056
+ "line": 6
4057
+ },
4058
+ "name": "outputPath",
4059
+ "optional": true,
4060
+ "type": {
4061
+ "primitive": "string"
4062
+ }
4063
+ }
4064
+ ],
4065
+ "symbolId": "src/CdkDriftIamTemplate:CdkDriftIamTemplateProps"
3913
4066
  }
3914
4067
  },
3915
4068
  "version": "0.0.0",
3916
- "fingerprint": "tHH4O3w5aknRRboRsohbwELbBny5Nck+ehKsoWl+2Rw="
3917
- }
4069
+ "fingerprint": "adohpOK53C4dMRZxwaE9ciWaUP4MnX0Z+VFGeRuc+3o="
4070
+ }