Repository navigation
feat(ngrh): add an opt-in DevOps Agent connect to make deploy - #205
Merged
Merged
Conversation
make deploy DEVOPS_AGENT_CONNECT="orders" deploys the sample, then runs make devops-agent (the Agent Space and the invoker role's access to it) and make devops-agent-connect for the services named. Without the variable make deploy does none of this, so the e2e workflow, which runs plain make deploy, is unchanged. - A new devops-agent-connect-preflight target runs before anything is deployed. It checks that the names are services and that the AWS CLI is 2.38.0 or later, and it refuses DEVOPS_AGENT_SPACE_ARN set to nothing, which takes the invoker role's access away. A typo or an old CLI is found at once, not after a deploy of about two hours. - The check is a new action of the devops-agent tool, "check". It reads nothing from the deployment, because a first deploy has none. - After the deploy the step waits DEVOPS_AGENT_IAM_WAIT seconds (default 60) for the invoker role's new policy to take effect, because a connection that cannot use it yet is not sent again. - With DEVOPS_AGENT_SPACE_ARN=<arn> the Agent Space stack is skipped and the services connect to that Agent Space. - Connecting starts one paid investigation for each finding of each service, so the README tells the reader to name one service first.
mplaws
marked this pull request as ready for review
October 26, 2026 12:11
mplaws
enabled auto-merge (squash)
October 26, 2026 12:43
tomljmj
approved these changes
Oct 28, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
make deploy DEVOPS_AGENT_CONNECT="orders"deploys the sample, then creates the DevOps Agent Agent Space and connects the named services to it. Without the variable,make deploydoes what it did before. #201 added the Agent Space and the connect step as separate commands. This adds the one-command path for someone who wants it.deployment/Makefiledeploygets a first step,devops-agent-connect-preflight, and a last step. The last step runsmake devops-agent(left out whenDEVOPS_AGENT_SPACE_ARNis set), waitsDEVOPS_AGENT_IAM_WAITseconds (60 by default), then runsmake devops-agent-connectfor the services named. Both steps are empty unlessDEVOPS_AGENT_CONNECTis set.deployment/ngrh_testing/devops_agent.py,cli.py,__init__.pydevops-agent check. It checks that the names are services and that the AWS CLI is 2.38.0 or later. It reads nothing from the deployment, because a first deploy has none. The name parsing is split out ofselect_services, socheckandconnectaccept the same names.README.mdtests/checkaction, the README and the e2e workflow.No linked issue: follow-up to #201.
Why it is opt-in
Connecting a service starts one DevOps Agent investigation for every failure mode finding the service has, and DevOps Agent bills by the agent-second. Connecting
ordersin a test deployment started 21 investigations in four seconds.make deployruns no assessment, so the count is whatever the services already have, and the README says to name one service first.Nothing connects by default. The e2e workflow runs plain
make deployand does not set the variable. A test fails if it ever does.Behavior
DEVOPS_AGENT_SPACE_ARN=set to nothing. That last one takes the invoker role's access away, so it cannot go with connecting. A deploy takes about two hours, so these are found first.DEVOPS_AGENT_SPACE_ARN=<arn>, the Agent Space stack is not created and the services connect to that Agent Space.makeexits nonzero after the outputs are printed, and the README says to runmake devops-agent-connectagain.make -n deploy DEVOPS_AGENT_CONNECT=ordersshows the steps and runs none of them. The steps live in a make variable because make runs a recipe line that names$(MAKE)even under-n.Testing
pytest tests/(Python 3.12): 1,892 passed, on this commit rebased ontomainat12389d0.make -n deployplan is byte-identical to the one frommain.dash, the shell CI uses formake, in a container.deployment/changes, so cfn-lint, checkov and cfn-nag see the same templates as onmain.Not tested yet
make deploy DEVOPS_AGENT_CONNECT=...has not run against AWS end to end. The steps are covered by a stubmake, a stubawsand a fake AWS. The e2e does not set the variable, so this PR's e2e run does not cover it either.DEVOPS_AGENT_IAM_WAITis a guess, based on the note indevops_agent.pythat the role "can take a minute" to get its permissions.devops-agent-connectanddevops-agent-disconnectagainst a real service, which was already open in feat(ngrh): add a DevOps Agent Agent Space and invoker access #201.Before merging
deployment/**, so the e2e runs on the PR (about 4 hours in the CI account) and again after the merge tomain. It should behave as in feat(ngrh): add a DevOps Agent Agent Space and invoker access #201, because it does not set the variable.826171f(run 39964577076). It ran plainmake deploywithDEVOPS_AGENT_CONNECTunset, and nothing from the run was left in the CI account.