AWS Service Catalog

A vending machine for infrastructure. Admins curate CloudFormation templates as products, group them into portfolios, and hand teams a self-service portal. Users click "launch", get something compliant and tagged — without ever needing the IAM permissions to build it themselves.

Một cái máy bán hàng tự động cho hạ tầng. Admin tuyển chọn template CloudFormation thành product, gom vào portfolio, rồi trao cho team một portal self-service. User bấm "launch", nhận về thứ đúng chuẩn và có tag — mà không cần quyền IAM để tự dựng.

Reach for it / not the right toolKhi nào dùng / khi nào không

Reach for Service CatalogChọn Service Catalog

  • Developers / analysts need to provision their own environments but shouldn't hold the IAM permissions to do it freehand.Dev / analyst cần tự tạo môi trường nhưng không nên có quyền IAM để làm tuỳ ý.
  • Every provisioned resource must be tagged, compliant and identical across teams — governance is the requirement.Mọi tài nguyên tạo ra phải có tag, tuân thủ và giống nhau giữa các team — yêu cầu là governance.
  • You want to expose AWS through ServiceNow / Jira Service Management rather than the AWS console.Muốn mở AWS qua ServiceNow / Jira Service Management thay vì console AWS.
  • A large org where one central team owns the templates and many accounts consume them.Tổ chức lớn, một team trung tâm sở hữu template và nhiều account tiêu thụ.

Not the right toolKhông phải chỗ dùng

  • Engineers who write their own templates — that's just CloudFormation / CDK. Service Catalog adds a portal they don't need.Kỹ sư tự viết template — chỉ cần CloudFormation / CDK. Service Catalog thêm một portal họ không cần.
  • Detecting non-compliant resources that already exist → AWS Config. Service Catalog prevents at launch, it doesn't audit.Phát hiện tài nguyên đã tồn tại mà không tuân thủ → AWS Config. Service Catalog chặn lúc launch, không audit.
  • Blocking API actions account-wide → SCPs in Organizations. Service Catalog only governs what goes through it.Chặn API action toàn account → SCP trong Organizations. Service Catalog chỉ quản cái đi qua nó.
  • Deploying application code onto existing compute → CodeDeploy.Deploy code ứng dụng lên compute có sẵn → CodeDeploy.

The whole service in one diagramToàn bộ service trong một sơ đồ

Two halves that never overlap. Admins author products, group them into portfolios, and attach constraints + IAM. Users see a filtered product list and click launch. Hai nửa không chồng lên nhau. Admin viết product, gom vào portfolio, gắn constraint + IAM. User thấy danh sách product đã lọc và bấm launch.

Admin tasks: author a product from a CloudFormation template, group products into a portfolio, and control access with IAM and constraints. User tasks: browse the authorized product list and launch it, producing a provisioned product that is ready to use, properly configured and properly tagged. ADMIN TASKS Product a CFN template Portfolio a set of products Control IAM · constraints TagOptions USER TASKS Product list only what IAM allows you to see launch Provisioned product ready to use properly configured properly tagged = a CloudFormation stack

Every provisioned product is literally a CloudFormation stack owned by Service Catalog. Delete the provisioned product → the stack is deleted. That's where DeletionPolicy still applies.

Mỗi provisioned product thực chất là một CloudFormation stack do Service Catalog sở hữu. Xoá provisioned product → stack bị xoá. Đó là chỗ DeletionPolicy vẫn có tác dụng.

The launch constraint — the whole pointLaunch constraint — điểm mấu chốt

Without a launch constraint, the end user's own permissions are used to build the stack — so they'd need ec2:*, rds:*, iam:PassRole… which defeats the purpose. With one, Service Catalog assumes a role and the user needs nothing but permission to launch the product. Không có launch constraint, stack được dựng bằng quyền của chính end user — nghĩa là họ cần ec2:*, rds:*, iam:PassRole… đi ngược mục đích. Có nó, Service Catalog assume một role và user chỉ cần quyền launch product.

Without a launch constraint the end user's own IAM permissions build the stack, so they need broad access. With a launch constraint, Service Catalog assumes a launch role that holds the broad permissions, and the user only needs servicecatalog permissions. NO launch constraint End user needs ec2:* rds:* Service Catalog CloudFormation user's creds ⚠ user is now over-privileged WITH launch constraint End user servicecatalog only Service Catalog Launch role holds ec2:* rds:* assumes CloudFormation role's creds

The launch role needs permissions for every resource in the template plus cloudformation:* and read access to the template in S3. Exam phrasing: "users must launch RDS without having RDS permissions" → launch constraint.

Launch role cần quyền cho mọi resource trong template cộng thêm cloudformation:* và quyền đọc template trong S3. Câu hỏi hay gặp: "user phải launch RDS mà không có quyền RDS" → launch constraint.

The five constraintsNăm loại constraint

Constraints are attached to a product-within-a-portfolio, so the same product can behave differently for different teams. Constraint gắn vào product trong một portfolio, nên cùng một product có thể hành xử khác nhau với từng team.

ConstraintConstraint What it doesLàm gì
Launch The IAM role Service Catalog assumes to provision. Decouples user permissions from resource permissions.IAM role Service Catalog assume để provision. Tách quyền user khỏi quyền resource.
Template Restrict allowed parameter values — e.g. instance type only t3.micro/t3.small, or only two AZs. Written as JSON rules.Giới hạn giá trị parameter — vd instance type chỉ t3.micro/t3.small, hoặc chỉ hai AZ. Viết bằng rule JSON.
Notification Send stack events to an SNS topic — who launched what, and whether it failed.Gửi stack event tới một SNS topic — ai launch gì, thành công hay lỗi.
Stack Set Launching the product deploys via StackSets to multiple accounts/regions instead of one stack locally.Launch product sẽ deploy qua StackSets tới nhiều account/region thay vì một stack cục bộ.
Tag update Allow (or forbid) users to change tags on an already-provisioned product.Cho phép (hoặc cấm) user sửa tag trên product đã provision.
TagOptionsTagOptions Separate from constraints: a TagOption library defines allowed key/value pairs (CostCenter = 1234 | 5678) and attaches them to portfolios or products. At launch the user must pick from the list — so cost allocation tags are always present and always spelled right. Tách khỏi constraint: thư viện TagOption định nghĩa cặp key/value hợp lệ (CostCenter = 1234 | 5678) rồi gắn vào portfolio hoặc product. Lúc launch user phải chọn từ danh sách — nên tag phân bổ chi phí luôn có và luôn đúng chính tả.

Sharing portfolios across accountsChia sẻ portfolio giữa các account

Account-to-accountAccount tới account share to a specific account ID; the recipient imports the portfolioshare tới một account ID cụ thể; bên nhận import portfolio
OrganizationsOrganizations share to the whole org, an OU, or an account — no per-account invitation neededshare tới cả org, một OU hoặc một account — không cần mời từng account
Stays in syncLuôn đồng bộ update the source portfolio → imported copies see the new product versionsupdate portfolio gốc → bản import thấy version product mới
The one that bitesCái dễ dính Constraints and IAM don't travel. The recipient account gets the products, but launch constraints must be re-created locally (the launch role lives in the recipient account) and the recipient's own admin grants access to their users. Sharing ≠ delegating permissions. Constraint và IAM không đi theo. Account nhận có product, nhưng launch constraint phải tạo lại tại chỗ (launch role nằm ở account nhận) và admin bên đó tự cấp quyền cho user của mình. Share ≠ uỷ quyền.

Versions & the day-2 storyVersion & chuyện ngày thứ hai

  • A product has versions (v1, v2 …), each backed by a template. Admins publish a new version; users see it as an available update on their provisioned product. Product có version (v1, v2 …), mỗi version gắn với một template. Admin publish version mới; user thấy nó là bản update khả dụng cho provisioned product của mình.
  • "Update provisioned product" runs a CloudFormation stack update underneath — same replacement rules, same risk of resource replacement. "Update provisioned product" chạy một CloudFormation stack update bên dưới — cùng luật replacement, cùng rủi ro resource bị tạo lại.
  • Products can be External type — a Terraform configuration (open source or Terraform Cloud) instead of a CFN template, if the org standardised on Terraform. Product có thể là External type — một cấu hình Terraform (open source hoặc Terraform Cloud) thay vì template CFN, nếu tổ chức chuẩn hoá theo Terraform.
  • Control Tower Account Factory is itself a Service Catalog product — that's how "vend a new account" appears as a launchable item. Control Tower Account Factory bản thân là một Service Catalog product — nên "tạo account mới" mới xuất hiện như một mục có thể launch.

Exam reflexesPhản xạ khi thi

The question says…Đề nói… AnswerTrả lời
"Developers must launch approved stacks without broad IAM permissions""Dev phải launch stack đã duyệt mà không có quyền IAM rộng" Service Catalog + launch constraintService Catalog + launch constraint
"Restrict which instance types can be chosen""Giới hạn instance type được chọn" Template constraint (not an SCP, not an IAM condition)Template constraint (không phải SCP, không phải IAM condition)
"Every launched resource must carry a CostCenter tag""Mọi resource launch ra phải có tag CostCenter" TagOptions library on the portfolioThư viện TagOptions trên portfolio
"Same catalog for hundreds of accounts, centrally maintained""Cùng catalog cho hàng trăm account, quản lý tập trung" Share the portfolio via AWS OrganizationsShare portfolio qua AWS Organizations
"Users request infrastructure from ServiceNow""User yêu cầu hạ tầng từ ServiceNow" Service Catalog connector for ServiceNow / Jira SMConnector ServiceNow / Jira SM của Service Catalog
"Notify a security team whenever a product is launched""Báo team bảo mật mỗi khi có product được launch" Notification constraint → SNSNotification constraint → SNS