Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_appautoscaling_target: Prevent state removal at creation (…
…#11819) References * #11811 The AWS application-autoscaling service has eventual consistency considerations. The `aws_appautoscaling_target` resource immediately tries to read a scaling target after creation. If the target is not found, the application-autoscaling service returns a 200 OK with an empty list of scaling targets. Since no scaling target is present, the `aws_appautoscaling_target` resource removes the created resource from state, leading to a "produced an unexpected new value for was present, but now absent" error. With the changes in this commit, the empty list of scaling targets in the response for the newly created resource will result in a NotFoundError being returned and a retry of the read request. A subsequent retry should hopefully be successful, leading to the state being preserved. Output from acceptance testing: ``` > make testacc TEST=./aws TESTARGS='-run=TestAccAWSAppautoScalingTarget_' ... --- PASS: TestAccAWSAppautoScalingTarget_multipleTargets (30.77s) --- PASS: TestAccAWSAppautoScalingTarget_optionalRoleArn (32.50s) --- PASS: TestAccAWSAppautoScalingTarget_spotFleetRequest (77.50s) --- PASS: TestAccAWSAppautoScalingTarget_basic (107.66s) --- PASS: TestAccAWSAppautoScalingTarget_emrCluster (783.20s) ```
- Loading branch information