{"action":"created","issue":{"url":"https://api.github.com/repos/azavea/terraform-aws-ecs-cluster/issues/33","repository_url":"https://api.github.com/repos/azavea/terraform-aws-ecs-cluster","labels_url":"https://api.github.com/repos/azavea/terraform-aws-ecs-cluster/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/azavea/terraform-aws-ecs-cluster/issues/33/comments","events_url":"https://api.github.com/repos/azavea/terraform-aws-ecs-cluster/issues/33/events","html_url":"https://github.com/azavea/terraform-aws-ecs-cluster/pull/33","id":332895595,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MjY4MzIy","number":33,"title":"Remove AmazonEC2ContainerServiceAutoscaleRole creation","user":{"login":"rbreslow","id":1774125,"node_id":"MDQ6VXNlcjE3NzQxMjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1774125?v=4","gravatar_id":"","url":"https://api.github.com/users/rbreslow","html_url":"https://github.com/rbreslow","followers_url":"https://api.github.com/users/rbreslow/followers","following_url":"https://api.github.com/users/rbreslow/following{/other_user}","gists_url":"https://api.github.com/users/rbreslow/gists{/gist_id}","starred_url":"https://api.github.com/users/rbreslow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbreslow/subscriptions","organizations_url":"https://api.github.com/users/rbreslow/orgs","repos_url":"https://api.github.com/users/rbreslow/repos","events_url":"https://api.github.com/users/rbreslow/events{/privacy}","received_events_url":"https://api.github.com/users/rbreslow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"rbreslow","id":1774125,"node_id":"MDQ6VXNlcjE3NzQxMjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1774125?v=4","gravatar_id":"","url":"https://api.github.com/users/rbreslow","html_url":"https://github.com/rbreslow","followers_url":"https://api.github.com/users/rbreslow/followers","following_url":"https://api.github.com/users/rbreslow/following{/other_user}","gists_url":"https://api.github.com/users/rbreslow/gists{/gist_id}","starred_url":"https://api.github.com/users/rbreslow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbreslow/subscriptions","organizations_url":"https://api.github.com/users/rbreslow/orgs","repos_url":"https://api.github.com/users/rbreslow/repos","events_url":"https://api.github.com/users/rbreslow/events{/privacy}","received_events_url":"https://api.github.com/users/rbreslow/received_events","type":"User","site_admin":false},"assignees":[{"login":"rbreslow","id":1774125,"node_id":"MDQ6VXNlcjE3NzQxMjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1774125?v=4","gravatar_id":"","url":"https://api.github.com/users/rbreslow","html_url":"https://github.com/rbreslow","followers_url":"https://api.github.com/users/rbreslow/followers","following_url":"https://api.github.com/users/rbreslow/following{/other_user}","gists_url":"https://api.github.com/users/rbreslow/gists{/gist_id}","starred_url":"https://api.github.com/users/rbreslow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbreslow/subscriptions","organizations_url":"https://api.github.com/users/rbreslow/orgs","repos_url":"https://api.github.com/users/rbreslow/repos","events_url":"https://api.github.com/users/rbreslow/events{/privacy}","received_events_url":"https://api.github.com/users/rbreslow/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-06-15T19:52:51Z","updated_at":"2018-06-18T13:33:20Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/azavea/terraform-aws-ecs-cluster/pulls/33","html_url":"https://github.com/azavea/terraform-aws-ecs-cluster/pull/33","diff_url":"https://github.com/azavea/terraform-aws-ecs-cluster/pull/33.diff","patch_url":"https://github.com/azavea/terraform-aws-ecs-cluster/pull/33.patch"},"body":"## Overview\r\n\r\nRepeal Amazon EC2ContainerServiceAutoscaleRole creation and replace with `data` reference to [service-linked](https://docs.aws.amazon.com/autoscaling/application/userguide/application-autoscaling-service-linked-roles.html) IAM role.\r\n\r\nFixes #24 \r\n\r\n## Testing\r\n\r\nI brought up a Django app using [azavea/terraform-aws-ecs-cluster](https://github.com/azavea/terraform-aws-ecs-cluster) and [azavea/terraform-aws-ecs-web-service](https://github.com/azavea/terraform-aws-ecs-web-service).\r\n\r\nRun `terraform plan`:\r\n\r\n```bash\r\nTerraform will perform the following actions:\r\n\r\n-/+ aws_ecs_task_definition.app (new resource required)\r\n      id:                    \"maiden\" => <computed> (forces new resource)\r\n      arn:                   \"arn:aws:ecs:us-east-1:279682201306:task-definition/maiden:56\" => <computed>\r\n      container_definitions: \"[...]\" (forces new resource)\r\n      family:                \"maiden\" => \"maiden\"\r\n      network_mode:          \"\" => <computed>\r\n      revision:              \"56\" => <computed>\r\n\r\n  ~ module.app_web_service.aws_ecs_service.main\r\n      task_definition:       \"maiden:56\" => \"${var.task_definition_id}\"\r\n\r\n\r\nPlan: 1 to add, 1 to change, 1 to destroy.\r\n```\r\n\r\nAWS does not replace `aws_appautoscaling_target.role_arn`.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/azavea/terraform-aws-ecs-cluster/issues/comments/398055254","html_url":"https://github.com/azavea/terraform-aws-ecs-cluster/pull/33#issuecomment-398055254","issue_url":"https://api.github.com/repos/azavea/terraform-aws-ecs-cluster/issues/33","id":398055254,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODA1NTI1NA==","user":{"login":"rbreslow","id":1774125,"node_id":"MDQ6VXNlcjE3NzQxMjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1774125?v=4","gravatar_id":"","url":"https://api.github.com/users/rbreslow","html_url":"https://github.com/rbreslow","followers_url":"https://api.github.com/users/rbreslow/followers","following_url":"https://api.github.com/users/rbreslow/following{/other_user}","gists_url":"https://api.github.com/users/rbreslow/gists{/gist_id}","starred_url":"https://api.github.com/users/rbreslow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbreslow/subscriptions","organizations_url":"https://api.github.com/users/rbreslow/orgs","repos_url":"https://api.github.com/users/rbreslow/repos","events_url":"https://api.github.com/users/rbreslow/events{/privacy}","received_events_url":"https://api.github.com/users/rbreslow/received_events","type":"User","site_admin":false},"created_at":"2018-06-18T13:33:20Z","updated_at":"2018-06-18T13:33:20Z","author_association":"MEMBER","body":"It would make sense that the `data` resource lookup will return nothing. \r\n\r\n>A service-linked role is a unique type of IAM role that is linked directly to an AWS service. Service-linked roles are predefined by the service and include all the permissions that the service requires to call other AWS services on your behalf.\r\n\r\nThis vague piece of AWS documentation makes me want to test to make sure.\r\n\r\nThe only places that `RegisterScalableTarget` and `PutScalingPolicy` are called in the Terraform provider are:\r\n\r\n * https://github.com/terraform-providers/terraform-provider-aws/blob/1d5d36ad2d113f2c520c84980cdfe90e97c9b514/aws/resource_aws_appautoscaling_target.go#L74\r\n * https://github.com/terraform-providers/terraform-provider-aws/blob/c1b986b7c89bf029073b24ed2afb0b40e0ece230/aws/resource_aws_appautoscaling_policy.go#L261\r\n\r\nSince these methods are only invoked in `aws_appautoscaling_target` and `aws_appautoscaling_policy`,  there wouldn't ever be a context in which we'd need that `data` resource lookup.\r\n\r\nI'm not sure what the difference between `aws_autoscaling_policy` and `aws_appautoscaling_policy` is, but `PutScalingPolicy` is also called here:\r\n\r\nhttps://www.terraform.io/docs/providers/aws/r/autoscaling_policy.html\r\n"}}
{"actor":{"display_login":"rbreslow"}}