It's very unlikely that you only need to import a single resource. In real life, you generally have a handful or more resources to import. It's a lot nicer to import all of the resources at once instead of manually importing them one by one. Or, if you're importing them through a pipeline of some sort, you want a programmatic way of importing the resources. That's all where the bulk import command comes in.
## Importing resources in bulk
To import resources in bulk, we need to build up a JSON file that has all of the information for each resource: a `type`, a `name`, and an `id`. As we mentioned in the last page, the `name` and `id` are values to get from your provider, either through a console or a CLI. While there is type information in the Import section of the API docs for that resource, there's another way to get the type. Pulumi's YAML provider uses that information to provision resources, so you can flip to YAML in the docs to get the resource's type.
While there are hacky ways to get the needed information, like taking a `.tfstate` file and trimming it down as a starting point, this file is created manually most of the time.
For our example, here's our final JSON file for importing, trimmed from the `.tfstate` file and modified to add the proper types in. Note that you will have different `id` values. Copy this code (with new `id` values) to a file called `resources.json` in your project directory:
<!-- ERROR: We can't import RemoteImages apparently; the IDs aren't accepted. Original JSON for that, if it works, follows.
Please copy the following code into your Pulumi application. Not doing so
will cause Pulumi to report that an update will happen on the next update command.
Please note that the imported resources are marked as protected. To destroy them
you will need to remove the `protect` option and run `pulumi update`*before*
the destroy will take effect.
# ...
```
It imports the resources into your stack and offers code snippets again for all of the resources in the JSON file. Pretty cool!
<br/>
<br/>
What if you want to specify the import behavior inside of your code, maintaining control as part of your code instead of via manual commands? Let's explore! Onward!