-
Notifications
You must be signed in to change notification settings - Fork 41
feat(bootstrap): resource-action-map for synth-time validation #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
scottschreckengaust
wants to merge
11
commits into
main
Choose a base branch
from
feat/bootstrap-action-map
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
eeb4f5e
chore(bootstrap): scaffold preflight directory for resource-action-ma…
scottschreckengaust fe1778e
refactor(compute): gate ECS construct on compute_type context
scottschreckengaust 0d7733a
feat(bootstrap): add getRequiredBootstrapPolicies for compute-type-aw…
scottschreckengaust 9f9c480
feat(bootstrap): add resource-action-map for 57 CF resource types
scottschreckengaust 95b154a
test(bootstrap): add dual-config synth-coverage test (agentcore + ecs)
scottschreckengaust 71d06a5
fix(bootstrap): compute-agentcore is a variant choice, not a core policy
scottschreckengaust 7f9886a
fix(test): move ECS synth output to tmpdir to prevent parallel test race
scottschreckengaust a4ea01a
feat(bootstrap): close B1/B2 on the live map + wire compute-type-awar…
scottschreckengaust f782707
feat(bootstrap): grant the 4 actions the map could only exclude (#124)
scottschreckengaust 58ad265
refactor(bootstrap): one CRUD map on the live path, preflight becomes…
scottschreckengaust 75cfb09
fix(build): exclude .jest-cache from the image asset fingerprint (#124)
scottschreckengaust File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 1.2.0 | ||
| 1.3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /** | ||
| * MIT No Attribution | ||
| * | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| * the Software without restriction, including without limitation the rights to | ||
| * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
| * the Software, and to permit persons to whom the Software is furnished to do so. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| * SOFTWARE. | ||
| */ | ||
|
|
||
| export { | ||
| RESOURCE_ACTION_MAP, | ||
| getActionsForResource, | ||
| getAllMappedActions, | ||
| } from './resource-action-map'; | ||
| export type { ResourceActions, LifecyclePhase } from './resource-action-map'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /** | ||
| * MIT No Attribution | ||
| * | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| * the Software without restriction, including without limitation the rights to | ||
| * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
| * the Software, and to permit persons to whom the Software is furnished to do so. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| * SOFTWARE. | ||
| */ | ||
|
|
||
| /** | ||
| * Verification helpers over the bootstrap resource-action map. | ||
| * | ||
| * This module deliberately holds NO map data. It previously carried a second, | ||
| * parallel copy: this directory's version had CRUD depth but no production | ||
| * consumer, while ``../resource-action-map.ts`` was create-only and wired into | ||
| * the live synth-coverage gate. Two maps with disjoint test suites and no shared | ||
| * consumer drift by construction, and adding a resource type to only one of them | ||
| * is silent. The CRUD depth was merged INTO the live map (#124); what remains | ||
| * here are the query helpers the preflight/validation layer (#125/#126) reads it | ||
| * through. | ||
| */ | ||
|
|
||
| import { | ||
| RESOURCE_ACTION_MAP, | ||
| actionsForResource, | ||
| type ResourceActions, | ||
| } from '../resource-action-map'; | ||
|
|
||
| export { RESOURCE_ACTION_MAP } from '../resource-action-map'; | ||
| export type { ResourceActions, LifecyclePhase } from '../resource-action-map'; | ||
|
|
||
| /** | ||
| * Returns the ResourceActions entry for a given CloudFormation resource type, | ||
| * or undefined if the type is not mapped. | ||
| */ | ||
| export function getActionsForResource(cfnType: string): ResourceActions | undefined { | ||
| return RESOURCE_ACTION_MAP[cfnType]; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the set of all unique IAM actions referenced across all map entries, | ||
| * across every lifecycle phase. | ||
| */ | ||
| export function getAllMappedActions(): Set<string> { | ||
| const actions = new Set<string>(); | ||
| for (const cfnType of Object.keys(RESOURCE_ACTION_MAP)) { | ||
| for (const action of actionsForResource(cfnType)) { | ||
| actions.add(action); | ||
| } | ||
| } | ||
| return actions; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /** | ||
| * MIT No Attribution | ||
| * | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| * the Software without restriction, including without limitation the rights to | ||
| * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
| * the Software, and to permit persons to whom the Software is furnished to do so. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| * SOFTWARE. | ||
| */ | ||
|
|
||
| const CORE_POLICIES = [ | ||
| 'infrastructure', | ||
| 'application', | ||
| 'observability', | ||
| ] as const; | ||
|
|
||
| const COMPUTE_VARIANT_POLICIES: Record<string, string[]> = { | ||
| agentcore: ['compute-agentcore'], | ||
| ecs: ['compute-ecs'], | ||
| }; | ||
|
|
||
| export function getRequiredBootstrapPolicies(computeType: string): string[] { | ||
| const base: string[] = [...CORE_POLICIES]; | ||
| const variants = COMPUTE_VARIANT_POLICIES[computeType]; | ||
| if (variants) base.push(...variants); | ||
| return base; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.