lumigo-io / SAR-cloudwatch-alarms-macro

CloudFormation macro for auto-generating CloudWatch alarms based on your configuration
Apache License 2.0
30 stars 6 forks source link

Macro function does not get invoked #11

Open MatteoInfi opened 4 years ago

MatteoInfi commented 4 years ago

Upon deploying my template the macro function does not get invoked and it cannot create the alarms. Do I need to add any extra permission?

Step to reproduce:

  1. create SSM parameter for default configuration
  2. Add resource snippet to my SAM template
  SARCloudwatchAlarmsLayer:
    Type: AWS::Serverless::Application
    Condition: IsProduction
    Properties:
      Location:
        ApplicationId: arn:aws:serverlessrepo:us-east-1:374852340823:applications/cloudwatch-alarms-macro
        SemanticVersion: 1.0.3
      Parameters:
        DefaultConfigParamName:<my param name>
  1. Deploy my template

The deployment is successful and the nested stack with the SAR layer is created, however the S3 bucket contains no templates for the alarms NestedStackLambdaAlarms etc... The TransformLambdaFunction has been created, however there is no sign of its invocation.

Any help?

Thanks

MatteoInfi commented 4 years ago

You should have specified in the docs that the macro should be added into the template and as well it should be added after serverless, because the macro get the cloudformation resourceIds not the serverless one

Transform: [ "AWS::Serverless-2016-10-31", AddCloudWatchAlarms ]

I will leave it open I think it should be specified in the docs, some macro newbie like me could easily get lost :D