copyright | lastupdated | keywords | subcollection | content-type | ||
---|---|---|---|---|---|---|
|
2022-03-28 |
quantum, Qiskit, runtime, near time compute, terraform |
quantum-computing |
howto |
{{site.data.keyword.attribute-definition-list}}
{: #setup-terraform}
If you use Terraform to manage your infrastructure, the IBM Cloud provider for Terraform{: external} supports provisioning Qiskit Runtime service instances. The generic “ibm_resource_instance” resource is used for that. The following parameters have to be specified: {: shortdesc}
{: #Provisioning-with-Terraform}
If you use Terraform to manage your infrastructure, the IBM Cloud provider for Terraform{: external} supports provisioning Qiskit Runtime service instances. The generic “ibm_resource_instance” resource is used for that. The following parameters have to be specified:
name
– The name of your service instance.service
– Specifyquantum-computing
to provision Qiskit Runtime instances.plan
– Can belite
orpaygo-standard
.location
– Currently, this must beus-east
.
Optional parameters include:
resource_group_id
– Creates the service instance in the specified resource group.tags
– Add tags to the resource.
{: #example}
After the job completes, you can view the results.
-
In your Terraform configuration file, add the following code:
resource "ibm_resource_instance" "my-instance" { name = "my-instance-name" service = "quantum-computing" plan = "lite" location = "us-east" }
{: codeblock}
Change the name of the service instance (parameter “name”) and the plan (parameter “plan”) according to your requirements.
-
Create a Terraform execution plan.
terraform plan
{: codeblock}
-
Remove the namespace and re-create it with a new name. Note that this process might take a few minutes to complete.
terraform apply
{: codeblock}
-
Verify on the Instances page{: external} that your service instance has been created.
Qiskit Runtime service instances are IAM managed resources. Access can be shaped through terraform using IAM user policies. See ibm_iam_user_policy{: external} for more details and examples.