Skip to content

[Test] Add infrastructure unit tests#475

Merged
gmarciani merged 2 commits into
aws:mainfrom
gmarciani:wip/mgiacomo/2026/infra-unit-tests-0501-1
May 1, 2026
Merged

[Test] Add infrastructure unit tests#475
gmarciani merged 2 commits into
aws:mainfrom
gmarciani:wip/mgiacomo/2026/infra-unit-tests-0501-1

Conversation

@gmarciani
Copy link
Copy Markdown
Collaborator

@gmarciani gmarciani commented May 1, 2026

Changes

Add unit testing for CloudFormation templates based on cloud-radar https://github.com/DontShaveTheYak/cloud-radar.

In particular, we introduced two unit tests:
* permissions boundary: when a permission boundary is specified by the user, that boundary is injected in every role deployed by the infrastructure.
* APIG policy: when private deployment is used, the APIG can only be invoked from within the VPCE; otherwise it can be invoked from everywhere.

Also, added those unit tests to the GitHub Workflow used to validate PRs.

NOTE FOR REVIEWER
The code in conftest is mostly a porting of an unreleased change in cloud-radar to allow the use of ForEach expression in CFN template DontShaveTheYak/cloud-radar#646. That logic is going to be removed as soon as cloud-radar releases this feature. The only logic that will remain is the fixture template

How Has This Been Tested?

  1. Executed unit tests locally
  2. PR checks

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@gmarciani gmarciani added the Test label May 1, 2026
gmarciani added 2 commits May 1, 2026 11:08
…adar.

In particular, we introduced two unit tests:
 * permissions boundary: when a permission boundary is specified by the user, that boundary is injected in every role deployed by the infrastructure.
 * APIG policy: when private deployment is used, the APIG can only be invoked from within the VPCE; otherwise it can be invoked from everywhere.
@gmarciani gmarciani force-pushed the wip/mgiacomo/2026/infra-unit-tests-0501-1 branch from f6dadcc to faa8e5a Compare May 1, 2026 15:08
@gmarciani gmarciani merged commit f09a3fa into aws:main May 1, 2026
3 checks passed
@gmarciani gmarciani deleted the wip/mgiacomo/2026/infra-unit-tests-0501-1 branch May 1, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants