Skip to content
v2.277.0

CfnMacroProps Struct ​

Properties for defining a CfnMacro.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const cfnMacroProps: cdk.CfnMacroProps = {
  functionName: 'functionName',
  name: 'name',

  // the properties below are optional
  description: 'description',
  logGroupName: 'logGroupName',
  logRoleArn: 'logRoleArn',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

cfn_macro_props = cdk.CfnMacroProps(
    function_name="functionName",
    name="name",

    # the properties below are optional
    description="description",
    log_group_name="logGroupName",
    log_role_arn="logRoleArn"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

CfnMacroProps cfnMacroProps = CfnMacroProps.builder()
        .functionName("functionName")
        .name("name")

        // the properties below are optional
        .description("description")
        .logGroupName("logGroupName")
        .logRoleArn("logRoleArn")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;

var cfnMacroProps = new CfnMacroProps {
    FunctionName = "functionName",
    Name = "name",

    // the properties below are optional
    Description = "description",
    LogGroupName = "logGroupName",
    LogRoleArn = "logRoleArn"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"

cfnMacroProps := &CfnMacroProps{
	FunctionName: jsii.String("functionName"),
	Name: jsii.String("name"),

	// the properties below are optional
	Description: jsii.String("description"),
	LogGroupName: jsii.String("logGroupName"),
	LogRoleArn: jsii.String("logRoleArn"),
}

Properties ​

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
A description of the macro.
functionNamestringfunction_namestrfunctionNameStringFunctionNamestringFunctionName*stringrequired#
The Amazon Resource Name (ARN) of the underlying Lambda function that you want CloudFormation to invoke when the macro is run.
logGroupNameoptionalstringlog_group_nameoptionalstrlogGroupNameoptionalStringLogGroupNameoptionalstringLogGroupNameoptional*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.

logRoleArnoptionalstringlog_role_arnoptionalstrlogRoleArnoptionalStringLogRoleArnoptionalstringLogRoleArnoptional*string#
The ARN of the role CloudFormation should assume when sending log entries to CloudWatch Logs .
namestringnamestrnameStringNamestringName*stringrequired#
The name of the macro.

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