選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

Develop a module using the CFN-CLI

焦點模式
Develop a module using the CFN-CLI - Extension Development for CloudFormation
此頁面尚未翻譯為您的語言。 請求翻譯

Follow these basic steps to develop and register a module project.

  1. In the CFN-CLI, use the init command to create a new project. The init command creates a fragments folder containing a sample fragment file named sample.json.

    Follow the prompts. Specify that you want to create a module(m), and enter the module name.

    $ cfn init Initializing new project Do you want to develop a new resource(r) a module(m) or a hook(h)? >> m What is the name of your module type? (<Organization>::<Service>::<Name>::MODULE) >> My::Sample::SampleBucket::MODULE
  2. Include your template fragment in the project.

    In the fragments folder in the project, you should find a file named sample.json. This is the template fragment file. Author your template fragment in this file and save.

    You can rename this file as necessary. The folder can only contain a single file.

    For more information, see Creating a module template fragment.

  3. Use validate to validate your project. Fix any issues reported.

    The validate command regenerates the module schema, based on the template fragment you included in the fragments folder. The module schema is located in the root folder, and named schema.json.

  4. Use submit to register the module with CloudFormation, in the specified region. Registering a module makes it available for inclusion in CloudFormation templates.

    Note

    When you register your module using submit, CloudFormation regenerates your module schema based on the template fragment in your project. You can't specify a schema file directly. To specify a module schema file when registering a module, use RegisterType in the CloudFormation API.

For information about using modules in CloudFormation templates, see Using modules in the CloudFormation Users Guide.

隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。