title: Terraform read details of existing resource
body: <p>I am facing an issue in terraform where I want to read details of some existing resource (r1) created via AWS web console.
  I am using those details in creation on new resource (r2) via terraform.</p>
  
  <p>Problem is that it is trying to destroy and recreate that resource which is not desired as it will be failed. How can I manage not to destroy and recreate r1 when I do terraform apply.</p>
  
  <p><strong>Here is how I am doing it :</strong></p>
  
  <p>main.tf</p>
  
  <pre><code>resource "aws_lb" "r1"{
  
  }
  
  ...
  
  resource "aws_api_gateway_integration" "r2" {
  
    type                    = "HTTP"
    uri                     = "${aws_lb.r1.dns_name}}/o/v1/multi/get/m/content"
  }
  </code></pre>
  
  <p>first I import that resource </p>
  
  <pre><code> terraform import aws_lb.r1 {my_arn}
  </code></pre>
  
  <p>next I apply terraform</p>
  
  <pre><code>terraform apply
  </code></pre>
  
  <p>error</p>
  
  <pre><code> aws_lb.r1: Error deleting LB: ResourceInUse: Load balancer 'my_arn' cannot be deleted because it is currently associated with another service
  </code></pre>