diff --git a/go.mod b/go.mod index 91f3c2cdc3..bf6f73b140 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/IBM/go-sdk-core/v5 v5.5.1 github.com/IBM/ibm-cos-sdk-go v1.7.0 github.com/IBM/ibm-cos-sdk-go-config v1.2.0 - github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20210716185544-e8403b3501ef + github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20210723145459-a232c3f3ac91 github.com/IBM/keyprotect-go-client v0.7.0 github.com/IBM/networking-go-sdk v0.18.0 github.com/IBM/platform-services-go-sdk v0.18.16 diff --git a/go.sum b/go.sum index 127821a38f..532526cf16 100644 --- a/go.sum +++ b/go.sum @@ -70,8 +70,8 @@ github.com/IBM/ibm-cos-sdk-go v1.7.0 h1:3DZULY/D5WzjlIm+Iaj6h0surEjQs65EZk1YAe8+ github.com/IBM/ibm-cos-sdk-go v1.7.0/go.mod h1:Oi8AC5WNDhmUJgbo1GL2FtBdo0nRgbzE/1HmCL1SERU= github.com/IBM/ibm-cos-sdk-go-config v1.2.0 h1:1E93234yZgVS0ntm7eUwVb3h0AAayPGcxEhhizEN1LE= github.com/IBM/ibm-cos-sdk-go-config v1.2.0/go.mod h1:Wetfgv6m1xyuzpZLQTTLIBsWstxjYa15h+Utj7x53Dk= -github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20210716185544-e8403b3501ef h1:x7xHqeuiTUfvozRQo3qt7W1qispGpLsDXqnBfXpkvYY= -github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20210716185544-e8403b3501ef/go.mod h1:M2JyuyeWHPtgGNeezr6YqVRuaav2MpY8Ha4QrEYvMoI= +github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20210723145459-a232c3f3ac91 h1:8ICDvg7YM+PmfF+LQ42D4w/p4QEpiknbycAgGdbk0dw= +github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20210723145459-a232c3f3ac91/go.mod h1:M2JyuyeWHPtgGNeezr6YqVRuaav2MpY8Ha4QrEYvMoI= github.com/IBM/keyprotect-go-client v0.7.0 h1:JstSHD14Lp6ihwQseyPuGcs1AjOBjAmcisP0dTBA6A0= github.com/IBM/keyprotect-go-client v0.7.0/go.mod h1:SVr2ylV/fhSQPDiUjWirN9fsyWFCNNbt8GIT8hPJVjE= github.com/IBM/networking-go-sdk v0.18.0 h1:mlALxXptnoDGviRW59ZQTyCr4PgTdQKp/5ksh2NM6Sk= diff --git a/ibm/resource_ibm_hpcs.go b/ibm/resource_ibm_hpcs.go index dd8d163f4f..5829ab8e41 100644 --- a/ibm/resource_ibm_hpcs.go +++ b/ibm/resource_ibm_hpcs.go @@ -86,11 +86,11 @@ func resourceIBMHPCS() *schema.Resource { Computed: true, }, "service_endpoints": { - Description: "Types of the service endpoints. Possible values are 'public', 'private', 'public-and-private'.", + Description: "Types of the service endpoints. Possible values are `public-and-private`, `private-only`.", Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private", "public-and-private"}), + ValidateFunc: validateAllowedStringValue([]string{"public-and-private", "private-only"}), }, "tags": { Type: schema.TypeSet, @@ -307,7 +307,7 @@ func resourceIBMHPCS() *schema.Resource { type HPCSParams struct { Units int `json:"units,omitempty"` FailoverUnits int `json:"failover_units,omitempty"` - ServiceEndpoints string `json:"service-endpoints,omitempty"` + ServiceEndpoints string `json:"allowed_network,omitempty"` } func resourceIBMHPCSValidator() *ResourceValidator { @@ -880,11 +880,16 @@ func hsmClient(d *schema.ResourceData, meta interface{}) (tkesdk.CommonInputs, e if err != nil { return ci, fmt.Errorf("[ERROR] Error Refreshing Authentication Token: %s", err) } + var serviceEndpoint string + if e, ok := d.GetOk("service_endpoints"); ok { + serviceEndpoint = e.(string) + } ci.Region = d.Get("location").(string) ci.ApiEndpoint = envFallBack([]string{"IBMCLOUD_HPCS_TKE_ENDPOINT"}, "cloud.ibm.com") - if bluemixSession.Config.Visibility == "private" || bluemixSession.Config.Visibility == "public-and-private" { + if bluemixSession.Config.Visibility == "private" || bluemixSession.Config.Visibility == "public-and-private" || serviceEndpoint == "private-only" { ci.ApiEndpoint = envFallBack([]string{"IBMCLOUD_HPCS_TKE_ENDPOINT"}, "private.cloud.ibm.com") } + ci.AuthToken = bluemixSession.Config.IAMAccessToken return ci, err diff --git a/website/docs/r/hpcs.html.markdown b/website/docs/r/hpcs.html.markdown index ea536a5655..91ba89b04b 100644 --- a/website/docs/r/hpcs.html.markdown +++ b/website/docs/r/hpcs.html.markdown @@ -51,7 +51,7 @@ The following arguments are supported: * `plan` - (Required, string) The pricing plan for your service instance. Currently, only the standard plan is supportd. * `resource_group_id` - (Optional, string) The Id of resource group where you want to organize and manage your service instance. * `revocation_threshold` - (Required, int) The number of administrator signatures that is required to remove an administrator after you leave imprint mode. The valid value is between 1 and 8. -* `service_endpoints` - (Optional, string) Types of the service endpoints that can be set to a resource instance. Possible values are 'public', 'private', 'public-and-private'. +* `service_endpoints` - (Optional, string) Types of the service endpoints that can be set to a resource instance. Possible values are `public-and-private`, `private-only`. * `signature_server_url` - (Optional, string) The URL of the signing service. If you use a third-party signing service to provide administrator signature keys, you need to specify the URL. * `signature_threshold`- (Required, int) The number of administrator signatures that is required to execute administrative commands. The valid value is between 1 and 8. You need to set it to at least 2 to enable quorum authentication. * `tags` - (Optional, array of strings) Tags that are associated with your instance are used to organize your resources.