DevOps, IaC and secrets side by side: Azure DevOps, Bicep and Key Vault vs AWS
Translate Azure DevOps pipelines, service connections, ARM and Bicep deployments and Key Vault into GitHub Actions or CodePipeline, OIDC-assumed roles, CloudFormation or CDK change sets, and Secrets Manager with KMS, and decide what to migrate first and what to leave in place.
Assumes: .NET 10 LTS · AWS SDK for .NET v4 (AWSSDK.SecretsManager) · AWS CDK v2 (C#) · AWS CLI v2 · GitHub Actions with OIDC · Region us-east-1. Verified against official sources on 2026-11-18.
Learning objectives
By the end of this lesson you can:
- Map Azure DevOps concepts (pipelines, stages, service connections, variable groups, environments, artifact feeds) to GitHub Actions or the AWS Code services.
- Replace a long-lived service connection secret with an OIDC-assumed IAM role.
- Translate a Bicep template into AWS CDK (C#), and use change sets where you used
what-if. - Map Key Vault secrets, keys and certificates to Secrets Manager, KMS and ACM, including access control, soft delete and rotation.
- Decide the order in which to migrate pipelines, IaC and secrets, and what may safely stay on Azure for a while.
Prerequisites
- Integration side by side
- CI/CD concepts on AWS and GitHub Actions with OIDC
- CloudFormation vs CDK vs Terraform
- Secrets Manager and Parameter Store
- Tools: .NET 10 SDK, AWS CLI v2 with
learn-sandbox
Why this matters in banking
Pipelines and secrets are the keys to production. A bank's change process says who may deploy, with what evidence. Harbourline's Azure DevOps pipelines deploy through a service connection with a client secret that expires every two years and is stored by three people. Key Vault holds database passwords that the pipelines read. A migration plan that says "recreate pipelines in GitHub Actions and copy the secrets" quietly changes who can deploy, where the secrets live, and what the audit trail looks like, all at once.
The safe approach is to change one dimension at a time, keep evidence continuous, and remove standing secrets instead of copying them. This lesson gives the map and the order.
The idea in plain language
Three jobs, each with an Azure tool and an AWS tool:
- Pipeline: build, test and deliver the code. Azure DevOps Pipelines; on AWS, GitHub Actions (the default in this course) or CodePipeline with CodeBuild and CodeDeploy.
- Infrastructure as code (IaC): describe the cloud resources in files. ARM and Bicep; on AWS, CloudFormation, AWS CDK (write in C#) or Terraform.
- Secrets: keep passwords, keys and certificates out of code. Key Vault; on AWS, Secrets Manager (secrets), KMS (encryption keys) and ACM (certificates).
Analogy: the pipeline is the delivery van, IaC is the building plan, and secrets are the keys held by the security desk. You can move to a new city's van company (pipeline) without touching the plan or the key safe, and you should: changing all three at once is how keys get lost.
What problem the AWS services solve
| AWS service | Problem | Limits and sharp edges |
|---|---|---|
| GitHub Actions + OIDC | Pipelines with no stored cloud keys; each run gets short-lived credentials from a role | Trust policy conditions (repository, branch, environment) must be tight; see OIDC lesson |
| CodePipeline, CodeBuild, CodeDeploy | AWS-native pipeline, build and deploy with IAM-based access | Another system to learn; pipelines are defined as AWS resources |
| CloudFormation | Declarative stacks with change sets, drift detection and rollback | JSON/YAML only; stack limits apply ⚠ VERIFY the current resource-per-stack limit |
| AWS CDK (C#) | Write infrastructure in C# that synthesises to CloudFormation | Needs cdk bootstrap per account and Region; generated templates are CloudFormation |
| Secrets Manager | Stored, encrypted, rotatable secrets with IAM and audit | Billed per secret per month plus API calls; one secret is capped at 64 KB ⚠ VERIFY |
| KMS | Encryption keys with key policies and audit | A customer managed key costs about USD 1 a month plus requests ⚠ VERIFY |
| ACM | Free public TLS certificates for integrated services (ALB, CloudFront, API Gateway) | Cannot export public certificates; private CAs are a paid separate service |
Microsoft / Azure comparison
Pipelines
| You know (Azure DevOps) | AWS or GitHub equivalent | What's different |
|---|---|---|
| Pipeline YAML, stages, jobs, steps | GitHub Actions workflow, jobs, steps; or CodePipeline stages and actions | Actions YAML is similar; steps are actions or shell commands |
| Task (marketplace) | Action (uses:) | Pin third-party actions to full commit SHAs |
| Service connection (service principal secret or workload identity) | IAM role assumed with OIDC (aws-actions/configure-aws-credentials) | No secret to rotate; the trust policy names the repository and branch |
| Variable groups and secret variables | Repository or environment variables; secrets pulled from Secrets Manager at runtime | Keep cloud secrets in AWS, not in the CI vendor |
| Environments with approvals and checks | GitHub Environments with required reviewers; the role trust can require the environment name | Approval evidence lives in GitHub; export it for audit |
| Agent pools (Microsoft-hosted, self-hosted) | GitHub-hosted runners, self-hosted runners, or CodeBuild compute | Self-hosted runners in a VPC can reach private resources |
| Artifacts and Azure Artifacts feeds | ECR (images), CodeArtifact (NuGet, npm and other packages), S3 for build outputs | CodeArtifact needs a short-lived token; see the CLI section |
| Azure Repos | GitHub (this course's default). CodeCommit is generally available again since 2025-11-24 | A repository host is a business decision; do not migrate repos and pipelines in one step |
| Azure Boards | Not an AWS service | Keep your work tracker; link commits to tickets |
| Release gates, deployment rings | CodeDeploy deployment groups and traffic shifting, ECS strategies | See ECS deployment strategies |
Infrastructure as code
| You know (ARM / Bicep) | AWS equivalent | What's different |
|---|---|---|
| ARM template, Bicep file | CloudFormation template; CDK app (C#); Terraform configuration | No automatic converter from Bicep to CloudFormation; you re-author |
| Resource group deployment | Stack | A stack is the unit of create, update and delete |
az deployment group what-if | Change set (aws cloudformation deploy --no-execute-changeset) or cdk diff | Change sets show replace versus update; read them before executing |
| Incremental mode (default) / complete mode | Stack manages exactly the resources in its template | Resources removed from the template are deleted from the stack |
| Modules, template specs | CDK constructs, CloudFormation modules, Service Catalog products | In CDK, a construct is a class; reuse is normal C# packaging |
| Parameters, parameter files | CDK context and props, CloudFormation parameters, SSM parameters | Prefer typed props in CDK |
| Deployment history | CloudFormation stack events and change set history | Enable termination protection on production stacks |
| Azure Policy for IaC guardrails | cdk-nag, CloudFormation Guard, SCPs | See policy as code |
| Drift (manual changes) | Drift detection | Run it on a schedule; it reports, it does not fix |
Secrets and keys
| You know (Key Vault) | AWS equivalent | What's different |
|---|---|---|
| Secrets | Secrets Manager secrets (JSON, string or binary) | Versions use staging labels (AWSCURRENT, AWSPREVIOUS) |
| Keys (RSA, EC, AES; HSM-backed) | KMS keys (symmetric, asymmetric, HMAC) and CloudHSM for dedicated HSMs | KMS keys never leave the service; you call encrypt and decrypt |
| Certificates | ACM (public TLS) or ACM Private CA | Certificates are attached to services; you rarely handle the private key |
| Access policies or Azure RBAC on the vault | IAM policy on the caller plus resource policy on the secret and key policy on the KMS key | KMS key policies are the root of key access; IAM alone is not enough ⚠ read the key policy rules |
| Soft delete, purge protection | Secrets Manager recovery window (7 to 30 days; default 30) | Force-delete skips it; do not allow force-delete in production |
| Rotation (Event Grid trigger plus a function) | Secrets Manager rotation with a Lambda; managed rotation for supported database engines | Rotation needs network access from the Lambda to the database |
| Key Vault reference in app settings | ECS task definition secrets, Beanstalk environment secrets, Lambda extension | Injected at start; rotation needs a refresh strategy |
| App Configuration | Parameter Store or AWS AppConfig | Parameter Store is free for standard parameters and fine for non-secret settings |
DefaultAzureCredential + SecretClient | AWS SDK default credential chain + AmazonSecretsManagerClient | Identical shape; the role is the identity |
Architecture
Security-boundary view. There are three identities: the pipeline role (can deploy, cannot read production secrets), the application's task role (can read its own secrets, cannot deploy) and human operators (Identity Center, read-only by default). The KMS key policy lets only the application role decrypt. Compare that with an Azure DevOps service connection that often holds Contributor on a whole subscription.
Migration order that works
- Identity and landing zone first (accounts, roles, SCPs).
- IaC next: re-author the base network and shared services in CDK or Terraform, because everything else needs them.
- Secrets: create them in AWS fresh (new values, rotated) rather than exporting from Key Vault. A migration is the best time to rotate.
- Pipelines last, one application at a time. Azure DevOps can deploy to AWS during the transition, which means no big-bang CI/CD change. ⚠ VERIFY whether you use the AWS Toolkit for Azure DevOps or plain CLI steps with a federated identity.
Step-by-step implementation
Inventory pipelines, secrets and service connections
For each pipeline: triggers, stages, approvals, service connections and the scopes each holds. For each Key Vault: secrets, keys, certificates, access policies, who reads them, rotation. Highlight any secret older than a year.
Create the OIDC provider and deploy role
Create the GitHub OIDC identity provider in the AWS account and a deploy role whose trust policy pins repository, branch or environment. The full walkthrough, including the hostile-token tests, is in Lab 9.2.
Port one pipeline
Translate stages to jobs. Replace the service connection step with configure-aws-credentials. Keep approvals as GitHub Environments. The workflow in Complete code is the template.
Re-author the IaC
Start with a stateless piece (a bucket, a queue). Use cdk diff as your what-if. For existing resources you do not want to recreate, plan a controlled import rather than a rewrite.
Move secrets with rotation
Create each secret in Secrets Manager with a customer managed KMS key, grant read access to the application role only, change the application to read it, then rotate the value and retire the Key Vault copy.
Run both in parallel and compare
Deploy the same commit through the old and new pipelines to non-production, compare outputs and logs, then switch production one application at a time.
AWS Console instructions
- Secrets Manager: Console → Secrets Manager → Store a new secret, choose the secret type, pick a customer managed KMS key (create one in Console → KMS → Customer managed keys), name it
hl/m13/ledger/db, optionally configure rotation. - CloudFormation change set: Console → CloudFormation → Stacks → (stack) → Change sets → Create change set; read each row for
ModifyversusReplacement. - OIDC provider: Console → IAM → Identity providers → Add provider → OpenID Connect, provider URL
https://token.actions.githubusercontent.com, audiencests.amazonaws.com.
AWS CLI
# Preview a CloudFormation deployment without executing it: the Bicep "what-if" equivalent.
aws cloudformation deploy --template-file template.yaml --stack-name hl-m13-secrets \
--no-execute-changeset --capabilities CAPABILITY_NAMED_IAM \
--profile learn-sandbox --region us-east-1
# Create a secret encrypted with your own KMS key. (Value shown is a placeholder: never type real credentials into a shell history.)
aws secretsmanager create-secret --name hl/m13/ledger/db \
--secret-string '{"username":"app_user","password":"CHANGE_ME_PLACEHOLDER"}' \
--kms-key-id alias/hl-m13-secrets \
--tags Key=Project,Value=cea-lab Key=Lab,Value=m13-devops Key=Environment,Value=learn \
--profile learn-sandbox --region us-east-1
# Look at metadata only (does not print the secret value).
aws secretsmanager describe-secret --secret-id hl/m13/ledger/db --profile learn-sandbox --region us-east-1
# CodeArtifact: a short-lived NuGet/npm token replaces a long-lived Azure Artifacts PAT (if you adopt CodeArtifact).
aws codeartifact get-authorization-token --domain hl-domain --query authorizationToken --output text \
--profile learn-sandbox --region us-east-1 >/dev/null && echo "token obtained"Infrastructure as Code
The Bicep you may have today, and its CDK (C#) and Terraform equivalents. The Bicep is shown for comparison only.
param location string = resourceGroup().location
resource kv 'Microsoft.KeyVault/vaults@2023-07-01' = {
name: 'hl-ledger-kv'
location: location
properties: {
sku: { family: 'A', name: 'standard' }
tenantId: subscription().tenantId
enableRbacAuthorization: true
enableSoftDelete: true
enablePurgeProtection: true
}
}using Amazon.CDK;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.KMS;
using Amazon.CDK.AWS.SecretsManager;
using Constructs;
public sealed class SecretsStack : Stack
{
public SecretsStack(Construct scope, string id, IStackProps props) : base(scope, id, props)
{
// The vault becomes two things: a key (who may decrypt) and a secret (the value).
var key = new Key(this, "SecretsKey", new KeyProps
{
Alias = "alias/hl-m13-secrets",
EnableKeyRotation = true,
RemovalPolicy = RemovalPolicy.DESTROY, // learning lab only; production RETAIN
});
var secret = new Secret(this, "LedgerDb", new SecretProps
{
SecretName = "hl/m13/ledger/db",
EncryptionKey = key,
// Generates a random password so no human ever sees it.
GenerateSecretString = new SecretStringGenerator
{
SecretStringTemplate = "{\"username\":\"app_user\"}",
GenerateStringKey = "password",
ExcludePunctuation = true,
PasswordLength = 32,
},
});
// The application role may read this one secret (CDK also adds the KMS permission it needs).
var appRole = new Role(this, "AppRole", new RoleProps
{
AssumedBy = new ServicePrincipal("ecs-tasks.amazonaws.com"),
});
secret.GrantRead(appRole);
Amazon.CDK.Tags.Of(this).Add("Project", "cea-lab");
Amazon.CDK.Tags.Of(this).Add("Lab", "m13-devops");
Amazon.CDK.Tags.Of(this).Add("Environment", "learn");
}
}Complete code
The Azure DevOps pipeline being replaced (comparison only):
trigger: [main]
stages:
- stage: Build
jobs:
- job: build
pool: { vmImage: ubuntu-latest }
steps:
- task: UseDotNet@2
inputs: { version: 10.0.x }
- script: dotnet test --solution Ledger.slnx
- stage: Deploy
dependsOn: Build
jobs:
- deployment: deploy
environment: ledger-test # approvals configured on the environment
strategy:
runOnce:
deploy:
steps:
- task: AzureCLI@2 # service connection with a stored secret
inputs:
azureSubscription: ledger-conn
scriptType: bash
scriptLocation: inlineScript
inlineScript: az deployment group create -g ledger-rg -f main.bicepThe GitHub Actions replacement, with OIDC and a diff before deploy:
name: deploy-test
on:
push:
branches: [main]
permissions:
id-token: write # lets the job request an OIDC token
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7 # pin to a full commit SHA in real use
- uses: actions/setup-dotnet@v5 # pin to a full commit SHA in real use
with:
dotnet-version: 10.0.x
- run: dotnet test --solution Ledger.slnx
deploy-test:
needs: build
runs-on: ubuntu-latest
environment: ledger-test # required reviewers are configured here
steps:
- uses: actions/checkout@v7
- uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
with:
role-to-assume: arn:aws:iam::111122223333:role/hl-m13-deploy-test
aws-region: us-east-1
- run: npx cdk diff
- run: npx cdk deploy --require-approval neverThe account ID is a placeholder. The actions/* tags are shown for readability; check the current versions and pin full commit SHAs ⚠ VERIFY.
Reading the secret in the application, mirroring DefaultAzureCredential plus SecretClient:
using System.Text.Json;
using Amazon.SecretsManager;
using Amazon.SecretsManager.Model;
public sealed record DbCredentials(string Username, string Password);
public sealed class DbSecretReader(IAmazonSecretsManager sm)
{
// Azure (before): new SecretClient(vaultUri, new DefaultAzureCredential()).GetSecretAsync("ledger-db")
// AWS (after): the SDK finds the task role from the environment; the role is the identity.
public async Task<DbCredentials> ReadAsync(string secretId, CancellationToken ct)
{
var response = await sm.GetSecretValueAsync(new GetSecretValueRequest { SecretId = secretId }, ct);
using var doc = JsonDocument.Parse(response.SecretString);
return new DbCredentials(
doc.RootElement.GetProperty("username").GetString()!,
doc.RootElement.GetProperty("password").GetString()!);
}
}For production reads, use the caching client or an in-process cache with a short time to live, as shown in the Secrets Manager lesson.
Code explained line by line
permissions: id-token: writeallows the job to request a GitHub OIDC token. Without it the credentials step fails.contents: readlimits the default token.- The
buildjob runs tests with no cloud access at all. Separating it from the deploy job means a compromised test dependency never sees a cloud role. environment: ledger-testis where approvals and environment-scoped rules apply. The AWS trust policy can require this environment name in the token'ssubclaim.configure-aws-credentialsexchanges the OIDC token for temporary credentials by assuming the role. There is no stored key. The commit SHA pin protects against a tampered tag.cdk diffis thewhat-ifstep: reviewers see replacements beforecdk deploy.- In
DbSecretReader,GetSecretValueAsyncretrieves the current version. The constructor takesIAmazonSecretsManagerso tests can pass a fake. - The CDK
GenerateSecretStringmakes Secrets Manager create the password, so it never appears in code, logs or state files.
Security considerations
⚠ Learning shortcut — not for production
The lab secret uses a 7-day recovery window or immediate deletion, the KMS key has RemovalPolicy.DESTROY, and the workflow deploys with --require-approval never. Production uses RETAIN on keys and secrets, a recovery window of 30 days with force-delete denied by SCP, required reviewers on production environments, a separate deploy role per environment with a trust policy pinned to the exact repository, branch and environment, and a reviewed cdk diff or change set as the change-board artefact.
- Do not export Key Vault secrets in bulk. Create new values in AWS and rotate. A copied secret keeps its old exposure history.
- No secrets in pipeline variables for AWS: let the pipeline assume a role and let the application read the secret itself.
- Key policy discipline. The KMS key policy must name the application role for decrypt; the deploy role should be able to manage the key without being able to use it.
- Separation of duties. The person who approves a production deployment should not be the one who wrote the change. Enforce with branch protection and environment reviewers; evidence lives in the run history and CloudTrail.
- Audit trail. CloudTrail records
AssumeRoleWithWebIdentityand everyGetSecretValue. Retain it according to your records policy. This lesson does not claim any regulatory standard is met.
Banking use case
Harbourline's change board requires, for every production release: who approved, what changed, and proof the deployer could not read customer data. The new flow gives all three. The approver is the GitHub Environment reviewer (recorded by GitHub); the change is the cdk diff output archived as a build artefact; and the deploy role has no secretsmanager:GetSecretValue or kms:Decrypt, so it can create the secret's resource but never read its value. Azure DevOps keeps running the legacy applications' pipelines until their wave, deploying to AWS with the same OIDC-style federation where supported ⚠ VERIFY, or with a short-lived role assumed in a script step.
Common mistakes
- Migrating pipelines, IaC and secrets in one go. If it breaks, nobody knows which change caused it. Sequence them.
- Copying the service principal secret into GitHub. It defeats the point. Use OIDC.
- Treating
cdk deploy --require-approval neveras safe. It is fine for sandboxes; production needs reviewed diffs. - Trusting
repo:org/*in the OIDC trust policy. Any repository in the organisation can then assume the role. Pin the repository and branch or environment. - Reading secrets on every request. It costs money and adds latency; cache briefly.
- Rotating without testing the application. A rotated password breaks connection pools that never refresh.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Not authorized to perform sts:AssumeRoleWithWebIdentity | Trust policy sub or aud does not match the token | Compare the token claims with the trust conditions; see Lab 9.2 |
Credentials could not be loaded in the job | id-token: write permission missing | Add the permission at workflow or job level |
AccessDeniedException reading a secret | Task role lacks secretsmanager:GetSecretValue or the key policy omits it | Grant read on the secret and decrypt on the key |
cdk diff shows replacement of a database | A property change forces replacement | Stop; plan a controlled migration instead of deploying |
| Secret deleted but name unusable | The secret is in its recovery window | Restore it, or use --force-delete-without-recovery in the lab only |
| Pipeline passes in Azure DevOps but fails in Actions | Different default shell, path or tool version | Pin tool versions explicitly in both |
Cost and cleanup
Cost label: free for the pipeline and CLI work. A Secrets Manager secret is billed per secret per month (about USD 0.40) and a customer managed KMS key about USD 1 a month, prorated hourly; both are small if destroyed the same day ⚠ VERIFY current prices. Free alternative: store non-secret settings in Parameter Store standard parameters, and do the secret exercise as a design.
# CDK route
cdk destroy SecretsStack --profile learn-sandbox
# CLI route for a lab secret (skips the recovery window: lab only)
aws secretsmanager delete-secret --secret-id hl/m13/ledger/db --force-delete-without-recovery \
--profile learn-sandbox --region us-east-1
# KMS keys are scheduled for deletion, not deleted at once (minimum waiting period is 7 days)
aws kms schedule-key-deletion --key-id alias/hl-m13-secrets --pending-window-in-days 7 \
--profile learn-sandbox --region us-east-1
# Verify what remains
aws resourcegroupstaggingapi get-resources --tag-filters Key=Project,Values=cea-lab \
--profile learn-sandbox --region us-east-1 --query "ResourceTagMappingList[].ResourceARN"A key pending deletion stops billing for the monthly key fee after deletion completes; check Console → KMS to confirm its state.
Exercises
- 🟢 Guided: run
cdk diff(orcdk synth) onSecretsStack, then explain what each resource in the output replaces from the Bicep example. - 🟡 Challenge: write the OIDC trust policy for a role that only the
mainbranch ofharbourline/ledgercan assume for theledger-testenvironment, and list the three claims it checks. - 🔴 Live problem: the security team found that an Azure DevOps service connection has Owner on the production subscription and its secret is in a wiki page. You are asked to "fix this as part of the AWS migration". Propose what you would do in the first week, what you would leave alone, and how you would show an auditor the old secret was revoked.
Assignment
Produce a DevOps migration card for one real pipeline: current stages and approvals, service connections and their scopes, secrets used, target workflow, target role and trust policy, IaC approach, and rollback. Commit it, with the translated workflow, to your portfolio repository.
Solutions
The Key replaces the Key Vault's encryption and access-control role (who may decrypt); the Secret replaces a secret stored in the vault; GrantRead replaces a role assignment or access policy for the application. Soft delete maps to the Secrets Manager recovery window; purge protection has no exact twin, so enforce it with an SCP that denies force-delete. The why: one Azure resource split into three AWS concerns, each with its own permission surface.
The role trust policy allows sts:AssumeRoleWithWebIdentity from the GitHub OIDC provider with conditions token.actions.githubusercontent.com:aud equals sts.amazonaws.com and token.actions.githubusercontent.com:sub equals repo:harbourline/ledger:environment:ledger-test. Checking the environment in sub covers the branch rule if the environment is restricted to main; if you prefer branch-only trust, use repo:harbourline/ledger:ref:refs/heads/main. The three claims: aud (audience), sub (repository plus branch or environment), and optionally iss, which the provider fixes. Never use a wildcard repository.
Knowledge check
Answer: an IAM role assumed through OIDC federation. The workflow gets short-lived credentials per run and no secret is stored.
Answer: a CloudFormation change set (--no-execute-changeset) or cdk diff, which show additions, modifications and replacements before anything changes.
Answer: the old value may have been exposed during its life; a migration is a natural moment to rotate. Generating the value in AWS also keeps it out of files and shells.
Answer: the caller's IAM policy, the secret's resource policy (if any) and the KMS key policy (which must allow the decrypt). Missing any one gives AccessDenied.
Answer: identity and landing zone first, then IaC, then secrets (re-created and rotated), and pipelines last, one application at a time.
Interview questions
- "How do pipelines authenticate to AWS without stored keys?" OIDC federation: the runner presents a signed token, STS validates it against the provider and the trust policy's conditions, and returns short-lived credentials for a role.
- "What do you migrate first, the pipeline or the infrastructure code?" Infrastructure code, because pipelines deploy it; keep the old pipeline running to avoid changing two things at once.
- "How do you stop the deploy role from reading production secrets?" Do not grant
GetSecretValueorkms:Decryptto it; the key policy lists only the application role for decrypt.
Certification practice
A team's pipeline currently stores an IAM user access key in CI variables. They want to eliminate long-lived credentials. Which approach is best?
A. Rotate the key every 90 days B. Configure an OIDC identity provider in IAM and have the pipeline assume a role with a trust policy restricted to the repository and branch C. Store the key in an encrypted variable D. Give the IAM user MFA
Answer: B. OIDC federation gives per-run temporary credentials and removes the stored secret. A and C keep a long-lived key; D does not apply to non-interactive pipelines.
An application role receives AccessDeniedException when reading a secret encrypted with a customer managed KMS key, although its IAM policy allows secretsmanager:GetSecretValue. What is the most likely missing piece?
A. The VPC lacks a NAT gateway B. The KMS key policy does not allow the role to use the key for decryption C. The secret has no tags D. The role needs MFA
Answer: B. Reading an encrypted secret requires permission on the key as well, and key policies are authoritative. A would cause timeouts, not AccessDenied. C and D are unrelated.
Completion checklist
- I can map five Azure DevOps concepts to GitHub Actions or AWS equivalents
- I can explain why OIDC replaces a service connection secret
- I ran
cdk difforcdk synthfor the secrets stack - I scheduled deletion of the KMS key and removed the secret, then ran the tag query
Key takeaways
- One dimension at a time: identity, then IaC, then secrets, then pipelines.
- OIDC roles replace service connection secrets; the trust policy is the control.
- Change sets and
cdk diffare thewhat-if; read them for replacements. - A vault becomes three AWS concerns: Secrets Manager, KMS and IAM or key policies.
- Rotate during migration; never bulk-copy secrets.
Further reading
Independent learning resource — not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.
Integration side by side: API Management, Service Bus and Event Grid vs AWS
Translate Azure API Management policies, Service Bus queues, topics and sessions, and Event Grid subscriptions into API Gateway, SQS, SNS and EventBridge, keep ordering and duplicate protection intact, and run both messaging systems side by side during a long migration.
Monitoring and identity side by side: Azure Monitor and Entra ID vs AWS
Translate Azure Monitor, Application Insights, KQL and Log Analytics into CloudWatch, Logs Insights and OpenTelemetry, and map Entra ID, Active Directory and managed identities onto IAM Identity Center, Cognito, AWS Managed Microsoft AD and IAM roles, with four identity integration patterns for a bank.