<commit_before>
# oci\_core\_instances

[Instance Reference][fa44b1ae]

  [fa44b1ae]: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/Instance/ "InstanceReference"

Gets a list of instances.

## Example Usage

```
resource "oci_core_instance" "testInstance" {
	#Required
	availability_domain = "${var.availability_domain}"
	compartment_id = "${var.compartment_id}"
	image = "${var.image_id}"
	shape = "${var.shape}"

	# Optional
	create_vnic_details {
		#Required (subnet_id may also be specified at the root level)
		subnet_id = "${var.create_vnic_details_subnet_id}"

		#Optional
		assign_public_ip = "${var.create_vnic_details_assign_public_ip}"
		display_name = "${var.create_vnic_details_display_name}"
		hostname_label = "${var.create_vnic_details_hostname_label}"
		private_ip = "${var.create_vnic_details_private_ip}"
		skip_source_dest_check = "${var.create_vnic_details_skip_source_dest_check}"
	}
	display_name = "${var.display_name}"
	ipxe_script = "${var.ipxe_script}"
	metadata {
		ssh_authorized_keys = "${var.ssh_public_key}"
	}
	extended_metadata {
		some_string = "stringA"
		nested_object = "{\"some_string\": \"stringB\", \"object\": {\"some_string\": \"stringC\"}}"
	}
}

```

## Argument Reference

The following arguments are supported:

* `compartment_id` - (Required) The OCID of the compartment.
* `create_vnic_details` - (Optional) Details for creating a new VNIC. See [Create Vnic Details](https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/requests/CreateVnicDetails).
* `shape` - (Required) The shape of an instance.
* `subnet_id` - (Optional) Deprecated. Instead use `subnet_id` in `create_vnic_details`. At least one of them is required; if you provide both, the values must match.
* `hostname_label` - (Optional) Deprecated. Instead use `hostname_label` in `create_vnic_details`. At least one of them is required; if you provide both, the values must match.
* `availability_domain` - (Optional) The name of the Availability Domain.
* `display_name` - (Optional) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
* `image` - (Required) The OCID of the image used to boot the instance.
* `ipxe_script` - (Optional) This is an advanced option. See the [instance API reference](https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/Instance/) for details.
* `metadata` - (Optional) Custom metadata key/value pairs that you provide, such as the SSH public key required to connect to the instance.
* `extended_metadata` - (Optional) Like metadata but allows nested metadata if you pass a valid JSON string as a value

## Create VNIC Details Argument Reference

* `assign_public_ip` - (Optional) Whether the VNIC should be assigned a public IP address.
* `display_name` - (Optional) A user-friendly name for the VNIC. Does not have to be unique. Avoid entering confidential information.
* `hostname_label` - (Optional) The hostname for the VNIC's primary private IP.
* `private_ip` - (Optional) A private IP address of your choice to assign to the VNIC.
* `subnet_id` - (Required) The OCID of the subnet to create the VNIC in.
* `skip_source_dest_check` - (Optional) Whether the source/destination check is disabled on the VNIC. Defaults to `false`, which means the check is performed. For information about why you would skip the source/destination check, see [Using a Private IP as a Route Target](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm#privateip).

## Attributes Reference

The following attributes are exported:

* `instances` - The list of instances.

## Instance Reference<commit_msg>Add documentation for compute instance metadata<commit_after>
# oci\_core\_instances

[Instance Reference][fa44b1ae]

  [fa44b1ae]: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/Instance/ "InstanceReference"

Gets a list of instances.

## Example Usage

```
resource "oci_core_instance" "testInstance" {
	#Required
	availability_domain = "${var.availability_domain}"
	compartment_id = "${var.compartment_id}"
	image = "${var.image_id}"
	shape = "${var.shape}"

	# Optional
	create_vnic_details {
		#Required (subnet_id may also be specified at the root level)
		subnet_id = "${var.create_vnic_details_subnet_id}"

		#Optional
		assign_public_ip = "${var.create_vnic_details_assign_public_ip}"
		display_name = "${var.create_vnic_details_display_name}"
		hostname_label = "${var.create_vnic_details_hostname_label}"
		private_ip = "${var.create_vnic_details_private_ip}"
		skip_source_dest_check = "${var.create_vnic_details_skip_source_dest_check}"
	}
	display_name = "${var.display_name}"
	ipxe_script = "${var.ipxe_script}"
	metadata {
		ssh_authorized_keys = "${var.ssh_public_key}"
		user_data = "${base64encode(file(var.custom_bootstrap_file_name))}"
	}
	extended_metadata {
		some_string = "stringA"
		nested_object = "{\"some_string\": \"stringB\", \"object\": {\"some_string\": \"stringC\"}}"
	}
}

```

## Argument Reference

The following arguments are supported:

* `compartment_id` - (Required) The OCID of the compartment.
* `create_vnic_details` - (Optional) Details for creating a new VNIC. See [Create Vnic Details](https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/requests/CreateVnicDetails).
* `shape` - (Required) The shape of an instance.
* `subnet_id` - (Optional) Deprecated. Instead use `subnet_id` in `create_vnic_details`. At least one of them is required; if you provide both, the values must match.
* `hostname_label` - (Optional) Deprecated. Instead use `hostname_label` in `create_vnic_details`. At least one of them is required; if you provide both, the values must match.
* `availability_domain` - (Optional) The name of the Availability Domain.
* `display_name` - (Optional) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
* `image` - (Required) The OCID of the image used to boot the instance.
* `ipxe_script` - (Optional) This is an advanced option. See the [instance API reference](https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/Instance/) for details.
* `metadata` - (Optional) Custom metadata key/value pairs that you provide. Some possible key/value pairs:
  * `ssh_authorized_keys` - SSH public key required to connect to the instance.
  * `user_data` - Specify base64-encoded data used by Cloud-Init to run custom scripts or configuration on Linux instances. On Windows instances, this data isn't used.

  See [Cloud-Init Documentation](http://cloudinit.readthedocs.org/en/latest/topics/format.html) for more details about Cloud-Init data formats.
* `extended_metadata` - (Optional) Like metadata but allows nested metadata if you pass a valid JSON string as a value

## Create VNIC Details Argument Reference

* `assign_public_ip` - (Optional) Whether the VNIC should be assigned a public IP address.
* `display_name` - (Optional) A user-friendly name for the VNIC. Does not have to be unique. Avoid entering confidential information.
* `hostname_label` - (Optional) The hostname for the VNIC's primary private IP.
* `private_ip` - (Optional) A private IP address of your choice to assign to the VNIC.
* `subnet_id` - (Required) The OCID of the subnet to create the VNIC in.
* `skip_source_dest_check` - (Optional) Whether the source/destination check is disabled on the VNIC. Defaults to `false`, which means the check is performed. For information about why you would skip the source/destination check, see [Using a Private IP as a Route Target](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm#privateip).

## Attributes Reference

The following attributes are exported:

* `instances` - The list of instances.

## Instance Reference
{'fraction_non_alphanumeric': 0.11099718021020251, 'fraction_numerical': 0.009228402973596514, 'mean_word_length': 4.965596330275229, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3494027', 'n_tokens_mistral': 2488, 'n_tokens_neox': 2388, 'n_words': 763}