From 0ecb139c8918bbaf035d48ff763e2fb7767d6865 Mon Sep 17 00:00:00 2001 From: Jeffrey Griffin Date: Wed, 27 Jun 2018 11:22:55 -0700 Subject: [PATCH] add Software Guard Extensions bare metal product --- ibm/resource_ibm_compute_bare_metal.go | 16 ++++++++++++++++ website/docs/r/compute_bare_metal.html.markdown | 2 ++ 2 files changed, 18 insertions(+) diff --git a/ibm/resource_ibm_compute_bare_metal.go b/ibm/resource_ibm_compute_bare_metal.go index 9d83f2ee14..1fb1186d22 100644 --- a/ibm/resource_ibm_compute_bare_metal.go +++ b/ibm/resource_ibm_compute_bare_metal.go @@ -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, @@ -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 { diff --git a/website/docs/r/compute_bare_metal.html.markdown b/website/docs/r/compute_bare_metal.html.markdown index 530ef84a72..c560d02455 100644 --- a/website/docs/r/compute_bare_metal.html.markdown +++ b/website/docs/r/compute_bare_metal.html.markdown @@ -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 @@ -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 with your OS ID in the following URL: `https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Component_Partition_OperatingSystem//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.