Governance Day 2
SCS-C03 · Domain 6 · Security Foundations and Governance (14%) · Day 2 of 3

Secure, consistent deployment across accounts

On Day 1 you built the account structure with Organizations, Control Tower, SCPs and RCPs. Today you fill those accounts the same secure way every time: CloudFormation StackSets, policy as code with cfn-lint, Guard and Hooks, a tagging strategy with tag policies and SCPs, central firewall rules with Firewall Manager, and sharing with Service Catalog and AWS RAM.

Skill 6.2.1 infrastructure as codeSkill 6.2.2 tagsSkill 6.2.3 central policy enforcementSkill 6.2.4 secure resource sharing~90 min read + 30 min lab
01

CloudFormation StackSets across accounts

Yesterday you built the account structure with Organizations and Control Tower. Today you fill those accounts with the same secure resources, every time. Skill 6.2.1 is about infrastructure as code (IaC): you describe resources in a template and let a tool create them. When one template must reach many accounts and Regions, the AWS answer is CloudFormation StackSets.

A StackSet is one template plus parameters. Each copy that lands in one account and one Region is a stack instance. Typical uses are security baselines: a CloudTrail trail, a GuardDuty setting, an IAM role for the security team, an AWS Config rule, or an S3 bucket policy.

Concept profile

CloudFormation StackSets

often confused with a single CloudFormation stack
?What is it?

A CloudFormation feature that creates, updates or deletes stacks across many accounts and Regions with one operation, from one administrator account.

⚙How does it work?
  • Service-managed permissions: needs Organizations with all features and trusted access turned on. CloudFormation creates the roles for you. You target OUs (or the whole organization). The management account or a delegated administrator (up to five) runs it.
  • Automatic deployment (service-managed only): when an account joins a target OU, CloudFormation deploys the stack to it. When an account leaves, it deletes the stack or retains it (RetainStacksOnAccountRemoval).
  • Self-managed permissions: you create AWSCloudFormationStackSetAdministrationRole in the administrator account and AWSCloudFormationStackSetExecutionRole in each target account. You target account IDs. Works without Organizations.
  • Deployment options: maximum concurrent accounts, failure tolerance (per Region), and Region concurrency (sequential by default, or parallel).
{ }Structure
Administrator management account or delegated admin (up to 5) StackSet: template Targets: OUs × Regions = stack instances OU: Prod Account A ✓ Account B ✓ us-east-1 eu-west-1 OU: Dev Account C ✓ New account D → auto-deployed Moved out → stack deleted or retained Management account gets no stack instance, even if it is in the target Service-managed permissions Organizations all features + trusted access Roles created for you · targets are OUs Automatic deployment to new accounts Self-managed permissions You create AWSCloudFormationStackSet- AdministrationRole + ...ExecutionRole Targets are account IDs · no auto-deploy
One StackSet, many stack instances. New accounts in a target OU get the stack automatically.
⇄StackSets vs a single CloudFormation stack
StackSetsSingle stack
ReachMany accounts × many RegionsOne account, one Region
New accountsAutomatic deployment (service-managed)Someone must deploy by hand
PermissionsService-managed or self-managed rolesYour own credentials or a service role
DriftPer stack instance, rolled up to the StackSetPer stack
Exam hint“every account”, “new accounts automatically”“one workload”
!Common mistakes the exam tests
  • Expecting a service-managed StackSet to deploy into the management account: it doesn’t, even when you target the root. Use a normal stack there.
  • Choosing self-managed permissions and expecting automatic deployment to new accounts: that needs service-managed permissions.
  • Misspelling the execution role: self-managed StackSets look for the exact role name in each target account.
  • Trying service-managed StackSets in an organization with only consolidated billing features: it needs all features.
  • Setting failure tolerance to 0 and max concurrency high: one failure stops the rollout, but many accounts may already have changed.
✓Benefits and use cases
  • Security baseline (roles, trails, Config rules) in every account.
  • Same resources in many Regions, for example a KMS key or alarm.
  • Customizations on top of Control Tower landing zones.

Drift detection and stack policies

IaC only stays secure if people don’t change resources by hand. Drift detection compares the real resources with the template. A resource is MODIFIED or DELETED; a stack is DRIFTED or IN_SYNC; a StackSet is drifted if any stack instance has drifted. Drift detection is an operation you start (or schedule yourself, for example from EventBridge or an AWS Config rule); it only reports and never fixes anything. It checks only properties that are set in the template and doesn’t include nested stacks. A stack policy protects resources from updates: once you set one, every resource is protected unless an Allow statement says otherwise, and Deny always wins. You can’t delete a stack policy, only replace it, and you can pass a temporary override policy for one update. Stack policies don’t stop stack deletion; turn on termination protection for that.

Think of it like · a franchise opening new shops

Head office keeps every shop the same.

AWS conceptFamiliar thing
StackSet≈The franchise manual that every shop must follow
Stack instance≈One shop in one city that was built from the manual
Automatic deployment≈A new shop opening in the region gets the full fit-out on day one
Retain stacks≈A shop leaves the franchise but keeps its furniture
Drift detection≈An inspector who notices a manager repainted the walls
Stack policy≈A sign on the safe: ‘do not replace without head office approval’
Real AWS example · service-managed StackSet with automatic deployment

Create the StackSet, then deploy it to two OUs in two Regions.

$ aws cloudformation create-stack-set --stack-set-name security-baseline \
    --template-body file://baseline.yaml \
    --permission-model SERVICE_MANAGED \
    --auto-deployment Enabled=true,RetainStacksOnAccountRemoval=false \
    --capabilities CAPABILITY_NAMED_IAM

$ aws cloudformation create-stack-instances --stack-set-name security-baseline \
    --deployment-targets OrganizationalUnitIds=ou-ab12-prod,ou-ab12-dev \
    --regions us-east-1 eu-west-1 \
    --operation-preferences MaxConcurrentPercentage=25,FailureTolerancePercentage=10
{ "OperationId": "4f1c2a9e-1d2b-4c3a-9e8f-0123456789ab" }

$ aws cloudformation detect-stack-set-drift --stack-set-name security-baseline

Run these from the management account or a delegated administrator (add --call-as DELEGATED_ADMIN).

Exam-style scenario

A company has 60 accounts in AWS Organizations and adds about five accounts each month. Every account in the Workloads OU must get an IAM role for the security team and an AWS Config rule as soon as it is created, with no manual work. What should a security engineer do?

  1. A. Create a StackSet with self-managed permissions and add each new account ID every month.
  2. B. Create a StackSet with service-managed permissions targeting the Workloads OU, with automatic deployment enabled.
  3. C. Write a Lambda function that runs CreateStack in each new account.
  4. D. Ask each account owner to deploy the template.
Show the worked answer

Answer: B

Service-managed StackSets deploy automatically to accounts that join the target OU.

Why not the others

  • A: Self-managed StackSets don’t support automatic deployment; it is manual work.
  • C: Custom code to maintain, when a built-in feature exists.
  • D: Not consistent and not automatic.
How the exam tests this
  • “Deploy to all current and future accounts in an OU”→ Service-managed StackSet + automatic deployment.
  • “No Organizations, a few known accounts”→ Self-managed StackSet with admin + execution roles.
  • “Let the security account run StackSets”→ Register it as a delegated administrator.
  • “Find manual console changes to stack resources”→ Drift detection.
  • “Stop updates that replace the production database”→ Stack policy denying Update:Replace.
Must remember
  • Service-managed = OUs, auto-deploy, roles made for you.
  • Self-managed = account IDs + two roles with exact names.
  • Management account never gets a service-managed instance.
  • Drift detection reports, never fixes.
  • Stack policy: everything protected once set; Deny wins; can’t delete it.
02

Policy as code: cfn-lint, Guard and Hooks

StackSets copy a template everywhere, so a mistake in the template is copied everywhere too. Skill 6.2.1 names two tools to catch mistakes before deployment: cfn-lint and CloudFormation Guard. AWS adds a third layer inside CloudFormation itself: CloudFormation Hooks. This idea is called shift left: find the problem as early, and as cheaply, as possible.

Concept profile

AWS CloudFormation Guard

often confused with cfn-lint
?What is it?

An open-source, general-purpose policy-as-code tool. You write rules in a simple declarative domain-specific language (DSL), and Guard checks any JSON or YAML data against them.

⚙How does it work?
  • Rules look like Resources.*[ Type == 'AWS::S3::Bucket' ].Properties.BucketEncryption exists.
  • cfn-guard validate checks data against rules; cfn-guard test runs unit tests for your rules; cfn-guard rulegen creates starter rules from an existing template.
  • Works on CloudFormation templates and change sets, JSON Terraform files (such as a plan exported as JSON), Kubernetes files and AWS Config configuration items.
  • Run it in the pipeline (CodeBuild, GitHub Actions) to fail a build, or use it as the logic inside a Guard Hook.
{ }Structure
1 · WriteTemplate orTerraform plan2 · cfn-lintValid syntax,properties, values3 · GuardPolicy as codein CI (validate)4 · HooksServer-side checkfail or warn5 · RunDrift detection+ stack policy← developer laptop and pipeline (can be skipped)inside CloudFormation (cannot be skipped) →cfn-lint asks: is this a valid template? Guard asks: does it follow our rules?Guard alone gives no server-side enforcement. Hooks run inside CloudFormation before provisioning.Drift detection finds changes made outside CloudFormation. It reports; it does not fix.
Each layer catches a different kind of problem.
⇄Guard vs cfn-lint
Guardcfn-lint
Question it answersDoes it follow our security rules?Is it a valid CloudFormation template?
RulesYou write them (DSL)Built in, from the resource specification
InputAny JSON/YAML (CFN, Terraform JSON, K8s)CloudFormation templates
Example finding“Bucket has no encryption”“Property BucketNme is not valid”
Server-side enforcementOnly through a Guard HookNo
!Common mistakes the exam tests
  • Picking cfn-lint to enforce “all buckets must be encrypted”: lint checks validity and best practice, not your company policy. Use Guard.
  • Picking Guard to catch invalid property values or syntax: that is cfn-lint.
  • Thinking pipeline checks are enough: a developer can deploy from a laptop and skip the pipeline. Hooks run inside CloudFormation for every stack.
  • Forgetting Hooks have a warn mode: use it first to see what would fail, then switch to fail.
  • Expecting Guard or Hooks to find changes made later in the console: that is drift detection or AWS Config.
✓Benefits and use cases
  • Fail a pull request that opens port 22 to 0.0.0.0/0.
  • One rule set for CloudFormation and Terraform plans.
  • Block non-compliant stacks in every account with Hooks.

CloudFormation Hooks and third-party IaC

Hooks are checks that CloudFormation runs before it provisions resources. They can target resources, whole stacks, change sets and also resources created through the Cloud Control API. If a resource fails, the Hook either fails the operation or only emits a warning, depending on its failure mode. You can build Hooks from Guard rules, from Lambda functions, from custom code, or turn on AWS Control Tower proactive controls, which are ready-made Hooks. Remember the three Control Tower control behaviours from Day 1: preventive (SCPs and RCPs), detective (Config rules) and proactive (Hooks).

Third-party IaC such as Terraform or Pulumi is fine for the exam if you secure it: keep the Terraform state file in an encrypted, versioned S3 bucket with tight access (state can contain secrets), let the pipeline assume a role per account (for example with OIDC federation) instead of using long-term access keys, scan the plan with Guard or similar tools, and keep AWS Config rules as a detective safety net.

Think of it like · building a house

Several checks before people can move in.

AWS conceptFamiliar thing
cfn-lint≈A spell checker for the architect’s drawings: wrong symbols, impossible sizes
Guard rules≈The city building code: smoke alarms and fire exits are required
Guard in CI≈The architect checks the code before sending the drawings
Hooks≈The city inspector at the site, who can stop the builders even if the architect skipped a check
Warn mode≈The inspector writes a note but lets work continue
Drift detection≈A later visit that finds the owner removed a wall
Real AWS example · a Guard rule and its result

The rule requires encryption and blocks public ACLs on every bucket.

# s3.guard
let buckets = Resources.*[ Type == 'AWS::S3::Bucket' ]
rule s3_encrypted when %buckets !empty {
    %buckets.Properties.BucketEncryption exists
    %buckets.Properties.PublicAccessBlockConfiguration.BlockPublicAcls == true
}

$ cfn-guard validate --data template.yaml --rules s3.guard
template.yaml Status = FAIL
FAILED rules
s3.guard/s3_encrypted    FAIL

$ cfn-lint template.yaml
E3002 Additional properties are not allowed ('BucketNme' was unexpected)
template.yaml:12:7

The two tools found two different problems: Guard found a policy gap; cfn-lint found a typo.

Exam-style scenario

A company deploys infrastructure with CloudFormation from a CI/CD pipeline that runs cfn-guard. The security team found that some developers create stacks directly from their laptops, and those stacks contain security groups open to 0.0.0.0/0. The company wants to block these stacks in every account, whatever tool starts the deployment, using the existing Guard rules. What should it do?

  1. A. Add cfn-lint to the pipeline.
  2. B. Activate a CloudFormation Guard Hook with the existing rules in every account (for example with a StackSet), in fail mode.
  3. C. Run drift detection every hour.
  4. D. Remove the developers’ IAM permissions for EC2 only.
Show the worked answer

Answer: B

Hooks run inside CloudFormation before provisioning, so they apply even when the pipeline is skipped, and Guard Hooks reuse the same rules.

Why not the others

  • A: Still only in the pipeline, and lint checks validity, not policy.
  • C: Detects problems after they exist; doesn’t block.
  • D: CloudFormation could still create groups with the developer’s other permissions or a service role; it doesn’t target the real rule.
How the exam tests this
  • “Enforce company rules on templates in the pipeline”→ CloudFormation Guard.
  • “Check template syntax and valid property values”→ cfn-lint.
  • “Server-side check before provisioning, can’t be skipped”→ CloudFormation Hooks.
  • “Ready-made proactive controls across the organization”→ Control Tower proactive controls (as Hooks).
  • “Same policy checks for Terraform plans”→ Guard on the JSON plan.
Must remember
  • Lint = valid? Guard = compliant?
  • Guard: open source DSL, validate · test · rulegen.
  • Hooks: before provisioning, fail or warn.
  • Hooks from Guard, Lambda, custom, or Control Tower proactive controls.
  • Terraform: encrypted state, roles not keys.
03

Tagging strategy, tag policies and SCPs

Skill 6.2.2 is about tags: key and value labels such as Environment=prod. Tags let you group resources for cost reports, automation, incident response and access control (ABAC from the IAM days). They only help if everyone uses the same keys and every resource actually has them. Tag keys and values are case sensitive on the resource, so CostCenter and costcenter are two different tags. Careful: in an IAM or SCP condition, the tag key inside the key name (aws:RequestTag/CostCenter) is matched case-insensitively, while the value is compared exactly by StringEquals. To force one spelling of the key, use a tag policy that enforces capitalization or a Deny on aws:TagKeys.

Concept profile

Tag policies (AWS Organizations)

often confused with SCPs that require tags
?What is it?

An Organizations management policy type that standardises tags: which key names to use, their capitalisation, and which values are allowed, across all accounts it is attached to.

⚙How does it work?
  • Needs Organizations with all features; attach to the root, OUs or accounts, and policies inherit down the tree.
  • Without enforcement, a tag policy only reports non-compliant tags.
  • Add enforced_for with resource types (for example ec2:instance) to block non-compliant tagging operations on those types.
  • Untagged resources are not evaluated: a tag policy can’t force a tag to exist.
  • See compliance with Resource Groups (Tag Editor); from the management account you see all accounts.
{ }Structure
Tagging strategy: decide the keys firstDepartment · CostCenter · Environment · Owner · DataClassificationTag policyStandard key namesand capitalisationAllowed valuesenforced_for blocksbad tag operationsUntagged = not checkedSCPDeny create whenaws:RequestTag/Keyis missing (Null)Deny tag changesusing aws:TagKeysor ResourceTagResource GroupsGroup by tag queryTag Editor: find andbulk-edit tagsCompliance report(org view from themanagement account)Standardise with tag policies, require with SCPs, find and report with Resource Groups.
Three tools, three jobs.
⇄Tag policies vs SCPs that require tags
Tag policySCP with aws:RequestTag
Main jobSame key spelling and allowed valuesTag must be present when creating
Untagged resourceNot evaluated, allowedCreate call denied
Wrong valueBlocked only with enforced_forBlocked if the condition checks values
ReportingCompliance reportNone (just AccessDenied)
Exam hint“standardise”, “consistent case”“must not create without the tag”
!Common mistakes the exam tests
  • Using a tag policy to stop people creating untagged resources: tag policies ignore untagged resources. Use an SCP with a Null condition on aws:RequestTag/CostCenter.
  • Writing the SCP on the wrong resource: for EC2 the tag check belongs on ec2:RunInstances for the instance (and volume) resource, not on the AMI or subnet.
  • Forgetting to stop people changing or deleting tags later, which breaks ABAC: deny ec2:CreateTags/DeleteTags on protected keys with aws:TagKeys.
  • Expecting user-defined tags in cost reports immediately: they must be activated as cost allocation tags in Billing.
  • Enforcing a new tag policy everywhere at once: test it on one account first, as AWS recommends.
✓Benefits and use cases
  • Show cost per department or cost center.
  • Find every production resource during an incident.
  • ABAC: allow access only when principal and resource tags match.

A simple tagging strategy

Start with a short list of mandatory keys, for example Department, CostCenter, Environment (prod, staging, dev), Owner and DataClassification. Write them down with the exact spelling and allowed values. Then: put the rules in a tag policy, require the most important keys at creation with an SCP, apply default tags in IaC (StackSets, Service Catalog TagOptions, Terraform default tags), and use AWS Resource Groups to build tag-based groups that tools like Systems Manager can act on. AWS Config’s required-tags rule is a detective check for anything that slipped through.

Think of it like · a school uniform

How a school keeps every pupil easy to identify.

AWS conceptFamiliar thing
Tagging strategy≈The uniform rules written in the school handbook
Tag policy≈The handbook says the badge must read ‘Year 9’, not ‘yr9’
enforced_for≈The shop refuses to sell a badge with the wrong spelling
SCP + aws:RequestTag≈The gate guard won’t let anyone in without a name badge
Resource Groups≈Calling all pupils with a red badge to the hall
Cost allocation tag≈Sending the bill for each class trip to the right parents
Real AWS example · SCP: no EC2 instance without a CostCenter tag

Denies the launch when the request has no CostCenter tag.

{ "Version": "2012-10-17",
  "Statement": [{
    "Sid": "RequireCostCenterOnLaunch",
    "Effect": "Deny",
    "Action": "ec2:RunInstances",
    "Resource": "arn:aws:ec2:*:*:instance/*",
    "Condition": { "Null": { "aws:RequestTag/CostCenter": "true" } }
  }]}

Tag policy fragment (standard spelling, allowed values, enforced):
{ "tags": { "costcenter": {
    "tag_key":   { "@@assign": "CostCenter" },
    "tag_value": { "@@assign": ["100", "200", "300"] },
    "enforced_for": { "@@assign": ["ec2:instance"] } } } }

Together: the SCP makes the tag required; the tag policy makes the spelling and value correct.

Exam-style scenario

A finance team says cost reports are useless because resources are tagged “costcenter”, “Cost-Center” and “CostCenter”, and many EC2 instances have no cost tag at all. The company uses AWS Organizations with all features. Which combination fixes both problems with the least effort?

  1. A. An AWS Config rule in each account that emails owners.
  2. B. A tag policy that defines the CostCenter key and allowed values, enforced for ec2:instance, plus an SCP that denies ec2:RunInstances when aws:RequestTag/CostCenter is null.
  3. C. A tag policy only, enforced for all resource types.
  4. D. IAM permission boundaries on every developer role.
Show the worked answer

Answer: B

The tag policy fixes spelling and values; the SCP stops untagged launches, which tag policies don’t evaluate.

Why not the others

  • A: Detects but doesn’t prevent, and must be built per account.
  • C: Tag policies don’t evaluate untagged resources, so instances without the tag still launch.
  • D: Boundaries limit permissions per role; much more work and not a tagging standard.
How the exam tests this
  • “Standardise tag key case and values across the org”→ Tag policy.
  • “Prevent creating resources without a required tag”→ SCP with aws:RequestTag + Null.
  • “Stop users removing the Owner tag”→ Deny tag actions with aws:TagKeys.
  • “View non-compliant tags across all accounts”→ Resource Groups compliance from the management account.
  • “Group resources by tag for operations”→ AWS Resource Groups.
Must remember
  • Tags are case sensitive on resources; condition key names are not.
  • Tag policy: spelling + values; untagged not checked.
  • enforced_for = block bad tag operations.
  • Require a tag: SCP + aws:RequestTag + Null.
  • Cost reports need activated cost allocation tags.
04

AWS Firewall Manager policies

Skill 6.2.3 says deploy and enforce policies and configurations from a central source, and the example is AWS Firewall Manager. On Infrastructure Day 1 you met it as the way to roll out WAF and Shield Advanced. Here you need the full picture: its prerequisites, all its policy types, and how scope and auto-remediation work.

Concept profile

AWS Firewall Manager

often confused with AWS Config rules / StackSets
?What is it?

A security management service that applies firewall policies across all accounts and resources in AWS Organizations from one administrator account, and keeps applying them to new accounts and resources.

⚙How does it work?
  • Prerequisites, in order: join AWS Organizations (all features); set the Firewall Manager administrator account from the management account (you can add more administrators with a limited scope); enable AWS Config in each member account and Region in scope; for Network Firewall and DNS Firewall policies, enable AWS RAM sharing with the organization; for third-party firewalls, subscribe in AWS Marketplace.
  • Policy types: AWS WAF, Shield Advanced, VPC security group, VPC network ACL, Network Firewall, Route 53 Resolver DNS Firewall and third-party firewalls (Palo Alto Cloud NGFW, Fortigate CNF). Each policy has one type.
  • Scope: include or exclude accounts and OUs, choose resource types, and include or exclude by tag.
  • Choose auto-remediation on (fix non-compliant resources) or off (only report).
{ }Structure
PrerequisitesOrganizations, all featuresFMS administrator accountAWS Config on, in eachaccount and Region in scopeRAM sharing with the org(Network + DNS Firewall)Marketplace (third-party)Firewall Manager policy types (one type per policy)AWS WAFShield AdvancedSecurity groupNetwork ACLNetwork FirewallDNS FirewallThird-partyScope: accounts/OUs,resource type, tagsauto-remediate: on or offNew account joins an in-scope OU → FMS applies the policy to its in-scope resources automatically.WAF and DNS Firewall: central “first” and “last” rule groups; account teams add rules in between.
Set up once, then every in-scope account follows the policy.
⇄Firewall Manager vs AWS Config rules / StackSets
Firewall ManagerConfig rules / StackSets
ScopeFirewall resources (WAF, SG, NACL, NFW, DNS FW…)Any resource / any template
New accountsPolicy applied automaticallyConformance packs / auto-deploy can do it too
Keeps checkingYes, finds and fixes non-complianceConfig: yes; StackSets: only on deploy (+ drift)
Local rules allowedYes, between central first/last rulesn/a
Exam hint“central firewall rules in all accounts”“deploy any baseline”, “check any setting”
!Common mistakes the exam tests
  • Forgetting AWS Config: Firewall Manager can’t see or fix resources in accounts where Config isn’t recording.
  • Expecting Network Firewall or DNS Firewall policies to work without RAM sharing enabled for the organization.
  • Turning on auto-remediation for a security group audit policy on day one: AWS recommends starting with remediation off and reviewing the findings, because remediation can change or delete groups.
  • Thinking one policy can mix types: create one policy per type.
  • Letting another tool manage the same security groups: the two tools keep undoing each other. Exclude one from the other by tags.
✓Benefits and use cases
  • Same WAF rule groups on every public ALB and CloudFront distribution.
  • Remove SSH from 0.0.0.0/0 everywhere.
  • Network Firewall and DNS Firewall in every new VPC.

Security group, Network Firewall and DNS Firewall policies

Security group policies come in three kinds. A common policy pushes a standard security group (for example “allow HTTPS from the corporate range”) to in-scope resources, such as EC2 instances and ALBs selected by tag. A content audit policy checks the rules inside groups and flags or removes forbidden ones, such as SSH from 0.0.0.0/0. A usage audit policy finds and cleans up unused or redundant groups. Changes to groups on EC2 network interfaces can take up to six hours to show in Firewall Manager. A Network Firewall policy creates firewall endpoints in in-scope VPCs with a central firewall policy, in a distributed model (one firewall per VPC) or a centralized inspection VPC. A DNS Firewall policy associates Route 53 Resolver DNS Firewall rule groups with VPCs to block lookups of bad domains. Like WAF policies, it uses central rule groups that run first and last, and account teams may add their own in between. A network ACL policy enforces baseline NACL rules on subnets.

Think of it like · a hotel chain’s safety office

One office sets safety rules for every hotel.

AWS conceptFamiliar thing
Firewall Manager≈Head office safety team for all hotels in the chain
AWS Config prerequisite≈CCTV in each hotel: without it head office can’t see anything
Common SG policy≈Every room door gets the same standard lock
Content audit≈Inspectors check that no fire door is propped open
Usage audit≈Removing old locks from rooms nobody uses
First / last rule groups≈Head office rules start and end every safety checklist; each hotel adds its own in the middle
Real AWS example · a content audit security group policy

Audit every security group in the Workloads OU and flag rules that allow SSH from anywhere. Remediation stays off at first.

$ aws fms put-policy --policy '{
  "PolicyName": "no-open-ssh",
  "SecurityServicePolicyData": {
    "Type": "SECURITY_GROUPS_CONTENT_AUDIT",
    "ManagedServiceData": "{\"type\":\"SECURITY_GROUPS_CONTENT_AUDIT\",\"securityGroupAction\":{\"type\":\"ALLOW\"},\"securityGroups\":[{\"id\":\"sg-0audit\"}]}"
  },
  "ResourceType": "AWS::EC2::SecurityGroup",
  "IncludeMap": { "ORG_UNIT": ["ou-ab12-workloads"] },
  "ExcludeResourceTags": false,
  "RemediationEnabled": false }'

$ aws fms list-compliance-status --policy-id a1b2c3d4-...
  "PolicyComplianceStatusList": [ { "MemberAccount": "222233334444",
     "EvaluationResults": [ { "ComplianceStatus": "NON_COMPLIANT", "ViolatorCount": 3 } ] } ]

The audit group sg-0audit lists the rules that are allowed; anything outside it is a violation.

Exam-style scenario

A company with 80 accounts wants to block DNS queries to known malware domains from every VPC, including VPCs created later in new accounts. Account teams must be able to add their own domain block lists. AWS Config is enabled everywhere. What else must the security team do?

  1. A. Create a DNS Firewall rule group in each account manually.
  2. B. Enable AWS RAM sharing with the organization, then create a Firewall Manager DNS Firewall policy with the central rule group as a first rule group.
  3. C. Use GuardDuty to block DNS queries.
  4. D. Deploy Network ACLs that block the malware IPs.
Show the worked answer

Answer: B

Firewall Manager DNS Firewall policies need RAM sharing enabled; they reach new VPCs automatically and let accounts add rule groups between first and last.

Why not the others

  • A: Manual and misses new VPCs.
  • C: GuardDuty detects; it doesn’t block DNS queries.
  • D: NACLs work on IPs, not domain names, and change constantly.
How the exam tests this
  • “Same firewall rules in all accounts, new ones too”→ Firewall Manager.
  • “Firewall Manager can’t see member accounts”→ Enable AWS Config there.
  • “DNS Firewall / Network Firewall policy fails to deploy”→ Enable RAM sharing with Organizations.
  • “Remove unused security groups org-wide”→ Usage audit SG policy.
  • “Flag SSH open to the world everywhere”→ Content audit SG policy.
Must remember
  • Prereqs: Organizations · admin · Config · RAM.
  • Seven types: WAF, Shield, SG, NACL, NFW, DNS FW, third-party.
  • SG: common, content audit, usage audit.
  • Scope by OU, account, resource type, tag.
  • Audit policies: start with remediation off.
05

AWS Service Catalog

Skill 6.2.4 is about securely sharing resources across accounts. The first example is AWS Service Catalog: instead of giving teams broad permissions to build things themselves, a central team offers a menu of approved, secure products. Teams launch them with a click, and the product is always built the approved way.

Concept profile

AWS Service Catalog portfolios and products

often confused with AWS RAM
?What is it?

A service where administrators publish approved IaC templates as products, group them in portfolios, control who may use them, and let end users launch them without broad permissions.

⚙How does it work?
  • A product is a versioned CloudFormation template (or a Terraform configuration). A portfolio holds products, constraints and the IAM principals who can use it.
  • A launch constraint names the IAM role that Service Catalog assumes to launch, update or terminate the product, so end users only need Service Catalog permissions. It applies to one product in one portfolio.
  • Other constraints: template constraints (limit parameter values, such as instance types), notification, tag update and StackSet constraints. TagOptions apply standard tags.
  • Share portfolios account to account (the recipient imports it) or through AWS Organizations to an OU or account (no import needed).
{ }Structure
Hub account: portfolio Products: encrypted S3 v1, v2 · VPC Constraints: launch role, template TagOptions · principals (who may use) share (reference) Spoke account Organizations share: no import needed Account share: admin imports by ID Can add: IAM principals, local TagOptions Cannot: change products or constraints Cannot: re-share the shared portfolio End user only needs Service Catalog permissions, not EC2 or S3. Launch: user → Service Catalog assumes launch role → CloudFormation builds stack Give the launch constraint a role name (not a full ARN) so it works in every account where that role exists. Products can be CloudFormation templates or Terraform configurations.
A hub and spoke model: build once centrally, launch safely everywhere.
⇄Service Catalog vs AWS RAM
Service CatalogAWS RAM
What is sharedA menu of templates; each team gets its own copyThe same resource, used by many accounts
Who owns the resultThe account that launchesThe owner account
ExampleAn approved encrypted bucket or VPCOne subnet, one Transit Gateway
Permission trickLaunch role does the workManaged permissions
Exam hint“self-service”, “approved products”, “least privilege launch”“share a single resource”
!Common mistakes the exam tests
  • Giving end users full EC2 and CloudFormation rights so they can launch products: use a launch constraint role instead.
  • Using a full role ARN in the launch constraint of a shared portfolio: the ARN belongs to one account. Use a role name that exists in every recipient account.
  • Expecting recipients to edit shared products or constraints: they can only add IAM principals and local TagOptions.
  • Trying to re-share an imported portfolio: you can’t share a shared resource.
  • Mixing up portfolios and products: access is granted on the portfolio.
✓Benefits and use cases
  • Self-service for developers within guardrails.
  • Only approved instance types and encrypted storage.
  • One central team updates a product version; all accounts see it.

Sharing portfolios safely

When you share a portfolio you share a reference: the products and constraints stay in sync with your changes. The recipient administrator decides which of their users get access. With Organizations sharing you can also share principal names (role names that are matched in each account) and TagOptions. AWS recommends the IAM principal type rather than a pattern that could match roles created later, to avoid a privilege escalation path. Service Catalog AppRegistry is a related feature that records your applications and their resources.

Think of it like · a company canteen

Staff get good food without entering the kitchen.

AWS conceptFamiliar thing
Product≈One dish on the menu, cooked by a fixed recipe
Product version≈A new edition of the recipe
Portfolio≈The menu for one floor of the building
Launch constraint≈Only the cook goes into the kitchen; you just order
Template constraint≈You can choose small or medium, not extra large
Sharing a portfolio≈Other office buildings get the same menu, updated centrally
Real AWS example · launch constraint and Organizations share

Use a role name so the constraint works in every account, then share with an OU.

$ aws servicecatalog create-constraint --type LAUNCH \
    --portfolio-id port-2abcxyz --product-id prod-7s3ncmnp \
    --parameters '{"LocalRoleName": "SCLaunch-S3Product"}'

$ aws servicecatalog create-portfolio-share --portfolio-id port-2abcxyz \
    --organization-node Type=ORGANIZATIONAL_UNIT,Value=ou-ab12-workloads \
    --share-principals --share-tag-options
{ "PortfolioShareToken": "share-6ffmm6rj6uqcy" }

Deploy the SCLaunch-S3Product role to every account first, for example with a StackSet.

Exam-style scenario

Developers in 30 accounts need to create S3 buckets that are always encrypted with KMS and block public access. The security team doesn’t want to give developers s3:CreateBucket or CloudFormation permissions. Which solution meets these requirements?

  1. A. Share an S3 bucket with AWS RAM.
  2. B. Create a Service Catalog product for the secure bucket, add a launch constraint with a local role name, and share the portfolio to the developers’ OU through AWS Organizations.
  3. C. Give developers PowerUserAccess and an SCP that requires encryption.
  4. D. Email the CloudFormation template to each team.
Show the worked answer

Answer: B

The launch role creates the bucket, so developers need only Service Catalog permissions, and the product always builds the approved configuration.

Why not the others

  • A: S3 buckets aren’t shared with RAM, and they need their own buckets.
  • C: Gives far more permission than needed.
  • D: Teams could change the template and need CloudFormation rights.
How the exam tests this
  • “Self-service launch of approved resources”→ Service Catalog.
  • “End users must not need permissions for underlying services”→ Launch constraint role.
  • “Limit instance types users can choose”→ Template constraint.
  • “Share a portfolio with an OU without imports”→ Organizations portfolio sharing.
  • “Launch role must work in many accounts”→ Local role name in the launch constraint.
Must remember
  • Product = template; portfolio = products + constraints + access.
  • Launch constraint = role Service Catalog assumes.
  • Use a role name for shared portfolios.
  • Org share: no import; account share: import.
  • Recipients can’t edit or re-share.
06

AWS Resource Access Manager (RAM)

Service Catalog shares recipes. AWS RAM shares the actual resource. One network team can own a VPC subnet, a Transit Gateway or a Route 53 Resolver rule, and many accounts can use it. This avoids building the same thing in every account and keeps control with one owner.

Concept profile

AWS Resource Access Manager

often confused with resource-based policies
?What is it?

A service that shares supported resources you own with other accounts, OUs, your whole organization, and for some types IAM roles, users or service principals.

⚙How does it work?
  • A resource share has three parts: the resources, the principals, and a managed permission for each resource type that says what principals may do.
  • To share inside your organization, first run enable-sharing-with-aws-organization in RAM from the management account. Then principals in the org get access without invitations.
  • Principals outside the organization get an invitation and have access only after they accept. A share must allow external principals for this.
  • AWS managed permissions cover normal use; customer managed permissions let you allow fewer actions for least privilege. Only the default version of a permission can be attached.
{ }Structure
Owner account resource share = Resources (subnet, TGW, CA…) Principals (org, OU, account) Managed permission (actions) no invitation invitation to accept Account in the organization Access at once, if sharing with Organizations is enabled in RAM (VPC subnets: same org only) External account Only if the share allows external principals; must accept invitation The owner keeps ownership and pays for the resource. Participants use it but can’t change or delete it. Block outside sharing org-wide with an SCP on ram:RequestedAllowsExternalPrincipals.
Inside the org: automatic. Outside: invitation, and only if allowed.
⇄RAM vs resource-based policies
RAMResource-based policies
Used bySubnets, TGWs, Resolver rules, prefix lists, Private CA, IPAM pools…S3, KMS, SQS, SNS, Lambda, Secrets Manager…
Share with whole org/OUYes, by org or OU ARNWith aws:PrincipalOrgID / PrincipalOrgPaths conditions
Where definedA resource share in RAMA policy on the resource itself
PermissionsManaged permissionsThe policy statements
Exam hint“share a subnet / Transit Gateway”“cross-account access to a bucket or key”
!Common mistakes the exam tests
  • Turning on trusted access from the Organizations console and expecting org sharing to work: enable sharing in RAM (console Settings or CLI), which creates the needed service-linked role.
  • Sharing a VPC subnet with an account outside the organization: subnets can be shared only within the same organization.
  • Expecting participants to change a shared subnet or Transit Gateway: the owner keeps control and cost; participants only use it.
  • Leaving “allow sharing with anyone” open: restrict with an SCP that denies ram:CreateResourceShare and ram:UpdateResourceShare when ram:RequestedAllowsExternalPrincipals is true.
  • Using RAM for S3 buckets or KMS keys: those use resource-based policies.
✓Benefits and use cases
  • VPC sharing: one network account, many app accounts.
  • One Transit Gateway or Network Firewall policy used everywhere.
  • Shared Private CA, IPAM pools, Resolver rules and DNS Firewall rule groups.

VPC sharing in practice

In VPC sharing the network account owns the VPC and shares subnets with participant accounts in the same organization. Participants launch their own EC2 instances, RDS databases and Lambda functions into the shared subnets. Each participant owns and pays for its own resources and can’t see or change other participants’ resources or the subnet, route tables and NACLs. The owner can’t change participant resources either. This splits duties well: the network team controls routing and inspection; app teams control their workloads. Firewall Manager itself uses RAM to share Network Firewall and DNS Firewall rule groups, which is why RAM sharing is one of its prerequisites.

Think of it like · a shared office building

Many companies, one building owner.

AWS conceptFamiliar thing
Resource owner≈The landlord who owns the building and pays for repairs
Resource share≈The lease that lists which floors, which tenants, which rights
Managed permission≈The lease rules: you may use the meeting rooms, not repaint them
Inside the organization≈Staff of sister companies get keys automatically
Outside the organization≈An outside company must sign and return the lease first
VPC sharing≈Tenants bring their own furniture into floors the landlord maintains
Real AWS example · share subnets with an OU

Enable org sharing once, then share two subnets with the Workloads OU.

$ aws ram enable-sharing-with-aws-organization
{ "returnValue": true }

$ aws ram create-resource-share --name prod-subnets \
    --resource-arns arn:aws:ec2:eu-west-1:111122223333:subnet/subnet-0a1b \
                    arn:aws:ec2:eu-west-1:111122223333:subnet/subnet-0c2d \
    --principals arn:aws:organizations::111122223333:ou/o-abc123/ou-ab12-workloads \
    --no-allow-external-principals
{ "resourceShare": { "name": "prod-subnets", "status": "ACTIVE",
    "allowExternalPrincipals": false, "owningAccountId": "111122223333" } }

No invitation is sent; accounts in the OU see the subnets at once.

Exam-style scenario

A network team wants 25 application accounts in the organization to use a central VPC’s private subnets, so all traffic goes through one inspection path. Application teams must manage their own instances but must not change routing. Sharing outside the organization must be impossible. What should the team do?

  1. A. Create VPC peering from each account to the central VPC.
  2. B. Enable RAM sharing with Organizations, share the subnets with the application OU, and add an SCP that denies resource shares allowing external principals.
  3. C. Share the VPC with a Service Catalog portfolio.
  4. D. Give application teams an IAM role in the network account.
Show the worked answer

Answer: B

VPC sharing through RAM lets participants launch resources while the owner keeps routing; the SCP blocks external shares.

Why not the others

  • A: 25 peerings, each team still needs its own VPC and routing.
  • C: Service Catalog shares templates, not live subnets.
  • D: Gives teams access to the network account, including routing.
How the exam tests this
  • “Share subnets or a Transit Gateway with other accounts”→ AWS RAM.
  • “Org members should get access without accepting invitations”→ Enable sharing with AWS Organizations in RAM.
  • “Prevent sharing with accounts outside the org”→ Share setting + SCP on ram:RequestedAllowsExternalPrincipals.
  • “Give principals fewer actions than the default”→ Customer managed permission.
  • “Cross-account access to a KMS key”→ Key policy, not RAM.
Must remember
  • Share = resources + principals + managed permission.
  • In org: no invitation; outside: must accept.
  • Enable org sharing in RAM, from the management account.
  • Subnets: same org only.
  • Owner keeps control and cost.
07

Cheatsheet extras: CloudFormation service roles, iam:PassRole and stack condition keys

Your cheat sheet has a warning that this lecture only touched: whoever can run a CloudFormation stack can borrow the permissions of the stack’s service role. That is a classic privilege escalation path, and it is also how you safely let developers deploy without giving them admin rights. The cheat sheet also lists IAM condition keys that control which templates and roles may be used.

Concept profile

CloudFormation service role

often confused with the caller’s own credentials
?What is it?

An IAM role that trusts cloudformation.amazonaws.com. When a stack has a service role, CloudFormation uses that role to create, update and delete the stack’s resources, instead of the permissions of the person who runs the stack operation.

⚙How does it work?
  • You choose the role with --role-arn when creating or updating a stack. To do that you need iam:PassRole on that role.
  • Without a service role, CloudFormation uses a temporary session from your credentials, so you need permission for every resource in the template.
  • Once a stack has a role, CloudFormation keeps using it. Anyone allowed to operate on that stack (update, delete, run a change set) gets the role’s power for those operations, even without PassRole.
  • Limit this with IAM condition keys: cloudformation:RoleArn (which service role must be used), cloudformation:TemplateUrl (only templates from an approved bucket), cloudformation:ResourceTypes (only some resource types), cloudformation:ChangeSetName (naming rules).
  • Limit PassRole with iam:PassedToService = cloudformation.amazonaws.com.
{ }Structure
Developer cloudformation:* on dev-* stacks iam:PassRole on CfnDeployRole only condition cloudformation:RoleArn no direct EC2 / IAM rights --role-arn CloudFormation assumes CfnDeployRole (trusts cloudformation .amazonaws.com) keeps it for later updates Stack resources only what CfnDeployRole allows (with a permissions boundary on any IAM roles it creates) Risk: a powerful service role on a stack = anyone who can update that stack can use the role’s power. Keep deploy roles narrow, and limit who can update stacks that use them.
The developer passes a narrow role; CloudFormation does the work with that role.
⇄Service role vs the caller’s own credentials
Stack with a service roleStack without one
Whose permissions create resourcesThe service role’sThe caller’s
What the caller needsCloudFormation actions + iam:PassRole (first time)CloudFormation actions + rights for every resource in the template
Least privilege for developersEasy: no direct resource rightsHard: developers need broad rights
Main riskAnyone who can update the stack borrows the roleDevelopers can create resources outside CloudFormation too
StackSets equivalentAdministration role + execution role (Section 01)n/a
!Common mistakes the exam tests
  • Giving iam:PassRole on "Resource": "*": users can pass an admin role to CloudFormation (or EC2, Lambda) and escalate.
  • Attaching an admin service role to a stack that many people can update.
  • Forgetting that a deploy role which can create IAM roles needs a permissions boundary condition, or it can create an admin role.
  • Thinking a stack policy limits who can deploy: it only protects resources inside a stack from updates.
  • Allowing templates from anywhere when the requirement says “only approved templates”: use cloudformation:TemplateUrl or Service Catalog.
✓Benefits and use cases
  • Developers deploy infrastructure without holding admin rights.
  • One audited deploy role per pipeline or team.
  • Force use of approved templates and resource types with IAM conditions.

Older material says AWS Firewall Manager manages only AWS WAF rules on CloudFront and ALBs, “not NACLs or security groups”. Today it manages WAF, Shield Advanced, security groups, network ACLs, Network Firewall, Route 53 Resolver DNS Firewall and third-party firewalls (see Section 04).

Think of it like · a company car with a driver

You don’t get the car keys; you tell the company driver where to go.

AWS conceptFamiliar thing
Service role≈The company driver who has the car keys
iam:PassRole≈Permission to book that particular driver
cloudformation:RoleArn condition≈“You may only book driver No. 7”
cloudformation:TemplateUrl≈Only routes from the approved route book
Anyone who can update the stack≈Anyone who can ring the car can redirect the driver
Real AWS example · developer policy for safe deployments

Developers can run stacks only with one deploy role and only from the approved template bucket.

{
  "Version": "2012-10-17",
  "Statement": [
    { "Sid": "StacksWithDeployRoleOnly",
      "Effect": "Allow",
      "Action": [ "cloudformation:CreateStack", "cloudformation:UpdateStack",
                  "cloudformation:CreateChangeSet" ],
      "Resource": "arn:aws:cloudformation:*:111122223333:stack/dev-*/*",
      "Condition": {
        "StringEquals": { "cloudformation:RoleArn":
          "arn:aws:iam::111122223333:role/CfnDeployRole" },
        "StringLike": { "cloudformation:TemplateUrl":
          "https://approved-templates.s3.amazonaws.com/*" } } },
    { "Sid": "PassOnlyTheDeployRole",
      "Effect": "Allow",
      "Action": "iam:PassRole",
      "Resource": "arn:aws:iam::111122223333:role/CfnDeployRole",
      "Condition": { "StringEquals": { "iam:PassedToService": "cloudformation.amazonaws.com" } } }
  ]
}

The developer has no direct EC2 or IAM rights, so everything goes through CloudFormation with CfnDeployRole.

Exam-style scenario

A team wants developers to deploy their own stacks with CloudFormation. Developers must not be able to create resources outside CloudFormation, and must not be able to use any role other than an approved deploy role. Which solution meets the requirements?

  1. A. Give developers AdministratorAccess and a stack policy that denies updates.
  2. B. Give developers CloudFormation permissions with a cloudformation:RoleArn condition and iam:PassRole only on the approved deploy role; give the deploy role the resource permissions.
  3. C. Give developers iam:PassRole on all roles and CloudFormation full access.
  4. D. Use drift detection to find resources created outside CloudFormation.
Show the worked answer

Answer: B

Developers hold only CloudFormation rights and can pass only the one role; the role does the work.

Why not the others

  • A: Admins can create anything directly; a stack policy only protects stack resources.
  • C: PassRole on all roles lets them pass an admin role.
  • D: Drift detection reports changes to stack resources; it doesn’t prevent anything.
How the exam tests this
  • “Developers deploy without broad permissions”→ CloudFormation service role + PassRole on that role only.
  • “Force a specific role for stack operations”→ cloudformation:RoleArn condition.
  • “Only templates from our bucket”→ cloudformation:TemplateUrl (or Service Catalog).
  • “User escalated by passing an admin role”→ Scope iam:PassRole resources + iam:PassedToService.
Must remember
  • Service role trusts cloudformation.amazonaws.com.
  • Setting it needs iam:PassRole; later stack users borrow it.
  • Keys: RoleArn · TemplateUrl · ResourceTypes · ChangeSetName.
  • PassRole never on *; add iam:PassedToService.
  • Firewall Manager today: 7 policy types, not just WAF.
08

Lecture summary map

Day 2 on one screen.

1. Mind map

① StackSetsService vs self-managedAuto-deploy to OUDrift · stack policy② Policy as codecfn-lint = valid?Guard = compliant?Hooks: fail or warn③ TagsTag policy: spellingSCP: tag requiredResource Groups④ Firewall ManagerOrgs + Config + RAM7 policy typesSG audit, DNS FW⑤ Service CatalogPortfolio + productsLaunch roleOrg share: no import⑥ AWS RAMShare the resourceIn org: no inviteSubnets: org onlyGovernance 2secure, consistent deployment
Tap a branch to jump back to that part of the lecture. Try redrawing this map from memory on paper.

2. Match the requirement to the control

“Deploy a baseline to every new account”→StackSets, service-managed“Fail the pipeline if S3 isn’t encrypted”→CloudFormation Guard“Block it even outside the pipeline”→CloudFormation Hooks“Someone changed it in the console”→Drift detection“Same tag key spelling everywhere”→Tag policy“No resource without a CostCenter tag”→SCP + aws:RequestTag“Same SG and firewall rules org-wide”→AWS Firewall Manager“Share a subnet / TGW with accounts”→AWS RAM
The left column is the exam wording; the right column is the answer.

3. “If the question says… pick…”

Baseline in every current and future account of an OUService-managed StackSet + auto-deploy
No Organizations, deploy to known accountsSelf-managed StackSet (two roles)
Resources changed by hand in the consoleDrift detection
Prevent replacing a critical resource in updatesStack policy
Company rules on templates in CI/CDCloudFormation Guard
Invalid template properties or syntaxcfn-lint
Check that can’t be skipped, before provisioningCloudFormation Hooks
Standard tag spelling and values org-wideTag policy
Block creating resources without a tagSCP + aws:RequestTag
Central firewall rules, new accounts includedFirewall Manager
Users launch approved stacks without broad rightsService Catalog + launch constraint
Many accounts use one subnet or TGWAWS RAM
Developers deploy without broad rightsCFN service role + scoped PassRole
Day 2 in one sentence

Write it once as code, check it before it runs, tag everything, enforce firewalls centrally, and share instead of copying.

09

Must-remember cheat sheet

1. Service-managed StackSet: OUs + auto-deploy.
2. Self-managed: Administration + Execution roles.
3. Management account gets no service-managed instance.
4. StackSets delegated admins: up to 5.
5. Drift detection reports only.
6. Stack policy: all protected once set; Deny wins.
7. cfn-lint = valid; Guard = compliant.
8. Hooks: before provisioning, fail or warn.
9. Proactive controls = Hooks.
10. Tags are case sensitive on resources; aws:RequestTag/Key key names are not.
11. Tag policy ignores untagged resources.
12. Require tags: SCP + aws:RequestTag + Null.
13. FMS: Orgs, admin, Config, RAM.
14. SG policies: common, content audit, usage audit.
15. Service Catalog launch role: use a role name.
16. RAM in org: no invitation; subnets org only.
17. CFN service role: setting it needs iam:PassRole; stack users borrow it.
18. Force the role: cloudformation:RoleArn; approved templates: TemplateUrl.
10

Core quiz

Check the basics first. Pick an answer, then press Check.

11

Hard quiz

Harder than most real exam questions on purpose, with one “choose two” and one matching question. Aim for 9 out of 12 before Day 3.

12

Practice test questions (from your mock exams)

Five questions about baselines across accounts, tags and Service Catalog. These questions come from your own mock exams in the practice tests folder, matched to this lecture. Each one was checked against current AWS behavior, so some wording and answers are updated; the source is shown at the end of each explanation.

13

Hands-on lab (30 minutes, low cost)

  1. On your laptop, install the tools (pip install cfn-lint, and cfn-guard from its GitHub releases). Write a small template with one S3 bucket and a typo in a property name. Run cfn-lint and read the error. Fix it, then write the s3.guard rule from section 2 and run cfn-guard validate until it passes. This step is free.
  2. In one account, create the two self-managed StackSet roles (AWS provides sample templates for AWSCloudFormationStackSetAdministrationRole and AWSCloudFormationStackSetExecutionRole). Create a StackSet with your bucket template and deploy it to your own account in two Regions.
  3. In the S3 console, change the bucket’s tags or versioning by hand. Run Detect drift on the StackSet and find the MODIFIED resource and the property difference.
  4. If you have a test organization: create a tag policy for CostCenter, attach it to a test account, and view compliance in Resource Groups > Tag policies. Try launching a t3.micro with and without the tag after attaching the SCP from section 3, then terminate it at once.
  5. In AWS RAM, create a resource share for a managed prefix list (free) and look at the managed permission it uses. Delete the share.
  6. Clean up: delete the stack instances, then the StackSet; empty and delete the buckets; detach and delete the SCP and tag policy; delete the prefix list. Don’t create a Firewall Manager policy in a personal account just to try it: you pay per policy per Region, plus AWS Config recording in every account in scope.