This guide lists the configuration for 'openapi' Terraform provider resources that can be managed using Terraform v0.12.
In order to provision 'openapi' Terraform resources, you need to first install the 'openapi' Terraform plugin by running the following command (you must be running Terraform >= 0.12):
$ export PROVIDER_NAME=openapi && curl -fsSL https://raw.githubusercontent.com/dikhan/terraform-provider-openapi/master/scripts/install.sh | bash -s -- --provider-name $PROVIDER_NAME
[INFO] Downloading https://github.com/dikhan/terraform-provider-openapi/releases/download/v0.29.4/terraform-provider-openapi_0.29.4_darwin_amd64.tar.gz in temporally folder /var/folders/n_/1lrwb99s7f50xmn9jpmfnddh0000gp/T/tmp.Xv1AkIZh...
[INFO] Extracting terraform-provider-openapi from terraform-provider-openapi_0.29.4_darwin_amd64.tar.gz...
[INFO] Cleaning up tmp dir created for installation purposes: /var/folders/n_/1lrwb99s7f50xmn9jpmfnddh0000gp/T/tmp.Xv1AkIZh
[INFO] Terraform provider 'terraform-provider-openapi' successfully installed at: '~/.terraform.d/plugins'!
You can then start running the Terraform provider:
$ export OTF_VAR_openapi_PLUGIN_CONFIGURATION_FILE="https://api.service.com/openapi.yaml"
➜ ~ terraform init && terraform plan
provider "openapi" { apikey_auth = "..." x_request_id = "..." }
Using the default region (rst1):
provider "openapi" { # Resources using this default provider will be created in the 'rst1' region
...
}
Using a specific region (dub1):
provider "openapi" { alias = "dub1" region = "dub1"
...
}
resource"openapi_resource" "my_resource" { provider = "openapi.dub1"
...
}
The following arguments are supported:
resource "openapi_cdn_v1" "my_cdn_v1"{ hostnames = ["hostnames1", "hostnames2"] label = "label" ips = ["ips1", "ips2"] }
The following arguments are supported:
* Note: Object type properties are internally represented (in the state file) as a list of one elem due to Terraform SDK's limitation for supporting complex object types. Please index on the first elem of the array to reference the object values (eg: openapi_cdn_v1.my_cdn_v1.object_property[0].object_property)
In addition to all arguments above, the following attributes are exported:
* Note: Object type properties are internally represented (in the state file) as a list of one elem due to Terraform SDK's limitation for supporting complex object types. Please index on the first elem of the array to reference the object values (eg: openapi_cdn_v1.my_cdn_v1.object_property[0].object_property)
cdn_v1 resources can be imported using the id
, e.g:
$ terraform import openapi_cdn_v1.my_cdn_v1 id
Note: In order for the import to work, the 'openapi' terraform provider must be properly installed. Read more about Terraform import usage here.
resource "openapi_cdn_v1_firewalls_v1" "my_cdn_v1_firewalls_v1"{ name = "name" cdn_v1_id = "cdn_v1_id" }
The following arguments are supported:
In addition to all arguments above, the following attributes are exported:
cdn_v1_firewalls_v1 resources can be imported using the id
. This is a sub-resource so the parent resource IDs ([cdn_v1_id]
) are required to be able to retrieve an instance of this resource, e.g:
$ terraform import openapi_cdn_v1_firewalls_v1.my_cdn_v1_firewalls_v1 cdn_v1_id/cdn_v1_firewalls_v1_id
Note: In order for the import to work, the 'openapi' terraform provider must be properly installed. Read more about Terraform import usage here.
resource "openapi_lbs_v1" "my_lbs_v1"{ name = "name" backends = ["backends1", "backends2"] }
The following arguments are supported:
* Note: Object type properties are internally represented (in the state file) as a list of one elem due to Terraform SDK's limitation for supporting complex object types. Please index on the first elem of the array to reference the object values (eg: openapi_lbs_v1.my_lbs_v1.new_status[0].object_property)
In addition to all arguments above, the following attributes are exported:
* Note: Object type properties are internally represented (in the state file) as a list of one elem due to Terraform SDK's limitation for supporting complex object types. Please index on the first elem of the array to reference the object values (eg: openapi_lbs_v1.my_lbs_v1.new_status[0].object_property)
lbs_v1 resources can be imported using the id
, e.g:
$ terraform import openapi_lbs_v1.my_lbs_v1 id
Note: In order for the import to work, the 'openapi' terraform provider must be properly installed. Read more about Terraform import usage here.
resource "openapi_monitors_v1_dub1" "my_monitors_v1_dub1"{ name = "name" }
The following arguments are supported:
In addition to all arguments above, the following attributes are exported:
monitors_v1_dub1 resources can be imported using the id
, e.g:
$ terraform import openapi_monitors_v1_dub1.my_monitors_v1_dub1 id
Note: In order for the import to work, the 'openapi' terraform provider must be properly installed. Read more about Terraform import usage here.
resource "openapi_monitors_v1_rst1" "my_monitors_v1_rst1"{ name = "name" }
The following arguments are supported:
In addition to all arguments above, the following attributes are exported:
monitors_v1_rst1 resources can be imported using the id
, e.g:
$ terraform import openapi_monitors_v1_rst1.my_monitors_v1_rst1 id
Note: In order for the import to work, the 'openapi' terraform provider must be properly installed. Read more about Terraform import usage here.
resource "openapi_multiregionmonitors_v1" "my_multiregionmonitors_v1"{ name = "name" }
The following arguments are supported:
In addition to all arguments above, the following attributes are exported:
multiregionmonitors_v1 resources can be imported using the id
, e.g:
$ terraform import openapi_multiregionmonitors_v1.my_multiregionmonitors_v1 id
Note: In order for the import to work, the 'openapi' terraform provider must be properly installed. Read more about Terraform import usage here.
Retrieve an existing resource using it's ID
data "openapi_cdn_v1_firewalls_v1_instance" "my_cdn_v1_firewalls_v1_instance"{ id = "existing_resource_id" }
The following arguments are supported:
In addition to all arguments above, the following attributes are exported:
Retrieve an existing resource using it's ID
data "openapi_cdn_v1_instance" "my_cdn_v1_instance"{ id = "existing_resource_id" }
The following arguments are supported:
In addition to all arguments above, the following attributes are exported:
* Note: Object type properties are internally represented (in the state file) as a list of one elem due to Terraform SDK's limitation for supporting complex object types. Please index on the first elem of the array to reference the object values (eg: openapi_cdn_v1_instance.my_cdn_v1_instance.object_nested_scheme_property[0].object_property)
Retrieve an existing resource using it's ID
data "openapi_lbs_v1_instance" "my_lbs_v1_instance"{ id = "existing_resource_id" }
The following arguments are supported:
In addition to all arguments above, the following attributes are exported:
* Note: Object type properties are internally represented (in the state file) as a list of one elem due to Terraform SDK's limitation for supporting complex object types. Please index on the first elem of the array to reference the object values (eg: openapi_lbs_v1_instance.my_lbs_v1_instance.new_status[0].object_property)
Retrieve an existing resource using it's ID
data "openapi_monitors_v1_dub1_instance" "my_monitors_v1_dub1_instance"{ id = "existing_resource_id" }
The following arguments are supported:
In addition to all arguments above, the following attributes are exported:
Retrieve an existing resource using it's ID
data "openapi_monitors_v1_rst1_instance" "my_monitors_v1_rst1_instance"{ id = "existing_resource_id" }
The following arguments are supported:
In addition to all arguments above, the following attributes are exported:
Retrieve an existing resource using it's ID
data "openapi_multiregionmonitors_v1_instance" "my_multiregionmonitors_v1_instance"{ id = "existing_resource_id" }
The following arguments are supported:
In addition to all arguments above, the following attributes are exported: