binxio / cfn-mysql-user-provider

A CloudFormation custom provider for managing MySQL users
Apache License 2.0
22 stars 19 forks source link

Fix 'Response object is too long.' in case of CloudFormation error #1

Closed roni-frantchi closed 5 years ago

roni-frantchi commented 5 years ago

Seems like an issue similar to its Postgres counterpart. I was assuming the root cause and fix would also be similar.

However, trying to test this PR out I can't seem to pull the right version still when redeploying... I guess I must be missing something. Placing this PR here hoping to get some help @mvanholsteijn :)

mvanholsteijn commented 5 years ago

Hi @roni-frantchi, Thank you for your PR; I updated the mysql provider to cfn-resource-provider 1.0.1 instead, and released version 0.2.1 of the mysql custom provider.

I hope you will get a better error message now.

Cheers,

Mark

mvanholsteijn commented 5 years ago

please let me know if it allowed you to resolve your error.

roni-frantchi commented 5 years ago

Thanks @mvanholsteijn . Much appreciated! I'm seeing the release - I'll download it and report back on how it looks. That being said it doesn't look like your change was committed\merged master, and the readme guides to checkout from master rather than download a release.

roni-frantchi commented 5 years ago

@mvanholsteijn tested with the new package, deployment of my custom resource fails on Invalid PhysicalResourceId..

roni-frantchi commented 5 years ago

Here's what I could dig up from setting the logs to debug level:

[DEBUG] 2019-04-07T12:37:14.834Z    x-61ce-4xxxxx90d-94d2-e0ffe4a21ade  sending response to https://cloudformation-custom-resource-response-useast1.s3.amazonaws.com/arn%3Aaws%3Acloudformation%3Aus-east-1%3A454979296143%3Astack/xxxxxxxxx/c70d2db0-xxxxx-11e9-8647-0a933e7926f6%7CEnvironmentUser%7C859d6d12-a437-xxxxx-81d2-2471e0ce7e25?AWSAccessKeyId=Axxxxxxxxxxxxx&Expires=155x32&Sxignature=xxxxxxxxx%2FF%2FxDM%3D ->
{
    "Status": "FAILED",
    "Reason": "invalid resource properties: {'ServiceToken': 'arn:aws:lambda:us-east-1:xxxxxxxx:function:binxio-cfn-mysql-user-provider-vpc-xxxxx', 'DeletionPolicy': 'Retain', 'WithDatabase': True, 'Database': {'User': 'xxxxxx', 'Port': 3306, 'Database': 'xxxx', 'Host': 'xxxxxxxx.us-east-1.rds.amazonaws.com', 'Password': 'xxxxxxx'}, 'Name': 'user', 'Password': 'xxxxxxxx'} is not valid under any of the given schemas",
    "StackId": "arn:aws:cloudformation:us-east-1:454979296143:stack/xxxxxxxxxxx/c70d2db0-5931-11e9-8647-0a933e7926f6",
    "RequestId": "859d6d12-a437-xxxx-81d2-2471e0ce7e25",
    "LogicalResourceId": "Environmentxxxxx",
    "Data": {}
}

Not sure Why I'm getting invalid resource properties... The resource properties seem to match the documentation

roni-frantchi commented 5 years ago

@mvanholsteijn looks like the readme is not out of sync with the schema definition. For instance, Name is actually User in the schema, and under Database, showing Name instead of DBName like in the schema.

Once I've changed these, the custom resource deployed successfully! Thanks for creating it!

mvanholsteijn commented 5 years ago

Oops. fixed that.. thank you!