{"action":"created","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/427","repository_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/427/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/427/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/427/events","html_url":"https://github.com/terraform-providers/terraform-provider-aws/issues/427","id":235662563,"node_id":"MDU6SXNzdWUyMzU2NjI1NjM=","number":427,"title":"intermittent issue with aws_appautoscaling_target and aws_appautoscaling_policy creation","user":{"login":"hashibot","id":26720499,"node_id":"MDQ6VXNlcjI2NzIwNDk5","avatar_url":"https://avatars1.githubusercontent.com/u/26720499?v=4","gravatar_id":"","url":"https://api.github.com/users/hashibot","html_url":"https://github.com/hashibot","followers_url":"https://api.github.com/users/hashibot/followers","following_url":"https://api.github.com/users/hashibot/following{/other_user}","gists_url":"https://api.github.com/users/hashibot/gists{/gist_id}","starred_url":"https://api.github.com/users/hashibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashibot/subscriptions","organizations_url":"https://api.github.com/users/hashibot/orgs","repos_url":"https://api.github.com/users/hashibot/repos","events_url":"https://api.github.com/users/hashibot/events{/privacy}","received_events_url":"https://api.github.com/users/hashibot/received_events","type":"User","site_admin":false},"labels":[{"id":620316239,"node_id":"MDU6TGFiZWw2MjAzMTYyMzk=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":801360214,"node_id":"MDU6TGFiZWw4MDEzNjAyMTQ=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/service/applicationautoscaling","name":"service/applicationautoscaling","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-06-13T19:20:40Z","updated_at":"2018-09-07T20:36:29Z","closed_at":null,"author_association":"NONE","body":"_This issue was originally opened by @brikis98 as hashicorp/terraform#10737. It was migrated here as part of the [provider split](https://www.hashicorp.com/blog/upcoming-provider-changes-in-terraform-0-10/). The original body of the issue is below._\r\n\r\n<hr>\r\n\r\n### Terraform Version\r\n\r\nTerraform v0.7.7\r\n\r\n### Affected Resource(s)\r\n\r\n- aws_appautoscaling_target\r\n- aws_appautoscaling_policy\r\n\r\n### Terraform Configuration Files\r\n\r\n```hcl\r\nresource \"aws_appautoscaling_target\" \"target\" {\r\n  name = \"MyService\"\r\n  resource_id = \"service/MyCluster/MyService\"\r\n  role_arn = \"${aws_iam_role.role.arn}\"\r\n  min_capacity = 1\r\n  max_capacity = 10\r\n}\r\n\r\nresource \"aws_appautoscaling_policy\" \"scale_out\" {\r\n  name = \"MyServiceScaleOut\"\r\n  resource_id = \"service/MyCluster/MyService\"\r\n\r\n  adjustment_type = \"ChangeInCapacity\"\r\n  cooldown = 60\r\n  metric_aggregation_type = \"Average\"\r\n\r\n  step_adjustment {\r\n    metric_interval_lower_bound = 0\r\n    scaling_adjustment = 1\r\n  }\r\n\r\n  depends_on = [\"aws_appautoscaling_target.target\"]\r\n}\r\n```\r\n\r\n### Expected Behavior\r\n\r\nThe auto scaling policy and target are both created successfully.\r\n\r\n### Actual Behavior\r\n\r\nIntermittently, you get an error like this:\r\n\r\n```\r\nError putting scaling policy: ObjectNotFoundException: No scalable target registered for service namespace: ecs (... sorry, I forgot to copy/paste the rest of the error ...)\r\n```\r\n\r\nIf you re-run `terraform apply`, the error usually goes away.\r\n\r\n### Steps to Reproduce\r\n\r\n1. `terraform apply`\r\n\r\n### Important Factoids\r\n\r\nIf you re-run `terraform apply`, sometimes multiple times, it works. I suspect this is a classic issue with the fact that AWS is asynchronous and eventually consistent and Terraform is not properly waiting for the `aws_appautoscaling_target` resource to be created."},"comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/comments/419558713","html_url":"https://github.com/terraform-providers/terraform-provider-aws/issues/427#issuecomment-419558713","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/427","id":419558713,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTU1ODcxMw==","user":{"login":"indranil272","id":5429187,"node_id":"MDQ6VXNlcjU0MjkxODc=","avatar_url":"https://avatars3.githubusercontent.com/u/5429187?v=4","gravatar_id":"","url":"https://api.github.com/users/indranil272","html_url":"https://github.com/indranil272","followers_url":"https://api.github.com/users/indranil272/followers","following_url":"https://api.github.com/users/indranil272/following{/other_user}","gists_url":"https://api.github.com/users/indranil272/gists{/gist_id}","starred_url":"https://api.github.com/users/indranil272/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indranil272/subscriptions","organizations_url":"https://api.github.com/users/indranil272/orgs","repos_url":"https://api.github.com/users/indranil272/repos","events_url":"https://api.github.com/users/indranil272/events{/privacy}","received_events_url":"https://api.github.com/users/indranil272/received_events","type":"User","site_admin":false},"created_at":"2018-09-07T20:36:29Z","updated_at":"2018-09-07T20:36:29Z","author_association":"NONE","body":"I'm running into this issue with Terraform version v.0.11.0"}}
{"actor":{"display_login":"indranil272"}}