Open samuelcortinhas opened 1 year ago
Voting for Prioritization
Volunteering to Work on This Issue
I have also experienced this issue. The first "aws_appautoscaling_scheduled_action" is created but the second does not get created. In my case I was creating a scheduled target with "ecs" as the service.
Maybe changing the names of the first and second scheduled_action differently could solve the problem.
Same issue here for ECS target. Even though the second action depends on the first I get the error
Error: Error creating application autoscaling target: ConcurrentUpdateException: You already have a pending update to an Auto Scaling resource
Maybe changing the names of the first and second scheduled_action differently could solve the problem.
This is the solution, thank you! Perhaps the provider can have some logic here which stops you from doing this?
Maybe changing the names of the first and second scheduled_action differently could solve the problem.
This solved it for me as well - whilst I probably should have given them different names anyway, the provider allowing you to give multiple actions the same name and not error and instead basically overwrite the same action in AWS feels like it violates the principle of least surprise.
Terraform Core Version
1.4.2
AWS Provider Version
5.10.0
Affected Resource(s)
aws_appautoscaling_scheduled_action
Expected Behavior
Update the write capacity of a dynamoDB table in an alternating pattern of scaling in, then scaling out and repeating. The write capacity should update every 15 minutes. (Use case: warm start a table)
Actual Behavior
The resources are successfully deployed. However, only one scheduled action is ever being applied. (E.g. scale out is happening every 30 minutes but scale in never happens.)
This seems to be a concurrency problem. The second scheduled action does not start until the first one ends, but the first one has been configured to never end (the cron job has no end date). Ideally, they should both be able to run at the same time so they can both make changes when they are scheduled too.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Run apply on the provided Terraform configuration.
Debug Output
No response
Panic Output
No response
Important Factoids
The resource works when only one is used on a target. The problem seems to arise when multiple instances are used on the same target.
References
No response
Would you like to implement a fix?
None