# Version Control

Version control is the practice of tracking and identifying changes to artifacts so teams can compare revisions, reproduce releases, and restore earlier states.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/version-control

> Version control creates a traceable history for artifacts such as source code, infrastructure definitions, configuration, and AI prompts. It helps engineers collaborate safely, connect deployed behavior to specific revisions, and recover from changes that introduce errors or regressions.

Practice exams covering Version Control: [AIF-C01 AWS Certified AI Practitioner](https://blowstack.com/practice-exams/aws-certified-ai-practitioner), [SOA-C03 AWS Certified CloudOps Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate), [DEA-C01 AWS Certified Data Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-data-engineer-associate), [DVA-C02 AWS Certified Developer - Associate](https://blowstack.com/practice-exams/aws-certified-developer-associate), [DOP-C02 AWS Certified DevOps Engineer - Professional](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional), [AIP-C01 AWS Certified Generative AI Developer - Professional](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional), [MLA-C02 (beta) AWS Certified Machine Learning Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate).

## 6 key aspects of Version Control

Effective version control combines traceable revisions, stable releases, evaluation, dependency tracking, and governed rollback.

1. **Identifiable revision history**: Assign each preserved revision a stable identifier and record its purpose. This lets engineers connect observed behavior to the exact artifact used by a deployment.
2. **Separation of drafts and releases**: Allow experimentation without changing the artifact used in production. In Bedrock Prompt Management, edit the working draft and create a numbered version to preserve a release candidate.
3. **Evaluation before promotion**: Compare prompt revisions using representative inputs and explicit quality, safety, latency, and cost criteria. Preserve evaluation results alongside the version identifier so approval decisions remain traceable.
4. **Controlled deployment and rollback**: Pin applications to approved versions and retain the configuration needed to select an earlier release. Rollback changes which artifact is used; it does not reverse external side effects.
5. **Dependency traceability**: Track the model, inference settings, retrieval configuration, and application release associated with a prompt. Prompt history alone is insufficient to explain every change in generated output.
6. **Governed retention and access**: Restrict editing and release permissions, and define how long obsolete revisions are retained. Avoid embedding secrets or sensitive customer examples because historical versions may remain accessible.

## Cloud services for Version Control

Amazon Bedrock Prompt Management preserves approved prompt definitions, while S3 Versioning can retain supporting datasets, exports, and evaluation artifacts. CodePipeline can coordinate tests, approval gates, and deployment configuration changes that select a specific prompt version. Lambda provides independently versioned application code that invokes the prompt. Together, these services support a traceable release process when engineers explicitly record the relationships among their identifiers. Their version histories remain separate: publishing a Lambda version does not snapshot a Bedrock prompt or an S3 object. A release record should identify each dependency and the earlier combination to restore if validation or production monitoring detects a regression.

- **[Amazon Bedrock](https://blowstack.com/tools/cloud-services-hub/amazon-bedrock)**: Amazon Bedrock Prompt Management supports reusable prompt templates, variables, prompt variants, and immutable numbered versions created from a working draft. Applications can reference an approved prompt version to separate production behavior from ongoing prompt edits.
- **[Amazon S3](https://blowstack.com/tools/cloud-services-hub/amazon-s3)**: S3 Versioning retains multiple versions of objects, which can help preserve prompt exports, evaluation datasets, and release artifacts. Object versioning does not provide Git-style branching, merging, or code review.
- **[AWS CodePipeline](https://blowstack.com/tools/cloud-services-hub/aws-codepipeline)**: CodePipeline can orchestrate validation, approval, and deployment stages for versioned application and prompt artifacts. It coordinates the release workflow rather than serving as the version-control repository itself.
- **[AWS Lambda](https://blowstack.com/tools/cloud-services-hub/aws-lambda)**: Lambda supports immutable published function versions and aliases that reference versions. A release process can associate a function version with a specific approved prompt version, although Lambda versioning does not automatically version external prompt resources.

## Version Control exam questions

Real practice exam questions on Version Control, with the correct answer and its explanation.

### Question 1 (AIF-C01)

**Question:**

A company uses Amazon Bedrock Prompt Management for an assistant that answers questions about public product manuals. A saved prompt template contains variables for the customer's question and reference text retrieved from the manuals. The manuals change over time. Reviewers must be able to reconstruct the saved prompt configuration and the exact question and reference text supplied for any past request. The company does not need to reproduce the model's exact output. Which approach best meets these requirements?

**Correct answer:** Use a numbered prompt version and record its version ARN together with the question and retrieved reference text supplied for each request.

**Explanation:** A numbered version preserves the saved prompt configuration, but it does not preserve values supplied at invocation time. Recording the version ARN and the actual variable values allows reviewers to reconstruct both parts of a historical request.

### Question 2 (MLA-C02 (beta))

**Question:**

A company fine-tunes a foundation model in Amazon Bedrock in a development AWS Region. An AWS CodePipeline release pipeline evaluates each custom model and records its ARN in an immutable release manifest. Production must run in a different Region in the same AWS account and must use the exact evaluated model without retraining. The selected model supports cross-Region custom model copying, and inference requires Provisioned Throughput in both Regions. The production application uses a regional Bedrock Runtime client.

Which deployment procedure should the ML engineer automate?

**Correct answer:** Call CreateModelCopyJob in the production Region with the release manifest's custom model ARN and source Region. Wait for the copy to complete, create Provisioned Throughput for the resulting target model ARN, and wait until it is InService. Record the destination identifiers in the release record and configure production to invoke the destination provisioned model ARN.

**Explanation:** Cross-Region custom model copying transfers the evaluated model without retraining. Using the manifest's exact source ARN preserves release identity. Waiting for copying and provisioning to finish ensures readiness, and invoking the destination provisioned model ARN serves the copied model in the required Region.

### Question 3 (AIP-C01)

**Question:**

A company stores approved prompt packages at immutable keys in an Amazon S3 general purpose bucket. Production applications read a shared release-manifest.json object that maps each prompt name to its approved package key. Independent approval pipelines can promote different prompts concurrently by updating entries in this manifest.

Each pipeline currently reads the manifest, changes its entry, and uploads the complete manifest. During concurrent promotions, one pipeline sometimes removes another pipeline's newly approved mapping by uploading an older copy. Every published manifest must preserve unrelated approved mappings, and the manifest must remain continuously readable. The company wants to coordinate updates through S3 without introducing a separate locking service.

Which implementation BEST meets these requirements?

**Correct answer:** Read the manifest and its ETag, merge the approved mapping, and call PutObject with If-Match set to that ETag. If a concurrent update causes a precondition failure, reread the manifest, merge the change into the current content, and retry conditionally.

**Explanation:** An If-Match conditional write implements optimistic concurrency control. S3 accepts the replacement only when the current object's ETag matches the value the pipeline read. A losing pipeline must merge its change into the newly current manifest before retrying, preserving unrelated promotions without making the manifest unavailable.

### Question 4 (SOA-C03)

**Question:**

A company stores Terraform configurations in a Git repository. A CloudOps engineer discovers that the repository also tracks the .terraform directory and a local terraform.tfstate file. The team has migrated to a remote state backend, but engineers must retain their existing local files for troubleshooting.

The company requires future commits to exclude the .terraform directory and local state files. Terraform configuration files and .terraform.lock.hcl must remain tracked. Existing repository history must not be rewritten, and previously committed copies may remain in that history.

Which approach meets these requirements?

**Correct answer:** Add .terraform/, *.tfstate, and *.tfstate.* to .gitignore. Use git rm with --cached to remove the tracked directory and state file from the index, and commit these changes while leaving .terraform.lock.hcl tracked.

**Explanation:** Removing files from the index with --cached stops tracking them without deleting the working copies. The ignore patterns prevent their accidental reintroduction through normal Git add operations. The dependency lock file remains tracked, and existing commits are preserved.

### Question 5 (DOP-C02)

**Question:**

A company uses an existing AWS CodeCommit repository. Pull requests targeting main require an approval from an automated validation role before they can be merged. Developers cannot override the approval rule or push directly to main.

For each pull request revision, a validation workflow captures the GetPullRequest response, including revisionId and sourceCommit, and tests the corresponding proposed change in an isolated environment. After successful testing, the workflow uses the validation role to approve the pull request. Developers can update the source branch while earlier validation runs are still executing.

The company must ensure that a successful validation run can approve only the pull request revision it tested. An older run must never approve a newer, untested revision, even briefly. The solution must remain safe if repository updates occur between API calls.

Which implementation meets these requirements?

**Correct answer:** After testing succeeds, call UpdatePullRequestApprovalState with approvalState set to APPROVE and revisionId set to the revisionId captured for that validation run. If the revision is no longer current, do not approve it; require successful validation of the newer revision.

**Explanation:** UpdatePullRequestApprovalState requires the pull request revision ID. Supplying the captured revisionId ties the approval request to the tested revision. CodeCommit rejects the request if that revision is no longer current, preventing an older validation run from approving a newer revision without a separate check-and-update race.

### Question 6 (DEA-C01)

**Question:**

A data engineering team stores its AWS Glue scripts and deployment configuration in an existing AWS CodeCommit repository. Production deployments use the main branch. The team must require approval from two designated reviewers before engineers can merge changes into main. Engineers must not be able to bypass this requirement by pushing directly to main or overriding approval requirements. Only repository administrators can create, modify, or delete approval rules. Which solution meets these requirements?

**Correct answer:** Associate an approval rule template requiring two approvals from the designated reviewer pool for pull requests targeting main. Use IAM policies to deny engineers direct updates to main and approval-rule overrides while allowing pull-request merge operations subject to the approval rules.

**Explanation:** The approval rule template establishes the required reviewer count and eligible reviewers. IAM restrictions close alternative update paths, including direct pushes and direct branch merges, and prevent engineers from overriding approval requirements. Authorized pull-request merges remain available after the required approvals are satisfied.

### Question 7 (DVA-C02)

**Question:**

A team uses an existing AWS CodeCommit repository with an AWS CodePipeline pipeline that automatically builds, tests, and deploys changes pushed to main. The main branch contains four ordinary commits in order: A, B, C, and D. Commit B introduced a regression. Commits C and D contain approved, independent changes that must remain in production. Reversing B will not cause merge conflicts.

The developer must remove B's changes through the existing pipeline while preserving C and D and retaining all published commits in the branch history. Which action should the developer take?

**Correct answer:** From main at commit D, run git revert with commit B's ID, and push the resulting commit to main.

**Explanation:** Git revert creates a new commit that reverses B's changes without removing the original commits from history. Because C and D are independent and the revert has no conflicts, their changes remain. Pushing the new commit to main invokes the existing pipeline.

## Practice Version Control in a full exam

Questions on Version Control in each practice exam, with every answer option and an explanation for each:

- [MLA-C02 (beta)](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate): 14 questions
- [AIF-C01](https://blowstack.com/practice-exams/aws-certified-ai-practitioner): 13 questions
- [AIP-C01](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional): 13 questions
- [SOA-C03](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate): 8 questions
- [DOP-C02](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional): 6 questions
- [DVA-C02](https://blowstack.com/practice-exams/aws-certified-developer-associate): 5 questions
- [DEA-C01](https://blowstack.com/practice-exams/aws-certified-data-engineer-associate): 1 question

## What is Version Control

Version control makes changes explicit and recoverable. Rather than repeatedly overwriting an artifact, a team preserves identifiable revisions and records why changes were made. An artifact might be application code, an infrastructure template, a configuration file, or a foundation model prompt. A useful revision history connects each change to its author, purpose, review, and validation results.

In cloud applications, version control separates ongoing development from released behavior. Engineers can edit a working copy while production continues to use an approved revision. Git-based systems support commits, branches, and merges, while individual cloud services may provide numbered snapshots or object versions. These mechanisms implement related ideas but do not necessarily offer the same collaboration features.

Prompt versioning applies this discipline to instructions that influence foundation model behavior. A small change to wording, examples, or an output schema can affect accuracy, safety, latency, and token consumption. Treat prompts as application artifacts rather than disposable strings. Record the prompt template, variable definitions, model selection, supported inference settings, and evaluation evidence associated with a release.

Amazon Bedrock Prompt Management provides a managed way to create reusable prompt templates with variables, configure supported model settings, and test prompt variants. Engineers modify a working draft and create a numbered version when they want to preserve a snapshot. A created version cannot be edited; subsequent changes belong in the draft and require another version. A prompt variant is an alternative configuration within a prompt, not a replacement for version history.

For example, a support assistant might use a prompt with a variable for the customer's question. An engineer revises the instructions to require a structured response and tests the change against representative questions. The team compares correctness, formatting compliance, harmful responses, latency, and cost before approving a new version. The application references the approved version through its version-specific prompt identifier rather than depending on an editable draft.

Deployment and rollback remain separate operational responsibilities. Preserve the mapping between an application release and its prompt version, model identifier, retrieval configuration, and other dependencies. If the new prompt causes regressions, update the application configuration to reference the previous approved version. Restoring a prompt does not undo external actions already taken by the application or restore a knowledge base that changed independently.

Versioning also does not guarantee identical model responses. Generation can remain nondeterministic, and changes to inputs, model availability, retrieved documents, or external tools can affect results. Reproducibility therefore requires recording the surrounding execution context, not just the prompt text. Likewise, version control is not a substitute for backups, access controls, approval workflows, or evaluation.

The main trade-offs are additional storage, review effort, and lifecycle management. Retaining every experiment indefinitely can create clutter and preserve sensitive material unnecessarily. Keep secrets and customer data out of reusable templates and repository history, restrict who can change or release prompts, and establish retention rules. For exam scenarios, distinguish managed prompt drafts, variants, and immutable versions from model training or fine-tuning: prompt versioning manages the instructions and configuration used with a model, not changes to its learned weights.

## Learn Version Control in lessons

9 short lessons on Version Control in 6 certification courses.

- AIF-C01: Version Control: immutable prompt revisions (Premium), https://app.blowstack.com/lessons/version-control-immutable-prompt-revisions-aif-c01
- MLA-C02 (beta): Experiment Tracking vs. Version Control (Premium), https://app.blowstack.com/lessons/experiment-tracking-vs-version-control-mla-c02
- AIP-C01: Version Control: tracing prompt regressions (Premium), https://app.blowstack.com/lessons/version-control-tracing-prompt-regressions-aip-c01
- SOA-C03: Version Control: Git workflows for infrastructure changes (Premium), https://app.blowstack.com/lessons/version-control-git-workflows-for-infrastructure-changes-soa-c03
- DOP-C02: Version Control: protected merge workflows (Premium), https://app.blowstack.com/lessons/version-control-protected-merge-workflows-dop-c02
- DEA-C01: Version Control: Git change history for data pipelines (Premium), https://app.blowstack.com/lessons/version-control-git-change-history-for-data-pipelines-dea-c01
