{"action":"created","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/4570","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/4570/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/4570/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/4570/events","html_url":"https://github.com/terraform-providers/terraform-provider-aws/issues/4570","id":324120097,"node_id":"MDU6SXNzdWUzMjQxMjAwOTc=","number":4570,"title":"Error updating Autoscaling group: InvalidQueryParameter: Invalid launch template: When a network interface is provided, the security groups must be a part of it.","user":{"login":"djdevin","id":418136,"node_id":"MDQ6VXNlcjQxODEzNg==","avatar_url":"https://avatars1.githubusercontent.com/u/418136?v=4","gravatar_id":"","url":"https://api.github.com/users/djdevin","html_url":"https://github.com/djdevin","followers_url":"https://api.github.com/users/djdevin/followers","following_url":"https://api.github.com/users/djdevin/following{/other_user}","gists_url":"https://api.github.com/users/djdevin/gists{/gist_id}","starred_url":"https://api.github.com/users/djdevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djdevin/subscriptions","organizations_url":"https://api.github.com/users/djdevin/orgs","repos_url":"https://api.github.com/users/djdevin/repos","events_url":"https://api.github.com/users/djdevin/events{/privacy}","received_events_url":"https://api.github.com/users/djdevin/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":794043766,"node_id":"MDU6TGFiZWw3OTQwNDM3NjY=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/service/ec2","name":"service/ec2","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-05-17T17:40:12Z","updated_at":"2018-11-27T01:55:53Z","closed_at":null,"author_association":"NONE","body":"<!---\r\nPlease note the following potential times when an issue might be in Terraform core:\r\n\r\n* [Configuration Language](https://www.terraform.io/docs/configuration/index.html) or resource ordering issues\r\n* [State](https://www.terraform.io/docs/state/index.html) and [State Backend](https://www.terraform.io/docs/backends/index.html) issues\r\n* [Provisioner](https://www.terraform.io/docs/provisioners/index.html) issues\r\n* [Registry](https://registry.terraform.io/) issues\r\n* Spans resources across multiple providers\r\n\r\nIf you are running into one of these scenarios, we recommend opening an issue in the [Terraform core repository](https://github.com/hashicorp/terraform/) instead.\r\n--->\r\n\r\n<!--- Please keep this note for the community --->\r\n\r\n### Community Note\r\n\r\n* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request\r\n* Please do not leave \"+1\" or \"me too\" comments, they generate extra noise for issue followers and do not help prioritize the request\r\n* If you are interested in working on this issue or have submitted a pull request, please leave a comment\r\n\r\n<!--- Thank you for keeping this note for the community --->\r\n\r\n### Terraform Version\r\n\r\nTerraform v0.11.7\r\n+ provider.aws v1.19.0\r\n\r\n\r\n### Affected Resource(s)\r\naws_autoscaling_group\r\naws_launch_template\r\n\r\n### Terraform Configuration Files\r\n```\r\n# Launch template for nodes.\r\nresource \"aws_launch_template\" \"nodes\" {\r\n  name = \"nodes\"\r\n\r\n  block_device_mappings {\r\n    device_name = \"/dev/sda1\"\r\n\r\n    ebs {\r\n      volume_size = 32\r\n      volume_type = \"gp2\"\r\n    }\r\n  }\r\n\r\n  credit_specification {\r\n    cpu_credits = \"unlimited\"\r\n  }\r\n\r\n  disable_api_termination = true\r\n\r\n  ebs_optimized = true\r\n\r\n  iam_instance_profile {\r\n    name = \"${aws_iam_instance_profile.nodes.id}\"\r\n  }\r\n\r\n  # Currently Fedora 28\r\n  image_id = \"ami-e754e298\"\r\n\r\n  instance_initiated_shutdown_behavior = \"terminate\"\r\n\r\n  instance_type = \"${terraform.env == \"prod\" ? \"t2.xlarge\" : \"t2.large\"}\"\r\n\r\n  key_name = \"ansible\"\r\n\r\n  monitoring {\r\n    enabled = true\r\n  }\r\n\r\n  network_interfaces {\r\n    device_index                = 0\r\n    associate_public_ip_address = true\r\n    security_groups             = [\"${aws_security_group.openshift.id}\"]\r\n  }\r\n\r\n  placement {\r\n    availability_zone = \"us-east-1a\"\r\n  }\r\n\r\n  vpc_security_group_ids = [\"${aws_security_group.openshift.id}\"]\r\n\r\n  tag_specifications {\r\n    tags {\r\n      Name = \"node\"\r\n    }\r\n  }\r\n}\r\n\r\nresource \"aws_autoscaling_group\" \"nodes\" {\r\n  name = \"OpenShift Nodes\"\r\n\r\n  launch_template = {\r\n    id = \"${aws_launch_template.nodes.id}\"\r\n\r\n    version = \"$$Latest\"\r\n  }\r\n\r\n  min_size           = \"${terraform.env == \"prod\" ? \"3\" : \"3\"}\"\r\n  max_size           = \"${terraform.env == \"prod\" ? \"3\" : \"3\"}\"\r\n  force_delete       = 1\r\n  availability_zones = [\"us-east-1a\"]\r\n\r\n  tag {\r\n    key                 = \"Name\"\r\n    value               = \"node\"\r\n    propagate_at_launch = true\r\n  }\r\n}\r\n```\r\n\r\n### Debug Output\r\n\r\n```\r\n\r\n* aws_autoscaling_group.nodes: 1 error(s) occurred:\r\n\r\n* aws_autoscaling_group.nodes: Error updating Autoscaling group: InvalidQueryParameter: Invalid launch template: When a network interface is provided, the security groups must be a part of it.\r\n        status code: 400, request id: 7a98dd3b-59f8-11e8-b39f-cdb9cee0f1ee\r\n```\r\n\r\n### Important Factoids\r\nIt seems like the SGs are getting into the template, but I'm not sure why the ASG is complaining about the LT.\r\n\r\nThis is updating an ASG that previously had an LC.\r\n\r\n### References\r\nhttps://github.com/terraform-providers/terraform-provider-aws/pull/4364"},"comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/comments/441868600","html_url":"https://github.com/terraform-providers/terraform-provider-aws/issues/4570#issuecomment-441868600","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/4570","id":441868600,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTg2ODYwMA==","user":{"login":"shapeofarchitect","id":4916214,"node_id":"MDQ6VXNlcjQ5MTYyMTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4916214?v=4","gravatar_id":"","url":"https://api.github.com/users/shapeofarchitect","html_url":"https://github.com/shapeofarchitect","followers_url":"https://api.github.com/users/shapeofarchitect/followers","following_url":"https://api.github.com/users/shapeofarchitect/following{/other_user}","gists_url":"https://api.github.com/users/shapeofarchitect/gists{/gist_id}","starred_url":"https://api.github.com/users/shapeofarchitect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shapeofarchitect/subscriptions","organizations_url":"https://api.github.com/users/shapeofarchitect/orgs","repos_url":"https://api.github.com/users/shapeofarchitect/repos","events_url":"https://api.github.com/users/shapeofarchitect/events{/privacy}","received_events_url":"https://api.github.com/users/shapeofarchitect/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T01:55:53Z","updated_at":"2018-11-27T01:55:53Z","author_association":"NONE","body":"This is indeed the same in my configuration , which is exactly the same as what @Yashiroo mentioned. I have tried multiple approaches. \r\nBelow are some I tried.\r\n- only added security_groups under network_interfaces and it fails with the error.\r\n- Tried only having Only vpc_security_group_ids with security groups ids in list form and it also gives the same error.\r\n\r\nSo I guess it's not fixed yet. I would check net on AWS console to test AWS Launch Template and ASG binding but I suspect it's the AWS API that's causing the failure. I will update after my tests."}}
{"actor":{"display_login":"shapeofarchitect"}}