This guide explains how to move an existing deployment to a new release, and how to change an existing deployment to scan more than one region.
Update only the deployment layers that the release changed. For a code-only fix, running CodeBuild again is normally enough: it pulls the configured source revision and updates the AWS SAM assessment stack. CodeBuild cannot update the top-level infrastructure stack or the multi-account member-role StackSet.
Do not delete the existing stacks. Update them in place so that report buckets, configuration, and stack identities are kept.
Each changed path maps to one deployment action:
| Changed path | Deployment action |
|---|---|
aiml-security-assessment/functions/** or Lambda requirements.txt |
Run CodeBuild to package and deploy the updated Lambda code |
aiml-security-assessment/statemachine/** |
Run CodeBuild to update the state machine through AWS SAM |
aiml-security-assessment/template.yaml or template-multi-account.yaml |
Run CodeBuild to update the corresponding AWS SAM assessment stack |
buildspec.yml |
Run CodeBuild so the build uses the updated orchestration |
consolidate_html_reports.py |
Run multi-account CodeBuild to apply the updated consolidator |
assessment_history/** |
Run CodeBuild; the changes-since-last-assessment report runs from this package in the post-build phase |
deployment/aiml-security-single-account.yaml |
Update the single-account infrastructure stack |
deployment/1-aiml-security-member-roles.yaml |
Update the multi-account member-role StackSet before running CodeBuild |
deployment/2-aiml-security-codebuild.yaml |
Update the multi-account central infrastructure stack |
Only docs/**, tests, examples, or .github/** |
No deployed-resource update is required |
Check the root CHANGELOG first. Its Unreleased or
target-version Deployment impact section states which actions are required.
If the changelog does not cover the exact revisions you are comparing, compare
the commit used by the last successful build with the target tag or commit:
git diff --name-only <deployed-commit>..<target-tag-or-commit> -- \
deployment/ \
aiml-security-assessment/ \
assessment_history/ \
buildspec.yml \
consolidate_html_reports.py
The CodeBuild build details show the resolved source commit. Use that commit,
not a moving branch name such as main, as <deployed-commit>.
Read the result as follows:
deployment/*.yaml file changed, update only the stack or
StackSet created from that file.How the source revision is picked up. CodeBuild clones the revision named
by the infrastructure stack’s GitHubBranch parameter on every build:
main picks up new code
when you start CodeBuild. No stack update is needed unless a top-level
template changed.GitHubBranch first. If the stack’s template did not change, this can be a
parameter-only update that uses the current template.Deployment impact section, or compare the two
revisions as described in Determine What Changed.GitHubBranch accepts a branch, tag,
or commit; an immutable release tag or commit is recommended for
reproducible deployments.Download only the templates that changed and apply to your deployment:
| Deployment mode | Template to download when changed |
|---|---|
| Single account | deployment/aiml-security-single-account.yaml |
| Multi-account | deployment/1-aiml-security-member-roles.yaml and deployment/2-aiml-security-codebuild.yaml |
| Direct AWS SAM | aiml-security-assessment/template.yaml or aiml-security-assessment/template-multi-account.yaml |
deployment/aiml-security-single-account.yaml changed.deployment/aiml-security-single-account.yaml, not
the generated aiml-sec-{account_id} assessment stack. Do not create a
second stack.GitHubRepoUrl or GitHubBranch as needed.GitHubRepoUrl and GitHubBranch point
to the repository and revision that match the uploaded template.CAPABILITY_NAMED_IAM when requested, apply it, and
wait for UPDATE_COMPLETE.aiml-sec-{account_id} AWS SAM
stack and that the assessment finishes. For documentation-only or test-only
changes, no build is required.Perform only the applicable steps, in this order. When the member-role template changed, update it before deploying assessment code.
deployment/1-aiml-security-member-roles.yaml changed.ManagementAccountID, deployment targets, regions,
and other settings, and apply the update to every currently targeted
account and region.deployment/2-aiml-security-codebuild.yaml changed. If it
changed, open the existing central infrastructure stack and replace its
template with the target release’s version.GitHubRepoUrl or GitHubBranch as needed.GitHubRepoUrl and GitHubBranch match the release
used for the member-role and central templates.CAPABILITY_NAMED_IAM when requested, apply it, and wait for
UPDATE_COMPLETE.MemberRoleName, default
AIMLSecurityMemberRole) in every target account, updates the existing
aiml-security-{account_id} AWS SAM stacks (and aiml-security-mgmt in the
central account, which every multi-account run assesses), and completes the
assessments.The order matters. The member role carries the permissions CodeBuild uses to
deploy the SAM stack, poll the Step Functions execution, and retrieve reports in
each account, so update it first when it changes. Assessment API permissions are
not on the member role; they are on the SAM-created Lambda execution roles, and
a missing one appears as N/A or an incomplete result rather than a build
failure.
If you deployed the assessment directly with AWS SAM rather than through the top-level CloudFormation templates:
aiml-security-assessment/template.yaml or
aiml-security-assessment/template-multi-account.yaml, whichever you use."enableResponsibleAIGRC": "true", not the
legacy "enableFinServ" key (see
Troubleshooting §6b).You are responsible for separately updating any cross-account roles or orchestration infrastructure you created yourself.
The CodeBuildStartBuild custom resource in both top-level infrastructure
templates starts CodeBuild only on a CloudFormation Create event. It does
nothing on Update events. Updating the infrastructure template or
GitHubBranch therefore does not start a build. Start CodeBuild yourself when
the target revision contains deployable assessment or orchestration changes.
UPDATE_COMPLETE.CREATE_COMPLETE or UPDATE_COMPLETE.AssessmentBucket and contains the checks expected for the deployed release.You can change an existing single-region deployment to scan several regions by updating the existing infrastructure stack. No teardown is required.
aiml-security-single-account
or aiml-security-multi-account).TargetRegions to a comma- or space-separated region list, for example
us-east-1,us-west-2,eu-west-1 or us-east-1 us-west-2 eu-west-1.UPDATE_COMPLETE.What happens:
TARGET_REGIONS environment variable on the
CodeBuild project.sam deploy updates the assessment stack and passes the
new TargetRegions value to the assessment Lambda functions and state
machine.Resolve Target Regions state resolves the list, and the
Scan Regions Map state scans those regions in parallel.TargetRegions empty keeps the single-region behavior, scanning only
the deployment region.For region validation errors or unexpected region coverage, see Troubleshooting §7.