Skip to content

Commit 2591ad6

Browse files
committed
Update docs, add validations check for Container Host
1 parent 1dd5498 commit 2591ad6

File tree

5 files changed

+27
-20
lines changed

5 files changed

+27
-20
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## v0.7.4
8+
- Add validation checks and update documentatin for Container Host
9+
710
## v0.7.3
811
- Implement data.hsdp_iam_service
912

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
ARG hsdp_provider_version=0.7.1
1+
ARG hsdp_provider_version=0.7.4
22

3-
FROM golang:1.15.5-alpine3.12 as build_base
3+
FROM golang:1.15.6-alpine3.12 as build_base
44
RUN apk add --no-cache git openssh gcc musl-dev
55
WORKDIR /terraform-provider-hsdp
66
COPY go.mod .
@@ -15,7 +15,7 @@ FROM build_base AS builder
1515
COPY . .
1616
RUN ./buildscript.sh
1717

18-
FROM hashicorp/terraform:0.13.5
18+
FROM hashicorp/terraform:0.14.2
1919
ARG hsdp_provider_version
2020
ENV HSDP_PROVIDER_VERSION ${hsdp_provider_version}
2121
LABEL maintainer="Andy Lo-A-Foe <andy.lo-a-foe@philips.com>"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ To find out more about HSDP please visit https://www.hsdp.io/
1212

1313
# Using the provider
1414

15-
**Terraform 0.13**: To install this provider, copy and paste this code into your Terraform configuration. Then, run terraform init.
15+
**Terraform 0.13+**: To install this provider, copy and paste this code into your Terraform configuration. Then, run terraform init.
1616

1717
```terraform
1818
terraform {
1919
required_providers {
2020
hsdp = {
2121
source = "philips-software/hsdp"
22-
version = ">= 0.7.3"
22+
version = ">= 0.7.4"
2323
}
2424
}
2525
}

docs/resources/container_host.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ The following arguments are supported:
4747
* `name` - (Required) The container host name. Must be unique.
4848
* `instance_type` - (Optional) The EC2 instance type to use. Default `m5.large`
4949
* `instance_role` - (Optional) The role to use. Default `container-host` (other values: `vanilla`, `base`)
50-
* `volume_type` - (Optional) The EBS volume type.
51-
* `iops` - (Optional) Number of IOPs to provision.
50+
* `volume_type` - (Optional) The EBS volume type. Default is `gp2`. You can also choose `io1` which is default when you specify `iops` value
51+
* `iops` - (Optional) Number of guaranteed IOPs to provision. Supported value range `1-4000`
5252
* `protect` - (Optional) Boolean when set will enable protection for container host.
5353
* `encrypt_volumes` - (Optional) When set encrypts volumes. Default is `true`
54-
* `volumes` - (Optional) Number of additional volumes to attach. Default `0`
55-
* `volume_size` - (Optional) Volume size in GB.
54+
* `volumes` - (Optional) Number of additional volumes to attach. Default `0`, Maximum `6`
55+
* `volume_size` - (Optional) Volume size in GB. Supported value range `1-1000` (1 TB max)
5656
* `security_groups` - (Optional) list(string) of Security groups to attach. Default `[]`
5757
* `user_groups` - (Optional) list(string) of User groups to attach. Default `[]`
5858
* `tags` - (Optional) Map of tags to assign to the instances

hsdp/resource_container_host.go

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
77
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
88
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
9+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
910
"github.com/philips-software/go-hsdp-api/cartel"
1011
"log"
1112
"net/http"
@@ -64,9 +65,10 @@ func resourceContainerHost() *schema.Resource {
6465
ForceNew: true,
6566
},
6667
"iops": {
67-
Type: schema.TypeInt,
68-
Optional: true,
69-
ForceNew: true,
68+
Type: schema.TypeInt,
69+
Optional: true,
70+
ForceNew: true,
71+
ValidateFunc: validation.IntBetween(1, 4000),
7072
},
7173
"protect": {
7274
Type: schema.TypeBool,
@@ -80,16 +82,18 @@ func resourceContainerHost() *schema.Resource {
8082
ForceNew: true,
8183
},
8284
"volumes": {
83-
Type: schema.TypeInt,
84-
Default: 0,
85-
Optional: true,
86-
ForceNew: true,
85+
Type: schema.TypeInt,
86+
Default: 0,
87+
Optional: true,
88+
ForceNew: true,
89+
ValidateFunc: validation.IntBetween(0, 6),
8790
},
8891
"volume_size": {
89-
Type: schema.TypeInt,
90-
Default: 0,
91-
Optional: true,
92-
ForceNew: true,
92+
Type: schema.TypeInt,
93+
Default: 0,
94+
Optional: true,
95+
ForceNew: true,
96+
ValidateFunc: validation.IntBetween(0, 1000),
9397
},
9498
"security_groups": {
9599
Type: schema.TypeSet,

0 commit comments

Comments
 (0)