{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/581","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/581/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/581/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/581/events","html_url":"https://github.com/hashicorp/terraform/issues/581","id":49449035,"number":581,"title":"Import resources into Terraform","user":{"login":"piavlo","id":111126,"avatar_url":"https://avatars.githubusercontent.com/u/111126?v=3","gravatar_id":"","url":"https://api.github.com/users/piavlo","html_url":"https://github.com/piavlo","followers_url":"https://api.github.com/users/piavlo/followers","following_url":"https://api.github.com/users/piavlo/following{/other_user}","gists_url":"https://api.github.com/users/piavlo/gists{/gist_id}","starred_url":"https://api.github.com/users/piavlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piavlo/subscriptions","organizations_url":"https://api.github.com/users/piavlo/orgs","repos_url":"https://api.github.com/users/piavlo/repos","events_url":"https://api.github.com/users/piavlo/events{/privacy}","received_events_url":"https://api.github.com/users/piavlo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/core","name":"core","color":"cccccc"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/enhancement","name":"enhancement","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":29,"created_at":"2014-11-19T20:28:46Z","updated_at":"2015-09-30T22:01:57Z","closed_at":null,"body":"Use case , manage infrastructure environments both existing and created from scratch, by same terraform configs. For example in development environments we want to create everything from scratch and destroy everything then we finish working with it. In production we want to be able to add new resources to it with terraform but not conflict with resources that already exist but not managed by terrafrom yet.\r\n\r\nFor ex:\r\n\r\n    resource \"aws_subnet\" \"b\" {\r\n        vpc_id = \"${aws_vpc.terraform.id}\"\r\n        cidr_block = \"${var.vpc_network_prefix}.${lookup(var.vpc_subnet_suffix, \"b\")}\"\r\n        map_public_ip_on_launch = true\r\n        availability_zone = \"${var.region}b\"\r\n        if defined(var.subnet_b_id) { load_by_id(${var.subnet_b_id}) }\r\n   }\r\n\r\nif terraform has not yet created this resource it will check if subnet_b_id is defined and if resource with such id exists in provider api it will import this resource into terraform based on data in api instead of creating it.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/144554609","html_url":"https://github.com/hashicorp/terraform/issues/581#issuecomment-144554609","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/581","id":144554609,"user":{"login":"josephholsten","id":7495,"avatar_url":"https://avatars.githubusercontent.com/u/7495?v=3","gravatar_id":"","url":"https://api.github.com/users/josephholsten","html_url":"https://github.com/josephholsten","followers_url":"https://api.github.com/users/josephholsten/followers","following_url":"https://api.github.com/users/josephholsten/following{/other_user}","gists_url":"https://api.github.com/users/josephholsten/gists{/gist_id}","starred_url":"https://api.github.com/users/josephholsten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephholsten/subscriptions","organizations_url":"https://api.github.com/users/josephholsten/orgs","repos_url":"https://api.github.com/users/josephholsten/repos","events_url":"https://api.github.com/users/josephholsten/events{/privacy}","received_events_url":"https://api.github.com/users/josephholsten/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T22:01:57Z","updated_at":"2015-09-30T22:01:57Z","body":"could folks giving a :+1: try out the patch in #2022 or #3345? Those implementations seem to be the way forward."}}