I’m new to terraform and planning to write a sample terraform script. I’m using OCI as the provider and have prepared my machines for everything. I would like to know if there is any command to check what are the mandatory parameters/values to be supplied for creating resource using a command. Let say I want to deploy a VM instance and I want to get all available options for this resource . As in ansible we have ansible-doc is there an equivalent command. It becomes easy to write scripts. I struggled a lot for creating my first script as I had to look after multiple places to gather all the details required for creating an instance.I know examples available in github and at various places. But want to check from within the terraform managing machine.
something like : terraform show-parameters - provider oci -resource oci_core_instance .
For that matter i want to also see what all resource, data block options are available for a given provider.
Hi @Ashok_iaas,
The primary place to view documentation about Terraform providers and their resource types is in their documentation published in the Terraform Registry. For example, you can find The documentation for the hashicorp/oci
provider which should cover all of the resource types in each provider version published to the registry. You can use the version selector at the top of the page to switch to the version you are using, if it isn’t the latest version.
That information is not included in the provider packages themselves and so it isn’t available to Terraform to return locally. The provider plugins themselves only include a small subset of the information that is required for the Terraform language runtime to decode and validate the configuration and state data. If you wish you can view that data using the terraform providers schema
command, though it is designed primarily for export into other software which needs access to the schema, such as policy checking tools which may use the schema to decode machine-readable data about a plan.