{"action":"created","issue":{"url":"https://api.github.com/repos/sbstjn/serverless-dynamodb-autoscaling/issues/35","repository_url":"https://api.github.com/repos/sbstjn/serverless-dynamodb-autoscaling","labels_url":"https://api.github.com/repos/sbstjn/serverless-dynamodb-autoscaling/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/sbstjn/serverless-dynamodb-autoscaling/issues/35/comments","events_url":"https://api.github.com/repos/sbstjn/serverless-dynamodb-autoscaling/issues/35/events","html_url":"https://github.com/sbstjn/serverless-dynamodb-autoscaling/issues/35","id":277108015,"node_id":"MDU6SXNzdWUyNzcxMDgwMTU=","number":35,"title":"Rate Exceeded error when adding scaling to preexisting stack.","user":{"login":"cdichiara","id":13836864,"node_id":"MDQ6VXNlcjEzODM2ODY0","avatar_url":"https://avatars2.githubusercontent.com/u/13836864?v=4","gravatar_id":"","url":"https://api.github.com/users/cdichiara","html_url":"https://github.com/cdichiara","followers_url":"https://api.github.com/users/cdichiara/followers","following_url":"https://api.github.com/users/cdichiara/following{/other_user}","gists_url":"https://api.github.com/users/cdichiara/gists{/gist_id}","starred_url":"https://api.github.com/users/cdichiara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdichiara/subscriptions","organizations_url":"https://api.github.com/users/cdichiara/orgs","repos_url":"https://api.github.com/users/cdichiara/repos","events_url":"https://api.github.com/users/cdichiara/events{/privacy}","received_events_url":"https://api.github.com/users/cdichiara/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-27T17:44:36Z","updated_at":"2018-06-05T11:35:23Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nNice plugin, by the way ... really appreciate that you made it.\r\n\r\nI think Issue #3 might still be a problem for preexisting stacks where scaling is added:\r\nhttps://forum.serverless.com/t/autoscaling-for-amazon-dynamodb/2071/15?u=cdichiara\r\nI suspect that you don't have prolific enough dependencies to protect against updates to preexisting stacks:\r\n```\r\n          \"irhbackendAutoScalingTargetWriteDatabaseStageRegion\": {\r\n            \"DependsOn\": [\r\n              \"UsersDb\",\r\n              \"irhbackendDynamoDBAutoscaleRoleDatabaseStageRegion\"\r\n            ],\r\n```\r\nThese are logical dependencies ... to protect against rate exceeding I think you're going to want illogical dependencies that serialize the creation of scaling policies and scaling targets, or whatever's adding up to whatever limit it's triggering. So, in other words, something like this:\r\n```\r\n          \"irhbackendAutoScalingTargetWriteDatabaseStageRegion\": {\r\n            \"DependsOn\": [\r\n              \"UsersDb\",\r\n              \"irhbackendDynamoDBAutoscaleRoleDatabaseStageRegion\",\r\n              \"irhbackendAutoScalingTargetWriteLastDatabaseStageRegion\"\r\n            ],\r\n```\r\nIt works for you when you do the initial install because the creations must be serialized by the logical dependencies, somehow.\r\n\r\nI'll try to get around to a possible fix in a pull request, but I can't do it now ... my workaround is basically adding autoscaling to one database at a time, up to now it hasn't triggered the rate issue, but it's ponderous.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/sbstjn/serverless-dynamodb-autoscaling/issues/comments/394676832","html_url":"https://github.com/sbstjn/serverless-dynamodb-autoscaling/issues/35#issuecomment-394676832","issue_url":"https://api.github.com/repos/sbstjn/serverless-dynamodb-autoscaling/issues/35","id":394676832,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDY3NjgzMg==","user":{"login":"bsdkurt","id":4834782,"node_id":"MDQ6VXNlcjQ4MzQ3ODI=","avatar_url":"https://avatars1.githubusercontent.com/u/4834782?v=4","gravatar_id":"","url":"https://api.github.com/users/bsdkurt","html_url":"https://github.com/bsdkurt","followers_url":"https://api.github.com/users/bsdkurt/followers","following_url":"https://api.github.com/users/bsdkurt/following{/other_user}","gists_url":"https://api.github.com/users/bsdkurt/gists{/gist_id}","starred_url":"https://api.github.com/users/bsdkurt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsdkurt/subscriptions","organizations_url":"https://api.github.com/users/bsdkurt/orgs","repos_url":"https://api.github.com/users/bsdkurt/repos","events_url":"https://api.github.com/users/bsdkurt/events{/privacy}","received_events_url":"https://api.github.com/users/bsdkurt/received_events","type":"User","site_admin":false},"created_at":"2018-06-05T11:35:23Z","updated_at":"2018-06-05T11:35:23Z","author_association":"NONE","body":"After manually adding auto-scaling to my existing tables and hitting the rate limit problem, I can confirm the current `DependsOn` implementation in the plugin will not limit the rate properly and will get `Rate exceeded` when adding or changing many `AWS::ApplicationAutoScaling::ScalingPolicy` resources when the tables already exist and may also get it if many `ScalingPolicy` are changed in the same update.\r\n\r\n`DependsOn` is the proper solution, but what it depends on is wrong. In order to eliminate the `Rate exceeded` error in all cases, the `DependsOn` for `AWS::ApplicationAutoScaling::ScalingPolicy` should be the previous `ScalingPolicy` and nothing else. This will serialize additions and changes to the policies when creating or changing them regardless if the tables were previously created or not.\r\n\r\nThis solution is similar to how AWS [explains](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-examples-dependson) that to avoid table related rate limits, place `DependsOn` on your table to depend on the previous table. "}}
{"actor":{"display_login":"bsdkurt"}}