

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Lakukan pemrosesan kustom pada CloudFormation template dengan makro template
<a name="template-macros"></a>

Dengan makro, Anda dapat melakukan pemrosesan khusus pada templat, dari tindakan sederhana seperti find-and-replace operasi hingga transformasi ekstensif seluruh templat.

Untuk mendapatkan gambaran tentang luasnya kemungkinan, pertimbangkan `AWS::Include` dan `AWS::Serverless` transformasi, yang merupakan makro yang dihosting oleh: CloudFormation
+ [AWS::Includetransform](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/transform-aws-include.html) memungkinkan Anda untuk memasukkan cuplikan template boilerplate ke dalam template Anda.
+ [AWS::Serverlesstransform](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/transform-aws-serverless.html) mengambil seluruh template yang ditulis dalam sintaks AWS Serverless Application Model (AWS SAM) dan mengubah dan memperluasnya menjadi template yang sesuai. CloudFormation Untuk informasi selengkapnya tentang aplikasi tanpa server dan AWS SAM, lihat Panduan [AWS Serverless Application Model Pengembang](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html).

**Topics**
+ [Penagihan](#template-macros-billing)
+ [Contoh makro](#template-macros-examples-list)
+ [Sumber daya terkait](#template-macros-related-resources)
+ [Ikhtisar CloudFormation makro](template-macros-overview.md)
+ [Buat definisi CloudFormation makro](template-macros-author.md)
+ [Contoh makro pengganti string sederhana](macros-example.md)
+ [Memecahkan masalah template yang diproses](template-macros-troubleshoot-processed-template.md)

## Penagihan
<a name="template-macros-billing"></a>

Saat makro berjalan, pemilik fungsi Lambda ditagih untuk biaya apa pun yang terkait dengan eksekusi fungsi tersebut.

`AWS::Include`Dan `AWS::Serverless` transformasi adalah makro yang dihosting oleh. CloudFormation Tidak ada biaya untuk menggunakannya.

## Contoh makro
<a name="template-macros-examples-list"></a>

Selain contoh di bagian ini, Anda dapat menemukan contoh makro, termasuk kode sumber dan templat, di [GitHub repositori](https://github.com/aws-cloudformation/aws-cloudformation-templates/tree/main/CloudFormation/MacrosExamples) kami. Contoh-contoh ini disediakan 'sebagaimana adanya' untuk tujuan instruksional.

## Sumber daya terkait
<a name="template-macros-related-resources"></a>
+ [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudformation-macro.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudformation-macro.html)
+ [CloudFormation Transformbagian template](transform-section-structure.md)
+ [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-transform.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-transform.html)
+ [AWS::Serverlessmengubah](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/transform-aws-serverless.html)
+ [AWS::Includemengubah](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/transform-aws-include.html)