ladderlore
请求新指南
  • 输入服务名称,例如 S3 或 IAM。

概念 · 基于 SAA-C03

IaC for ML: CloudFormation, CDK and Service Catalog

Build SageMaker AI and Bedrock resources from templates, and connect stacks to workflows.

本课尚未翻译,暂以英文显示。

你在Solutions Architect Associate中已学过

  • CloudFormation builds resources from a template as a stack, with change sets and drift detection.
  • Nested stacks reuse parts, and StackSets deploy to many accounts and Regions.
阅读Solutions Architect Associate课程
  • CloudFormation resources

    Its job
    Declare ML resources
    Example
    Model, EndpointConfig, Endpoint, Agent
  • Parameters and exports

    Its job
    Pass values between stacks
    Example
    Fn::ImportValue of the endpoint name
  • Nested stacks

    Its job
    Reuse a block in many stacks
    Example
    One VPC stack for all ML stacks
  • AWS CDK

    Its job
    Write stacks in code
    Example
    A construct for an endpoint
  • Service Catalog

    Its job
    Self-service approved products
    Example
    SageMaker Projects templates
Five pieces of infrastructure as code for ML.

1 / 2

  • CloudFormation resources

    Its job
    Declare ML resources
    Example
    Model, EndpointConfig, Endpoint, Agent
  • Parameters and exports

    Its job
    Pass values between stacks
    Example
    Fn::ImportValue of the endpoint name
  • Nested stacks

    Its job
    Reuse a block in many stacks
    Example
    One VPC stack for all ML stacks

2 / 2

  • AWS CDK

    Its job
    Write stacks in code
    Example
    A construct for an endpoint
  • Service Catalog

    Its job
    Self-service approved products
    Example
    SageMaker Projects templates
Five pieces of infrastructure as code for ML.
CloudFormation stack
SageMaker AI and Bedrock resources
EventBridge rule
Step Functions
  1. 1The stack creates the ML resources.
  2. 2A stack status change event goes to EventBridge.
  3. 3A rule starts Step Functions to run tests or the next stack.
A stack finishing can start the next step of a workflow.

是什么

CloudFormation has resource types for ML. SageMaker AI: Model, EndpointConfig, Endpoint, Pipeline and ModelPackageGroup. Bedrock: Agent, KnowledgeBase, DataSource, Guardrail, Prompt and Flow. A stack that creates a model, a config and an endpoint is the declarative version of the three create calls. Not everything is covered. Bedrock Custom Model Import, for example, is not supported by CloudFormation.

是什么

Stacks talk to each other in three ways. A parameter passes in a value at deploy time, including a value read from Systems Manager Parameter Store. An export in the Outputs section can be read by another stack with Fn::ImportValue, which also stops the export from being deleted while it is in use. A nested stack is a stack created by another stack, which is how you reuse a network or a role block. The AWS Cloud Development Kit (AWS CDK) lets you write the same thing in code with constructs. Some SageMaker AI and Bedrock constructs are still low-level (L1) or in alpha modules.

是什么

SageMaker Projects use AWS Service Catalog. An administrator publishes a product, often a CloudFormation template, and a data scientist launches it to get a repository, a build, a pipeline and a registry. CloudFormation stack status changes are sent to Amazon EventBridge, so a rule can start AWS Step Functions or Lambda when a stack finishes, for tests or the next stack.

要记住

  • Resource types: AWS::SageMaker::Model, EndpointConfig, Endpoint, Pipeline. AWS::Bedrock::Agent, KnowledgeBase, Guardrail, Prompt, Flow.
  • Cross-stack: parameters, and Outputs exports read with Fn::ImportValue.
  • Nested stacks reuse building blocks. CDK expresses the same stacks in code.

要记住

  • Service Catalog products are the templates behind SageMaker Projects.
  • Stack status changes go to EventBridge, which can start Step Functions.
  • Some features, such as Custom Model Import, have no CloudFormation support.

考试中

  • “Data scientists launch an approved MLOps template themselves” points to Service Catalog, as used by SageMaker Projects.
  • “A second stack needs the endpoint name from the first stack” points to an Outputs export and Fn::ImportValue.
  • “Run tests automatically when a stack finishes” points to a CloudFormation event rule in EventBridge that starts Step Functions.