{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/3154","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/3154/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/3154/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/3154/events","html_url":"https://github.com/hashicorp/terraform/issues/3154","id":104545489,"number":3154,"title":"Error requesting spot instances: InvalidParameterCombination: VPC security groups may not be used for a non-VPC launch","user":{"login":"caarlos0","id":245435,"avatar_url":"https://avatars.githubusercontent.com/u/245435?v=3","gravatar_id":"","url":"https://api.github.com/users/caarlos0","html_url":"https://github.com/caarlos0","followers_url":"https://api.github.com/users/caarlos0/followers","following_url":"https://api.github.com/users/caarlos0/following{/other_user}","gists_url":"https://api.github.com/users/caarlos0/gists{/gist_id}","starred_url":"https://api.github.com/users/caarlos0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caarlos0/subscriptions","organizations_url":"https://api.github.com/users/caarlos0/orgs","repos_url":"https://api.github.com/users/caarlos0/repos","events_url":"https://api.github.com/users/caarlos0/events{/privacy}","received_events_url":"https://api.github.com/users/caarlos0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-02T18:37:10Z","updated_at":"2015-09-08T12:42:07Z","closed_at":null,"body":"I'm trying to launch a spot instance inside a VPC with terraform, but I get this error:\r\n\r\n```\r\n* aws_spot_instance_request.machine: Error requesting spot instances: InvalidParameterCombination: VPC security groups may not be used for a non-VPC launch\r\n\tstatus code: 400, request id: []\r\n```\r\n\r\nMy terraform file is basically this:\r\n\r\n```\r\nprovider \"aws\" {\r\n    access_key = \"${var.access_key}\"\r\n    secret_key = \"${var.secret_key}\"\r\n    region     = \"${var.region}\"\r\n}\r\nresource \"template_file\" \"userdata\" {\r\n    filename = \"${var.userdata}\"\r\n    vars {\r\n        domain = \"${var.domain}\"\r\n        name   = \"${var.name}\"\r\n    }\r\n}\r\nresource \"aws_spot_instance_request\" \"machine\" {\r\n    ami = \"${var.amiPuppet}\"\r\n    key_name = \"${var.key}\"\r\n    instance_type = \"c3.4xlarge\"\r\n    subnet_id = \"${var.subnet}\"\r\n    vpc_security_group_ids = [ \"${var.securityGroup}\" ]\r\n    user_data = \"${template_file.userdata.rendered}\"\r\n    wait_for_fulfillment = true\r\n    spot_price = \"${var.price}\"\r\n    tags {\r\n      Name = \"${var.name}.${var.domain}\"\r\n      Provider = \"Terraform\"\r\n    }\r\n}\r\nresource \"aws_route53_record\" \"machine\" {\r\n    zone_id = \"${var.route53ZoneId}\"\r\n    name = \"${aws_spot_instance_request.machine.tags.Name}\"\r\n    type = \"A\"\r\n    ttl = \"300\"\r\n    records = [\"${aws_spot_instance_request.machine.private_ip}\"]\r\n}\r\n```\r\n\r\n\r\nI don't understand why it isn't working... [docs](https://www.terraform.io/docs/providers/aws/r/spot_instance_request.html) stands that `spot_instance_request` supports all parameters of `aws_instance`, so, I just changed a working `aws_instance` to `spot_instance_request` (with the addition of the price)... am I doing something wrong?\r\n\r\nI'm using Terraform v0.6.3.\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/138548343","html_url":"https://github.com/hashicorp/terraform/issues/3154#issuecomment-138548343","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/3154","id":138548343,"user":{"login":"caarlos0","id":245435,"avatar_url":"https://avatars.githubusercontent.com/u/245435?v=3","gravatar_id":"","url":"https://api.github.com/users/caarlos0","html_url":"https://github.com/caarlos0","followers_url":"https://api.github.com/users/caarlos0/followers","following_url":"https://api.github.com/users/caarlos0/following{/other_user}","gists_url":"https://api.github.com/users/caarlos0/gists{/gist_id}","starred_url":"https://api.github.com/users/caarlos0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caarlos0/subscriptions","organizations_url":"https://api.github.com/users/caarlos0/orgs","repos_url":"https://api.github.com/users/caarlos0/repos","events_url":"https://api.github.com/users/caarlos0/events{/privacy}","received_events_url":"https://api.github.com/users/caarlos0/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T12:42:06Z","updated_at":"2015-09-08T12:42:06Z","body":"Opened a question in [SO](http://stackoverflow.com/questions/32458151/terraform-spot-instance-inside-vpc)."}}