Skip to content

Commit 2838665

Browse files
sagarpsalviRohan
and
Rohan
authored
Auto updated assets for terraform 22.1.5 (#565)
* Updated assets for terraform Signed-off-by: Sagar <[email protected]> * Updated assets for terraform Signed-off-by: Sagar <[email protected]> * Updated assets for terraform Signed-off-by: Sagar <[email protected]> * Updated assets for terraform Signed-off-by: Sagar <[email protected]> * Re Formated resources * Updated assets for terraform Signed-off-by: Sagar <[email protected]> * Updated assets for terraform Signed-off-by: Sagar <[email protected]> * Updated imports Signed-off-by: Rohan <[email protected]> * Updated assets for terraform Signed-off-by: Sagar <[email protected]> * Updated assets for terraform Signed-off-by: Sagar <[email protected]> * Updated assets for terraform Signed-off-by: Sagar <[email protected]> * Reformated go files * Updated Changelog Signed-off-by: Rohan <[email protected]> --------- Signed-off-by: Sagar <[email protected]> Signed-off-by: Rohan <[email protected]> Co-authored-by: Rohan <[email protected]>
1 parent a51db59 commit 2838665

14 files changed

+120
-31
lines changed

Diff for: CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
## 0.3.0 (Unreleased)
1+
## 0.3.1 (Unreleased)
2+
## 0.3.0 (October 30, 2023)
3+
BUG FIXES:
4+
- AV-187301: Entering worng credentials on terraform using AVI as provider while using Plan command break statefile
5+
- AV-187199: AVI terraform apply the resource object even if it is already exist without showing Error.
6+
- AV-186452: AVI-provider for Terraform version 22.1.2 and 22.1.4 creates any object in the Admin tenant.
7+
- AV-186737: Changes to certain subresources are not detected as changes by Terraform
8+
29
## 0.2.3 (June 16, 2020)
310
Features:
411
- Updated Avi Go SDK to latest.

Diff for: avi/data_source_avi_applicationprofile_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ resource "avi_applicationprofile" "testApplicationProfile" {
106106
use_app_keepalive_timeout = false
107107
}
108108
preserve_client_port = false
109+
l4_ssl_profile {
110+
ssl_stream_idle_timeout = "3600"
111+
}
109112
}
110113
111114
data "avi_applicationprofile" "testApplicationProfile" {

Diff for: avi/data_source_avi_user_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ data "avi_useraccountprofile" "default-user-account-profile" {
4242
}
4343
resource "avi_user" "testUser" {
4444
access {
45-
role_ref = data.avi_role.default-system-admin-role.id
45+
role_ref = "${data.avi_tenant.default_tenant.id}/role/${element(split("/", data.avi_role.default-system-admin-role.id),5)}"
4646
tenant_ref = data.avi_tenant.default_tenant.id
4747
all_tenants = false
4848
}

Diff for: avi/datasource_avi_controllerproperties.go

+8
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,18 @@ func dataSourceAviControllerProperties() *schema.Resource {
6969
Type: schema.TypeString,
7070
Computed: true,
7171
},
72+
"cloud_discovery_interval": {
73+
Type: schema.TypeString,
74+
Computed: true,
75+
},
7276
"cloud_reconcile": {
7377
Type: schema.TypeString,
7478
Computed: true,
7579
},
80+
"cloud_reconcile_interval": {
81+
Type: schema.TypeString,
82+
Computed: true,
83+
},
7684
"cluster_ip_gratuitous_arp_period": {
7785
Type: schema.TypeString,
7886
Computed: true,

Diff for: avi/resource_avi_applicationprofile_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ resource "avi_applicationprofile" "testApplicationProfile" {
174174
use_app_keepalive_timeout = false
175175
}
176176
preserve_client_port = false
177+
l4_ssl_profile {
178+
ssl_stream_idle_timeout = "3600"
179+
}
177180
}
178181
`
179182

@@ -253,5 +256,8 @@ resource "avi_applicationprofile" "testApplicationProfile" {
253256
use_app_keepalive_timeout = false
254257
}
255258
preserve_client_port = false
259+
l4_ssl_profile {
260+
ssl_stream_idle_timeout = "3600"
261+
}
256262
}
257263
`

Diff for: avi/resource_avi_cloud.go

+14-10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"log"
1010
"os"
1111
"strconv"
12+
"strings"
1213
"time"
1314

1415
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -335,21 +336,24 @@ func setupVcenterMgmtNetwork(d *schema.ResourceData, meta interface{}) error {
335336
client := meta.(*clients.AviClient)
336337
vcenterConfig, _ := d.GetOk("vcenter_configuration")
337338
mgmtNetwork := vcenterConfig.(*schema.Set).List()[0].(map[string]interface{})["management_network"].(string)
338-
mgmtNetwork = "vimgrruntime?name=" + mgmtNetwork
339339
if err := APICreateOrUpdate(d, meta, "cloud", s); err != nil {
340340
log.Printf("[Error] Got error for cloud create/update. Error: %s", err.Error())
341341
return err
342342
}
343343
uuid := d.Get("uuid").(string)
344-
if err := waitForCloudState(uuid, "CLOUD_STATE_FAILED", client, maxRetry); err != nil {
345-
return err
346-
}
347-
vcenterConfig.(*schema.Set).List()[0].(map[string]interface{})["management_network"] = mgmtNetwork
348-
if err := d.Set("vcenter_configuration", vcenterConfig); err != nil {
349-
return err
350-
}
351-
if err := APICreateOrUpdate(d, meta, "cloud", s); err != nil {
352-
return err
344+
if ok := strings.Contains(mgmtNetwork, "api/"); !ok {
345+
mgmtNetwork = "vimgrruntime?name=" + mgmtNetwork
346+
vcenterConfig.(*schema.Set).List()[0].(map[string]interface{})["management_network"] = mgmtNetwork
347+
if err := d.Set("vcenter_configuration", vcenterConfig); err != nil {
348+
return err
349+
}
350+
if err := waitForCloudState(uuid, "CLOUD_STATE_FAILED", client, maxRetry); err != nil {
351+
return err
352+
}
353+
if err := APICreateOrUpdate(d, meta, "cloud", s); err != nil {
354+
log.Printf("[Error] Got error for cloud create/update. Error: %s", err.Error())
355+
return err
356+
}
353357
}
354358
if err := waitForCloudState(uuid, "CLOUD_STATE_PLACEMENT_READY", client, maxRetry); err != nil {
355359
return err

Diff for: avi/resource_avi_controllerproperties.go

+12
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,24 @@ func ResourceControllerPropertiesSchema() map[string]*schema.Schema {
101101
Default: "60",
102102
ValidateFunc: validateInteger,
103103
},
104+
"cloud_discovery_interval": {
105+
Type: schema.TypeString,
106+
Optional: true,
107+
Default: "5",
108+
ValidateFunc: validateInteger,
109+
},
104110
"cloud_reconcile": {
105111
Type: schema.TypeString,
106112
Optional: true,
107113
Default: "true",
108114
ValidateFunc: validateBool,
109115
},
116+
"cloud_reconcile_interval": {
117+
Type: schema.TypeString,
118+
Optional: true,
119+
Default: "5",
120+
ValidateFunc: validateInteger,
121+
},
110122
"cluster_ip_gratuitous_arp_period": {
111123
Type: schema.TypeString,
112124
Optional: true,

Diff for: avi/resource_avi_rest_dependants.go

+16
Original file line numberDiff line numberDiff line change
@@ -10097,6 +10097,12 @@ func ResourceDnsServiceApplicationProfileSchema() *schema.Resource {
1009710097
Optional: true,
1009810098
Default: "hostmaster",
1009910099
},
10100+
"client_dns_tcp_request_timeout": {
10101+
Type: schema.TypeString,
10102+
Optional: true,
10103+
Default: "10000",
10104+
ValidateFunc: validateInteger,
10105+
},
1010010106
"close_tcp_connection_post_response": {
1010110107
Type: schema.TypeString,
1010210108
Optional: true,
@@ -32581,12 +32587,22 @@ func ResourceStreamingSyslogConfigSchema() *schema.Resource {
3258132587
Optional: true,
3258232588
Default: "AviVantage",
3258332589
},
32590+
"msg_id": {
32591+
Type: schema.TypeString,
32592+
Optional: true,
32593+
Default: "NILVALUE",
32594+
},
3258432595
"non_significant_log_severity": {
3258532596
Type: schema.TypeString,
3258632597
Optional: true,
3258732598
Default: "6",
3258832599
ValidateFunc: validateInteger,
3258932600
},
32601+
"proc_id": {
32602+
Type: schema.TypeString,
32603+
Optional: true,
32604+
Default: "NILVALUE",
32605+
},
3259032606
"significant_log_severity": {
3259132607
Type: schema.TypeString,
3259232608
Optional: true,

Diff for: avi/resource_avi_user_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ data "avi_useraccountprofile" "default-user-account-profile" {
110110
}
111111
resource "avi_user" "testUser" {
112112
access {
113-
role_ref = data.avi_role.default-system-admin-role.id
113+
role_ref = "${data.avi_tenant.default_tenant.id}/role/${element(split("/", data.avi_role.default-system-admin-role.id),5)}"
114114
tenant_ref = data.avi_tenant.default_tenant.id
115115
all_tenants = false
116116
}
@@ -138,7 +138,7 @@ data "avi_useraccountprofile" "default-user-account-profile" {
138138
}
139139
resource "avi_user" "testUser" {
140140
access {
141-
role_ref = data.avi_role.default-system-admin-role.id
141+
role_ref = "${data.avi_tenant.default_tenant.id}/role/${element(split("/", data.avi_role.default-system-admin-role.id),5)}"
142142
tenant_ref = data.avi_tenant.default_tenant.id
143143
all_tenants = false
144144
}

Diff for: avi/utils.go

+37-16
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ func APICreateOrUpdate(d *schema.ResourceData, meta interface{}, objType string,
307307
log.Printf("[INFO] APICreateOrUpdate Tenant ref found %v", tenantName)
308308
}
309309
if specialobj {
310-
path = path + "?skip_default=true"
311310
err = client.AviSession.Put(path, data, &robj)
312311
if err != nil {
313312
log.Printf("[ERROR] APICreateOrUpdate: PUT on %v Error %v path %v id %v\n", objType, err, path,
@@ -316,7 +315,7 @@ func APICreateOrUpdate(d *schema.ResourceData, meta interface{}, objType string,
316315
SetIDFromObj(d, robj)
317316
}
318317
} else if uuid, ok := d.GetOk("uuid"); ok {
319-
path = path + "/" + uuid.(string) + "?skip_default=true"
318+
path = path + "/" + uuid.(string)
320319
if !usePatchForUpdate {
321320
err = client.AviSession.Put(path, data, &robj, session.SetOptTenant(tenantName))
322321
} else {
@@ -366,7 +365,7 @@ func APICreateOrUpdate(d *schema.ResourceData, meta interface{}, objType string,
366365
// found existing object.
367366
SetIDFromObj(d, existingObj)
368367
uuid = existingObj.(map[string]interface{})["uuid"].(string)
369-
path = path + "/" + uuid.(string) + "?skip_default=true"
368+
path = path + "/" + uuid.(string)
370369
if !usePatchForUpdate {
371370
err = client.AviSession.Put(path, data, &robj)
372371
} else {
@@ -428,7 +427,7 @@ func APIRead(d *schema.ResourceData, meta interface{}, objType string, s map[str
428427
if specialobj {
429428
path = "api/" + objType
430429
} else {
431-
path = "api/" + objType + "/" + uuid + "?skip_default=true"
430+
path = "api/" + objType + "/" + uuid
432431
}
433432
log.Printf("[DEBUG] APIRead reading object with id %v path %v\n", uuid, path)
434433
err := client.AviSession.Get(path, &obj, session.SetOptTenant(tenantName))
@@ -470,15 +469,7 @@ func APIRead(d *schema.ResourceData, meta interface{}, objType string, s map[str
470469
log.Printf("[ERROR] APIRead not found %v\n", d.Get("uuid"))
471470
return nil
472471
}
473-
if localData, err := SchemaToAviData(d, s); err == nil {
474-
modAPIRes, err := SetDefaultsInAPIRes(obj, localData, s)
475-
if err != nil {
476-
log.Printf("[ERROR] APIRead in modifying api response object %v\n", err)
477-
}
478-
modAPIRes, err = PreprocessAPIRes(modAPIRes, s)
479-
if err != nil {
480-
log.Printf("[ERROR] APIRead in modifying api response object for conversion %v\n", err)
481-
}
472+
if modAPIRes, err := PreprocessAPIRes(obj, s); err == nil {
482473
if _, err := APIDataToSchema(modAPIRes, d, s); err == nil {
483474
if modAPIRes.(map[string]interface{})["uuid"] != nil {
484475
uuid = modAPIRes.(map[string]interface{})["uuid"].(string)
@@ -497,10 +488,40 @@ func APIRead(d *schema.ResourceData, meta interface{}, objType string, s map[str
497488
} else {
498489
log.Printf("[ERROR] APIRead in setting read object %v\n", err)
499490
}
500-
log.Printf("[DEBUG] type: %v localData : %v", objType, localData)
501491
log.Printf("[DEBUG] type: %v modAPIRes: %v", objType, modAPIRes)
492+
} else {
493+
log.Printf("[ERROR] APIRead in modifying api response object for conversion %v\n", err)
502494
}
503-
495+
// if localData, err := SchemaToAviData(d, s); err == nil {
496+
// // modAPIRes, err := SetDefaultsInAPIRes(obj, localData, s)
497+
// if err != nil {
498+
// log.Printf("[ERROR] APIRead in modifying api response object %v\n", err)
499+
// }
500+
// modAPIRes, err := PreprocessAPIRes(obj, s)
501+
// if err != nil {
502+
// log.Printf("[ERROR] APIRead in modifying api response object for conversion %v\n", err)
503+
// }
504+
// if _, err := APIDataToSchema(modAPIRes, d, s); err == nil {
505+
// if modAPIRes.(map[string]interface{})["uuid"] != nil {
506+
// uuid = modAPIRes.(map[string]interface{})["uuid"].(string)
507+
// }
508+
// if modAPIRes.(map[string]interface{})["url"] != nil {
509+
// url = modAPIRes.(map[string]interface{})["url"].(string)
510+
// }
511+
// //url = strings.SplitN(url, "#", 2)[0]
512+
// if url != "" {
513+
// d.SetId(url)
514+
// log.Printf("[DEBUG] APIRead read object with id %v\n", url)
515+
// } else {
516+
// d.SetId(uuid)
517+
// log.Printf("[DEBUG] APIRead read object with id %v\n", uuid)
518+
// }
519+
// } else {
520+
// log.Printf("[ERROR] APIRead in setting read object %v\n", err)
521+
// }
522+
// log.Printf("[DEBUG] type: %v localData : %v", objType, localData)
523+
// log.Printf("[DEBUG] type: %v modAPIRes: %v", objType, modAPIRes)
524+
// }
504525
return nil
505526
}
506527

@@ -540,7 +561,7 @@ func ResourceImporter(d *schema.ResourceData, meta interface{}, objType string,
540561
}
541562
var data interface{}
542563
client := meta.(*clients.AviClient)
543-
path := "api/" + objType + "?skip_default=true"
564+
path := "api/" + objType
544565
err := client.AviSession.Get(path, &data)
545566
if err != nil {
546567
log.Printf("[ERROR] ResourceImporter %v in GET of path %v\n", err, path)

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.16
44

55
require (
66
github.com/hashicorp/terraform-plugin-sdk/v2 v2.20.0
7-
github.com/vmware/alb-sdk v0.0.0-20230803045343-7e6a018c41ca
7+
github.com/vmware/alb-sdk v0.0.0-20231017102949-55cd29c1dd76
88
)

Diff for: go.sum

+8
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,14 @@ github.com/vmware/alb-sdk v0.0.0-20230628113843-5165d78773eb h1:fD8NF+e7YEeiE/6O
299299
github.com/vmware/alb-sdk v0.0.0-20230628113843-5165d78773eb/go.mod h1:fuRb4saDY/xy/UMeMvyKYmcplNknEL9ysaqYSw7reNE=
300300
github.com/vmware/alb-sdk v0.0.0-20230803045343-7e6a018c41ca h1:R8cugWJDNvrC00LEgCN0Kr4Mgb58vw/fy3WtsTfL5Do=
301301
github.com/vmware/alb-sdk v0.0.0-20230803045343-7e6a018c41ca/go.mod h1:fuRb4saDY/xy/UMeMvyKYmcplNknEL9ysaqYSw7reNE=
302+
github.com/vmware/alb-sdk v0.0.0-20230925090656-d3e38a2158c3 h1:2aGDS770QDZFBqpZhqhpmW6z8+ekNhN2A1gKDszOL7I=
303+
github.com/vmware/alb-sdk v0.0.0-20230925090656-d3e38a2158c3/go.mod h1:fuRb4saDY/xy/UMeMvyKYmcplNknEL9ysaqYSw7reNE=
304+
github.com/vmware/alb-sdk v0.0.0-20230929065435-97937a02f61c h1:c0rLp5vieq0pfYlftKnMkjreudKTDrAMKlg2GMgnEgU=
305+
github.com/vmware/alb-sdk v0.0.0-20230929065435-97937a02f61c/go.mod h1:fuRb4saDY/xy/UMeMvyKYmcplNknEL9ysaqYSw7reNE=
306+
github.com/vmware/alb-sdk v0.0.0-20230929130736-eaca7e5d3e68 h1:4XEOrWr70fSwI3jLNyrMy4OWvpG2d5IDNEi4z3r+/ME=
307+
github.com/vmware/alb-sdk v0.0.0-20230929130736-eaca7e5d3e68/go.mod h1:fuRb4saDY/xy/UMeMvyKYmcplNknEL9ysaqYSw7reNE=
308+
github.com/vmware/alb-sdk v0.0.0-20231017102949-55cd29c1dd76 h1:O5uFlHpps0NESmls1wY5Eai+Pt41TGt1VCFjjmJ74N0=
309+
github.com/vmware/alb-sdk v0.0.0-20231017102949-55cd29c1dd76/go.mod h1:fuRb4saDY/xy/UMeMvyKYmcplNknEL9ysaqYSw7reNE=
302310
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
303311
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
304312
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=

Diff for: website/docs/d/avi_controllerproperties.html.markdown

+2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ In addition to all arguments above, the following attributes are exported:
4747
* `check_vsvip_fqdn_syntax` - Enforce vsvip fqdn syntax checks. Field introduced in 20.1.6. Allowed in enterprise edition with any value, essentials edition with any value, basic edition with any value, enterprise with cloud services edition.
4848
* `cleanup_expired_authtoken_timeout_period` - Period for auth token cleanup job. Field introduced in 18.1.1. Unit is min. Allowed in enterprise edition with any value, essentials, basic, enterprise with cloud services edition.
4949
* `cleanup_sessions_timeout_period` - Period for sessions cleanup job. Field introduced in 18.1.1. Unit is min. Allowed in enterprise edition with any value, essentials, basic, enterprise with cloud services edition.
50+
* `cloud_discovery_interval` - Time in minutes to wait between consecutive cloud discovery cycles. Allowed values are 1-1440. Field introduced in 22.1.5. Unit is min. Allowed in enterprise edition with any value, enterprise with cloud services edition.
5051
* `cloud_reconcile` - Enable/disable periodic reconcile for all the clouds. Field introduced in 17.2.14,18.1.5,18.2.1. Allowed in enterprise edition with any value, essentials, basic, enterprise with cloud services edition.
52+
* `cloud_reconcile_interval` - Time in minutes to wait between consecutive cloud reconcile cycles. Allowed values are 1-1440. Field introduced in 22.1.5. Unit is min. Allowed in enterprise edition with any value, enterprise with cloud services edition.
5153
* `cluster_ip_gratuitous_arp_period` - Period for cluster ip gratuitous arp job. Unit is min. Allowed in enterprise edition with any value, essentials, basic, enterprise with cloud services edition.
5254
* `configpb_attributes` - Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed in enterprise edition with any value, essentials edition with any value, basic edition with any value, enterprise with cloud services edition.
5355
* `consistency_check_timeout_period` - Period for consistency check job. Field introduced in 18.1.1. Unit is min. Allowed in enterprise edition with any value, essentials, basic, enterprise with cloud services edition.

Diff for: website/docs/r/avi_controllerproperties.html.markdown

+2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ The following arguments are supported:
4242
* `check_vsvip_fqdn_syntax` - (Optional) Enforce vsvip fqdn syntax checks. Field introduced in 20.1.6. Allowed in enterprise edition with any value, essentials edition with any value, basic edition with any value, enterprise with cloud services edition.
4343
* `cleanup_expired_authtoken_timeout_period` - (Optional) Period for auth token cleanup job. Field introduced in 18.1.1. Unit is min. Allowed in enterprise edition with any value, essentials, basic, enterprise with cloud services edition.
4444
* `cleanup_sessions_timeout_period` - (Optional) Period for sessions cleanup job. Field introduced in 18.1.1. Unit is min. Allowed in enterprise edition with any value, essentials, basic, enterprise with cloud services edition.
45+
* `cloud_discovery_interval` - (Optional) Time in minutes to wait between consecutive cloud discovery cycles. Allowed values are 1-1440. Field introduced in 22.1.5. Unit is min. Allowed in enterprise edition with any value, enterprise with cloud services edition.
4546
* `cloud_reconcile` - (Optional) Enable/disable periodic reconcile for all the clouds. Field introduced in 17.2.14,18.1.5,18.2.1. Allowed in enterprise edition with any value, essentials, basic, enterprise with cloud services edition.
47+
* `cloud_reconcile_interval` - (Optional) Time in minutes to wait between consecutive cloud reconcile cycles. Allowed values are 1-1440. Field introduced in 22.1.5. Unit is min. Allowed in enterprise edition with any value, enterprise with cloud services edition.
4648
* `cluster_ip_gratuitous_arp_period` - (Optional) Period for cluster ip gratuitous arp job. Unit is min. Allowed in enterprise edition with any value, essentials, basic, enterprise with cloud services edition.
4749
* `configpb_attributes` - (Optional) Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed in enterprise edition with any value, essentials edition with any value, basic edition with any value, enterprise with cloud services edition.
4850
* `consistency_check_timeout_period` - (Optional) Period for consistency check job. Field introduced in 18.1.1. Unit is min. Allowed in enterprise edition with any value, essentials, basic, enterprise with cloud services edition.

0 commit comments

Comments
 (0)