Skip to content

Commit

Permalink
add Software Guard Extensions bare metal product
Browse files Browse the repository at this point in the history
  • Loading branch information
geogriff-signal authored and sakshiag committed Jul 17, 2019
1 parent 6d2f4cb commit 0ecb139
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ibm/resource_ibm_compute_bare_metal.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ func resourceIBMComputeBareMetal() *schema.Resource {
Computed: true,
ForceNew: true,
},

"software_guard_extensions": {
Type: schema.TypeBool,
Optional: true,
Default: false,
ForceNew: true,
DiffSuppressFunc: applyOnce,
},

// Monthly only
"package_key_name": {
Type: schema.TypeString,
Expand Down Expand Up @@ -1158,6 +1167,13 @@ func setMonthlyHourlyCommonOrder(d *schema.ResourceData, items []datatypes.Produ
}
order.Prices = append(order.Prices, powerSupply)
}
if d.Get("software_guard_extensions").(bool) {
sgx, err := getItemPriceId(items, "software_guard_extensions", "SOFTWARE_GUARD_EXTENSIONS")
if err != nil {
return err
}
order.Prices = append(order.Prices, sgx)
}
if gpu0, ok := d.GetOk("gpu_key_name"); ok {
gpu0Price, err := getItemPriceId(items, "gpu0", gpu0.(string))
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/compute_bare_metal.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Locate your package ID. See `package_key_name` attribute. Once you have the ID f
* `fixed_config_preset` - (Required, string) The configuration preset with which you want to provision the bare metal server. This preset governs the type of CPU, number of cores, amount of RAM, and number of hard drives that the bare metal server has. To see the available presets, log in to the [IBM Cloud Infrastructure (SoftLayer) API](https://api.softlayer.com/rest/v3/SoftLayer_Hardware/getCreateObjectOptions.json) using your API key as the password. Find the key called `fixedConfigurationPresets`. The presets are identified by the key names.
* `os_reference_code` - (Optional, string) An operating system reference code that provisions the computing instance. To see available OS reference codes, log in to the [IBM Cloud Infrastructure (SoftLayer) API](https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest_Block_Device_Template_Group/getVhdImportSoftwareDescriptions.json?objectMask=referenceCode), using your API key as the password.
**NOTE**: Conflicts with `image_template_id`.
* `software_guard_extensions` - (Optional, boolean) The Software Guard Extensions product will be added to a compatible server package, selecting Intel SGX-enabled BIOS and hardware. The default value is `false`.

### Arguments for monthly bare metal servers

Expand All @@ -167,6 +168,7 @@ Locate your package ID. See `package_key_name` attribute. Once you have the ID f
* `hard_drives` - (Required, array of integers) The index of hard drives for RAID configuration. The index starts at 0. For example, the array [0,1] is an index of two hard drives.
* `array_size` - (Optional, integer) The target RAID disk size, specific in gigabytes.
* `partition_template_id` - (Optional, string) The partition template ID for the OS disk. Templates are different based on the target OS. To get the partition template ID, first find the OS ID in the [Softlayer API](https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Component_Partition_OperatingSystem/getAllObjects). Then replace <OS_ID> with your OS ID in the following URL: `https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Component_Partition_OperatingSystem/<OS_ID>/getPartitionTemplates`. Select you template ID in resulting available parition template IDs.
* `software_guard_extensions` - (Optional, boolean) The Software Guard Extensions product will be added to a compatible server package, selecting Intel SGX-enabled BIOS and hardware. The default value is `false`.
* `restricted_network` - (Optional, boolean) The non-datacenter restricted port speed. The default value is `false`.
* `tcp_monitoring` - (Optional) When the value is `false`, a ping monitoring service is provided. When the value is `true`, a ping monitoring service and a TCP monitoring service are provided.

Expand Down

0 comments on commit 0ecb139

Please sign in to comment.