AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::CloudFormation::Macro

CfnMacro

The `AWS::CloudFormation::Macro` resource is a CloudFormation resource type that creates a CloudFormation macro to perform custom processing on CloudFormation templates. For more information, see [Perform custom processing on CloudFormation templates with template macros](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html) in the *CloudFormation User Guide* .

Import

import { CfnMacro } from 'aws-cdk-lib/aws-cloudformation';

Or use the module namespace:

import * as cloudformation from 'aws-cdk-lib/aws-cloudformation';
// cloudformation.CfnMacro

Properties

Configuration passed to the constructor as CfnMacroProps.

functionNameRequired
string

The Amazon Resource Name (ARN) of the underlying Lambda function that you want CloudFormation to invoke when the macro is run.

nameRequired
string

The name of the macro. The name of the macro must be unique across all macros in the account.

descriptionOptional
string

A description of the macro.

logGroupNameOptional
string

The CloudWatch Logs group to which CloudFormation sends error logging information when invoking the macro's underlying Lambda function. This will be an existing CloudWatch Logs LogGroup. Neither CloudFormation or Lambda will create the group.

logRoleArnOptional
string

The ARN of the role CloudFormation should assume when sending log entries to CloudWatch Logs .

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter