title: Terraform error creating API Gateway Resource complains another resource with the same parent already has this name
body: <p>I am creating an API Gateway resource called &quot;lang&quot;:</p>
  <pre><code>resource &quot;aws_api_gateway_resource&quot; &quot;lang&quot; {
    path_part   = &quot;lang&quot;
    parent_id   = aws_api_gateway_resource.api.id
    rest_api_id = aws_api_gateway_rest_api.root_api.id
  }
  </code></pre>
  <p>Having successfully created the API, when running <code>terraform apply</code> subsequent times, I get this error:</p>
  <pre><code>Error: Error creating API Gateway Resource: ConflictException: Another resource with the same parent already has this name: lang
  </code></pre>
  <p>The resource block above is absolutely, definitely the only one with that name. I've googled enough on this to realise that terraform is complaining that the resource called &quot;lang&quot; already exists and can't be recreated. What I don't know is how to get it destroyed first.</p>
  <p>I have tried adding this to my script:</p>
  <pre><code>resource &quot;aws_api_gateway_deployment&quot; &quot;deployment&quot; {
    rest_api_id   = aws_api_gateway_rest_api.root_api.id
    stage_name    = var.envName
    
    triggers = {
      redeployment = sha1(jsonencode(aws_api_gateway_rest_api.root_api.body))
    }
  
    lifecycle {
      create_before_destroy = true
    }
  }
  </code></pre>
  <p>...to no avail.</p>
  <p>Should the <code>create_before_destroy</code> property not essentially destroy the API and cause it to be recreated or only the stage?</p>
  <p>How can I make changes to the &quot;lang&quot; resource if the resource block can't do it? This seems a fundamental circular problem to me.</p>