Skip to content

Commit

Permalink
## 0.6.6-beta (Sep 21, 2022)
Browse files Browse the repository at this point in the history
FEATURES:
* New provider configuration variable added:
  - **enable_auto_import** (String) Flag to enable or disable terraform automatic import (Automatic import means that when Terraform attempts to create the resource, it will perform a get operation if it founds a matching resource, it will perform an import of the resource it found, this is a similar operation to the terraform import command.) in resources, this is a configuration added to the provider, it uses the ISE_ENABLE_AUTO_IMPORT environment variable; `true` to enable it, defaults to `false`.

BUG FIXES:
* The provider overwrites the configuration to the one in the `tf file` even if it is updated outside of the provider.
* On `resource_sgt` `value` parameter adds new validation, it only allows numbers greatest or equal than `2` and lower or equal than `65519`.
  • Loading branch information
fmunoz committed Sep 21, 2022
1 parent 77f8454 commit 48388aa
Show file tree
Hide file tree
Showing 510 changed files with 13,972 additions and 8,144 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 0.6.6-beta (Sep 21, 2022)

FEATURES:
* New provider configuration variable added:
- **enable_auto_import** (String) Flag to enable or disable terraform automatic import (Automatic import means that when Terraform attempts to create the resource, it will perform a get operation if it founds a matching resource, it will perform an import of the resource it found, this is a similar operation to the terraform import command.) in resources, this is a configuration added to the provider, it uses the ISE_ENABLE_AUTO_IMPORT environment variable; `true` to enable it, defaults to `false`.

BUG FIXES:
* The provider overwrites the configuration to the one in the `tf file` even if it is updated outside of the provider.
* On `resource_sgt` `value` parameter adds new validation, it only allows numbers greatest or equal than `2` and lower or equal than `65519`.

## 0.6.5-beta (Jun 07, 2022)

FEATURES:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HOSTNAME=hashicorp.com
NAMESPACE=edu
NAME=ciscoise
BINARY=terraform-provider-${NAME}
VERSION=0.6.5-beta
VERSION=0.6.6-beta
OS_ARCH=darwin_amd64
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
default: install
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ terraform {
required_providers {
ciscoise = {
source = "CiscoISE/ciscoise"
version = "0.6.5-beta"
version = "0.6.6-beta"
}
}
}
Expand Down Expand Up @@ -67,7 +67,7 @@ terraform {
required_providers {
ciscoise = {
source = "hashicorp.com/edu/ciscoise"
version = "0.6.5-beta"
version = "0.6.6-beta"
}
}
}
Expand Down
18 changes: 17 additions & 1 deletion ciscoise/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ciscoise

import (
"context"
"strconv"
"time"

isegosdk "github.com/CiscoISE/ciscoise-go-sdk/sdk"
Expand All @@ -23,6 +24,11 @@ type Config struct {
RequestTimeout int
}

type ClientConfig struct {
Client *isegosdk.Client
EnableAutoImport bool
}

// NewClient returns a new Cisco Identity Services Engine client.
func (c *Config) NewClient() (*isegosdk.Client, error) {
client, err := isegosdk.NewClientWithOptions(c.BaseURL,
Expand Down Expand Up @@ -63,5 +69,15 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}
})
return nil, diags
}
return client, diags
boolValue, err := strconv.ParseBool(d.Get("enable_auto_import").(string))

if err != nil {
boolValue = false
}

clientConfig := ClientConfig{
Client: client,
EnableAutoImport: boolValue,
}
return clientConfig, diags
}
3 changes: 2 additions & 1 deletion ciscoise/data_source_aci_bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ Filtering will be based on one attribute only, such as ip/sgt/vn/psn/learnedFrom
}

func dataSourceAciBindingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPage, okPage := d.GetOk("page")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_aci_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ func dataSourceAciSettings() *schema.Resource {
}

func dataSourceAciSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics

Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_aci_test_connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ func dataSourceAciTestConnectivity() *schema.Resource {
}

func dataSourceAciTestConnectivityRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics

Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_active_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,8 @@ default value if schema is ACTIVE_DIRECTORY. Values can be changed only for CUST
}

func dataSourceActiveDirectoryRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPage, okPage := d.GetOk("page")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func dataSourceActiveDirectoryGetGroupsByDomainInfo() *schema.Resource {
}

func dataSourceActiveDirectoryGetGroupsByDomainInfoRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vID := d.Get("id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ relationships.
}

func dataSourceActiveDirectoryGetTrustedDomainsInfoRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vID := d.Get("id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func dataSourceActiveDirectoryGetUserGroupsInfo() *schema.Resource {
}

func dataSourceActiveDirectoryGetUserGroupsInfoRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vID := d.Get("id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func dataSourceActiveDirectoryIsUserMemberOfGroup() *schema.Resource {
}

func dataSourceActiveDirectoryIsUserMemberOfGroupRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vID := d.Get("id")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_admin_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ string parameter. Each resource Data model description should specify if an attr
}

func dataSourceAdminUserRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPage, okPage := d.GetOk("page")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_allowed_protocols.go
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,8 @@ Valid range is 0-3`,
}

func dataSourceAllowedProtocolsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPage, okPage := d.GetOk("page")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_anc_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ string parameter. Each resource Data model description should specify if an attr
}

func dataSourceAncEndpointRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPage, okPage := d.GetOk("page")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_anc_endpoint_bulk_monitor_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ func dataSourceAncEndpointBulkMonitorStatus() *schema.Resource {
}

func dataSourceAncEndpointBulkMonitorStatusRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vBulkid := d.Get("bulkid")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_anc_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ string parameter. Each resource Data model description should specify if an attr
}

func dataSourceAncPolicyRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPage, okPage := d.GetOk("page")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_anc_policy_bulk_monitor_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ func dataSourceAncPolicyBulkMonitorStatus() *schema.Resource {
}

func dataSourceAncPolicyBulkMonitorStatusRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vBulkid := d.Get("bulkid")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_authorization_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,8 @@ For all other 'WebRedirectionType' values the field must be ignored`,
}

func dataSourceAuthorizationProfileRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPage, okPage := d.GetOk("page")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_backup_last_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ func dataSourceBackupLastStatus() *schema.Resource {
}

func dataSourceBackupLastStatusRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics

Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_byod_portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,8 @@ Allowed values:
}

func dataSourceByodPortalRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPage, okPage := d.GetOk("page")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_certificate_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ func dataSourceCertificateProfile() *schema.Resource {
}

func dataSourceCertificateProfileRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPage, okPage := d.GetOk("page")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_certificate_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ func dataSourceCertificateTemplate() *schema.Resource {
}

func dataSourceCertificateTemplateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPage, okPage := d.GetOk("page")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_csr.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ Not Contains
}

func dataSourceCsrRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPage, okPage := d.GetOk("page")
Expand Down
5 changes: 2 additions & 3 deletions ciscoise/data_source_csr_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (

"log"

isegosdk "github.com/CiscoISE/ciscoise-go-sdk/sdk"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
Expand Down Expand Up @@ -40,7 +38,8 @@ func dataSourceCsrExport() *schema.Resource {
}

func dataSourceCsrExportRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vHostname := d.Get("hostname")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ func dataSourceDeployment() *schema.Resource {
}

func dataSourceDeploymentRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,8 @@ func dataSourceDeviceAdministrationAuthenticationRules() *schema.Resource {
}

func dataSourceDeviceAdministrationAuthenticationRulesRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPolicyID, okPolicyID := d.GetOk("policy_id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,8 @@ func dataSourceDeviceAdministrationAuthorizationRules() *schema.Resource {
}

func dataSourceDeviceAdministrationAuthorizationRulesRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vPolicyID, okPolicyID := d.GetOk("policy_id")
Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_device_administration_command_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ func dataSourceDeviceAdministrationCommandSet() *schema.Resource {
}

func dataSourceDeviceAdministrationCommandSetRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics

Expand Down
3 changes: 2 additions & 1 deletion ciscoise/data_source_device_administration_conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,8 @@ func dataSourceDeviceAdministrationConditions() *schema.Resource {
}

func dataSourceDeviceAdministrationConditionsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics
vName, okName := d.GetOk("name")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ func dataSourceDeviceAdministrationConditionsForAuthenticationRule() *schema.Res
}

func dataSourceDeviceAdministrationConditionsForAuthenticationRuleRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ func dataSourceDeviceAdministrationConditionsForAuthorizationRule() *schema.Reso
}

func dataSourceDeviceAdministrationConditionsForAuthorizationRuleRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ func dataSourceDeviceAdministrationConditionsForPolicySet() *schema.Resource {
}

func dataSourceDeviceAdministrationConditionsForPolicySetRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ func dataSourceDeviceAdministrationDictionaryAttributesAuthentication() *schema.
}

func dataSourceDeviceAdministrationDictionaryAttributesAuthenticationRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ func dataSourceDeviceAdministrationDictionaryAttributesAuthorization() *schema.R
}

func dataSourceDeviceAdministrationDictionaryAttributesAuthorizationRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*isegosdk.Client)
clientConfig := m.(ClientConfig)
client := clientConfig.Client

var diags diag.Diagnostics

Expand Down
Loading

0 comments on commit 48388aa

Please sign in to comment.