Skip to content

Commit 9ba0462

Browse files
authored
Add ForceNew; resolves #76
1 parent 96058f7 commit 9ba0462

19 files changed

+181
-48
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.7.5 (Released)
2+
* Fixed `naked_domain_san` and `wildcard_san` on the `site` resource.
3+
* Adding edit `server_address` ability to `data_center` resource.
4+
* Updating several resources parameters to include `ForceNew`.
5+
16
## 2.7.4 (Released)
27

38
* Add retry logic to `site` and `data_center` resources

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ HOSTNAME=registry.terraform.io
55
NAMESPACE=terraform-providers
66
PKG_NAME=incapsula
77
BINARY=terraform-provider-${PKG_NAME}
8-
VERSION=2.7.4
8+
# VERSION=2.7.4
99
# OS_ARCH=darwin_amd64
1010

1111
default: install

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/terraform-providers/terraform-provider-incapsula
22

33
go 1.13
44

5-
require github.com/hashicorp/terraform-plugin-sdk/v2 v2.2.0
5+
require github.com/hashicorp/terraform-plugin-sdk/v2 v2.6.1

go.sum

Lines changed: 72 additions & 0 deletions
Large diffs are not rendered by default.

incapsula/client_site.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ type SiteStatusResponse struct {
5353
SetTypeTo string `json:"set_type_to"`
5454
SetDataTo []string `json:"set_data_to"`
5555
} `json:"original_dns"`
56-
Warnings []interface{} `json:"warnings"`
57-
Active string `json:"active"`
58-
SupportAllTLSVersions bool `json:"support_all_tls_versions"`
59-
WildcardSanForNewSites bool `json:"wildcard_san_for_new_sites"`
60-
NakedDomainSanForNewWwwSites bool `json:"naked_domain_san_for_new_www_sites"`
61-
AdditionalErrors []interface{} `json:"additionalErrors"`
62-
DisplayName string `json:"display_name"`
63-
Security struct {
56+
Warnings []interface{} `json:"warnings"`
57+
Active string `json:"active"`
58+
SupportAllTLSVersions bool `json:"support_all_tls_versions"`
59+
UseWildcardSanInsteadOfFullDomainSan bool `json:"use_wildcard_san_instead_of_full_domain_san"`
60+
AddNakedDomainSan bool `json:"add_naked_domain_san"`
61+
AdditionalErrors []interface{} `json:"additionalErrors"`
62+
DisplayName string `json:"display_name"`
63+
Security struct {
6464
Waf struct {
6565
Rules []struct {
6666
Action string `json:"action,omitempty"`

incapsula/resource_account.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ func resourceAccount() *schema.Resource {
2525
Description: "Email address. For example: joe@example.com.",
2626
Type: schema.TypeString,
2727
Required: true,
28-
ForceNew: true,
2928
},
3029

3130
// Optional Arguments
@@ -34,6 +33,7 @@ func resourceAccount() *schema.Resource {
3433
Type: schema.TypeInt,
3534
Optional: true,
3635
Computed: true,
36+
ForceNew: true,
3737
},
3838
"ref_id": {
3939
Description: "Customer specific identifier for this operation.",
@@ -44,6 +44,7 @@ func resourceAccount() *schema.Resource {
4444
Description: "The account owner's name. For example: John Doe.",
4545
Type: schema.TypeString,
4646
Optional: true,
47+
ForceNew: true,
4748
},
4849
"plan_id": {
4950
Description: "An identifier of the plan to assign to the new account. For example, ent100 for the Enterprise 100 plan.",
@@ -54,11 +55,13 @@ func resourceAccount() *schema.Resource {
5455
Description: "Account name.",
5556
Type: schema.TypeString,
5657
Optional: true,
58+
ForceNew: true,
5759
},
5860
"logs_account_id": {
5961
Description: "Available only for Enterprise Plan customers that purchased the Logs Integration SKU. Numeric identifier of the account that purchased the logs integration SKU and which collects the logs. If not specified, operation will be performed on the account identified by the authentication parameters.",
6062
Type: schema.TypeInt,
6163
Optional: true,
64+
ForceNew: true,
6265
},
6366
"log_level": {
6467
Description: "The log level. Options are `full`, `security`, and `none`.",
@@ -213,7 +216,7 @@ func resourceAccountRead(d *schema.ResourceData, m interface{}) error {
213216
func resourceAccountUpdate(d *schema.ResourceData, m interface{}) error {
214217
client := m.(*Client)
215218

216-
updateParams := [3]string{"email ", "plan_id", "ref_id"}
219+
updateParams := [7]string{"email", "plan_id", "ref_id", "error_page_template", "support_all_tls_versions", "naked_domain_san_for_new_www_sites", "wildcard_san_for_new_sites"}
217220
for i := 0; i < len(updateParams); i++ {
218221
param := updateParams[i]
219222
if d.HasChange(param) && d.Get(param) != "" {

incapsula/resource_cache_rule.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func resourceCacheRule() *schema.Resource {
3737
Description: "Numeric identifier of the site to operate on.",
3838
Type: schema.TypeString,
3939
Required: true,
40+
ForceNew: true,
4041
},
4142
"name": {
4243
Description: "Rule name",

incapsula/resource_certificate.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ func resourceCertificate() *schema.Resource {
1010
return &schema.Resource{
1111
Create: resourceCertificateCreate,
1212
Read: resourceCertificateRead,
13-
Update: resourceCertificateUpdate,
13+
Update: nil,
1414
Delete: resourceCertificateDelete,
1515
Importer: &schema.ResourceImporter{
1616
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
@@ -25,6 +25,7 @@ func resourceCertificate() *schema.Resource {
2525
Description: "Numeric identifier of the site to operate on.",
2626
Type: schema.TypeString,
2727
Required: true,
28+
ForceNew: true,
2829
},
2930
"certificate": {
3031
Description: "The certificate file in base64 format.",

incapsula/resource_data_center.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func resourceDataCenter() *schema.Resource {
3838
Description: "Numeric identifier of the site to operate on.",
3939
Type: schema.TypeString,
4040
Required: true,
41+
ForceNew: true,
4142
},
4243
"name": {
4344
Description: "The new data center's name.",
@@ -48,6 +49,7 @@ func resourceDataCenter() *schema.Resource {
4849
Description: "The server's address. Possible values: IP, CNAME.",
4950
Type: schema.TypeString,
5051
Required: true,
52+
ForceNew: true,
5153
},
5254

5355
// Optional Arguments

incapsula/resource_data_center_server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ func resourceDataCenterServer() *schema.Resource {
3838
Description: "Numeric identifier of the data center server to operate on.",
3939
Type: schema.TypeString,
4040
Required: true,
41+
ForceNew: true,
4142
},
4243
"site_id": {
4344
Description: "Numeric identifier of the site to operate on.",
4445
Type: schema.TypeString,
4546
Required: true,
47+
ForceNew: true,
4648
},
4749

4850
// Optional Arguments

0 commit comments

Comments
 (0)