Skip to content

This AWS::Cognito::LogDeliveryConfiguration resource is in a CREATE_FAILED state because of a regex mismatch?

0

This AWS::Cognito::LogDeliveryConfiguration resource is in a CREATE_FAILED state.

Resource handler returned message: "1 validation error detected: Value 'arn:aws:logs:us-east-1:000000000000:log-group:auth/staging/cognito:' at 'logConfigurations.1.member.cloudWatchLogsConfiguration.logGroupArn' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:[\w+=/,.@-]+:[\w+=/,.@-]+:([\w+=/,.@-])?:[0-9]+:[\w+=/,.@-]+(:[\w+=/,.@-]+)?(:[\w+=/,.@-]+)? (Service: CognitoIdentityProvider, Status Code: 400, Request ID: ---)" (RequestToken: ---, HandlerErrorCode: InvalidRequest)

/arn:[\w+=/,.@-]+:[\w+=/,.@-]+:([\w+=/,.@-]*)?:[0-9]+:[\w+=/,.@-]+(:[\w+=/,.@-]+)?(:[\w+=/,.@-]+)?/.test('arn:aws:logs:us-east-1:000000000000:log-group:auth/staging/cognito:*')
true
  AuthLogDeliveryConfiguration:
    Type: AWS::Cognito::LogDeliveryConfiguration
    Properties:
      UserPoolId: !Ref AuthUserPool
      LogConfigurations:
        - EventSource: userNotification
          LogLevel: ERROR
          CloudWatchLogsConfiguration:
            LogGroupArn: !GetAtt AuthLogs.Arn
1 Answer
1
Accepted Answer

Hello.

I have also experienced the same error in the past.
Try the following as in the answer at the URL below:
In my case this solved the problem.
The problem is the asterisk at the end of the log group ARN, so I think you can deploy it if you remove it.
https://repost.aws/questions/QUhjYRB83zR_Od3frN-PRQww/cloudformation-regex-validation-error-in-cognito-logdeliveryconfiguration-cloudwatchlogsconfiguration-loggrouparn

Yes, I reported this using paid support. I don't necessarily think of it like that, we are all working on something weather that be for our job or passion projects. Update on our issue though, I did get a message back from support try this: !Select [ 0, !Split [ ':*', !GetAtt CognitoLogGroup.Arn ] ] it worked for me. Honestly they should just fix their regex pattern so we can just use !GetAtt

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.