Skip to content

Commit c6618f5

Browse files
authored
Merge pull request #4 from pan-akushwah/main
complete revamp changes for terraform provider with new architecture and auto code generation
2 parents 8828125 + 1f76d7e commit c6618f5

File tree

526 files changed

+321550
-622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

526 files changed

+321550
-622
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Release
66
on:
77
push:
88
tags:
9-
- 'v*.*.*'
9+
- 'v*.*.*.*-*'
1010
workflow_dispatch:
1111

1212
# Releases need permissions to read and write the repository contents.

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*.dll
88
*.so
99
*.dylib
10-
10+
.idea
1111
# Test binary, built with `go test -c`
1212
*.test
1313

@@ -29,3 +29,9 @@ terraform.tfstate*
2929
# Others
3030
.DS_Store
3131
*.swp
32+
33+
*.tfstate
34+
.vscode/
35+
/internal/provider/provider.sources.txt
36+
/examples/*.tf
37+
/examples/test*/*.tf

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ verbose:
99
bench:
1010
go test -v -bench . ./...
1111

12-
fmt:
13-
find . -type f -name \*.go | xargs gofmt -w
14-
15-
docs:
16-
go generate
12+
clean:
13+
rm -rf internal/provider/*_rs.go
14+
rm -rf internal/provider/*_ds.go
15+
rm -rf docs/resources/*.md
16+
rm -rf examples/resources/prismasdwan_*tf
1717

18+
build:
19+
gofmt -s -w .
20+
go build
21+
1822
.PHONY: test verbose bench fmt docs

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ Building the Provider
1414

1515
1. Install [Go](https://go.dev/dl)
1616

17-
2. Clone the SDK repo:
18-
19-
```sh
20-
git clone https://github.com/paloaltonetworks/scm-go
21-
```
22-
23-
3. Clone this repo:
17+
2. Clone this repo:
2418

2519
```sh
2620
git clone https://github.com/paloaltonetworks/terraform-provider-prismasdwan
@@ -30,7 +24,7 @@ git clone https://github.com/paloaltonetworks/terraform-provider-prismasdwan
3024

3125
```sh
3226
cd terraform-provider-prismasdwan
33-
go build
27+
make build
3428
```
3529

3630
5. Specify the `dev_overrides` configuration per the next section below. This tells Terraform where to find the provider you just built. The directory to specify is the full path to the cloned provider repo.
@@ -46,7 +40,7 @@ To do this, create/populate a Terraform CLI configuration file (`~/.terraformrc`
4640
```hcl
4741
provider_installation {
4842
dev_overrides {
49-
"registry.terraform.io/paloaltonetworks-local/prismasdwan" = "/directory/containing/the/provider/binary/here"
43+
"registry.terraform.io/paloaltonetworks-local/prismasdwan" = "/path/to/cloned/repo/terraform-provider-prismasdwan"
5044
}
5145
5246
direct {}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "sdwan_bulk_config_create Data Source - prismasdwan"
4+
subcategory: ""
5+
description: |-
6+
Retrieves a config item.
7+
---
8+
9+
# sdwan_bulk_config_create (Data Source)
10+
11+
Retrieves a config item.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `site_template_id` (String) Site Template Id.
21+
22+
### Read-Only
23+
24+
- `data` (String) Data.
25+
- `etag` (Number) Entity tag for the resource.
26+
- `id` (String) Id.
27+
- `site_id` (String) Site Id: Digits(fraction = 0, integer = 50, SITEID_INVALID) .
28+
- `site_type` (String) Site Type: Required(error = SITE_ROLE_MISSING: Site role missing.) ValidateEnum(enumClass = classOf[ElementClusterRole], error = INVALID_SITE_TYPE: Invalid site type, nullAllowed = false) .
29+
- `template_description` (String) Template Description: Size(max = 256, error = DESCRIPTION_EXCEEDS_LIMIT: Description length exceeds limit, min = 0) .
30+
- `template_name` (String) Template Name: Required(error = TEMPLATE_NAME_REQUIRED: Template name missing) Size(max = 128, error = NAME_EXCEEDS_LIMIT: Name of the resource exceeds limit., min = 0) .
31+
- `tfid` (String) The Terraform ID.
32+
- `variable_map` (Boolean) The VariableMap param. Default: `false`.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "sdwan_bulk_config_push Data Source - prismasdwan"
4+
subcategory: ""
5+
description: |-
6+
Retrieves a config item.
7+
---
8+
9+
# sdwan_bulk_config_push (Data Source)
10+
11+
Retrieves a config item.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `deployment_id` (String) Deployment Id.
21+
- `site_template_id` (String) Site Template Id.
22+
23+
### Read-Only
24+
25+
- `etag` (Number) Entity tag for the resource.
26+
- `id` (String) Id.
27+
- `tfid` (String) The Terraform ID.
28+
- `variable_map` (List of Boolean) Variable Map.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "sdwan_bulk_config_status Data Source - prismasdwan"
4+
subcategory: ""
5+
description: |-
6+
Retrieves a config item.
7+
---
8+
9+
# sdwan_bulk_config_status (Data Source)
10+
11+
Retrieves a config item.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `site_template_id` (String) Site Template Id.
21+
22+
### Read-Only
23+
24+
- `etag` (Number) Entity tag for the resource.
25+
- `id` (String) Id.
26+
- `status` (String) Status.
27+
- `status_description` (String) Status Description.
28+
- `tfid` (String) The Terraform ID.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "sdwan_dhcp_server Data Source - prismasdwan"
4+
subcategory: ""
5+
description: |-
6+
Retrieves a config item.
7+
---
8+
9+
# sdwan_dhcp_server (Data Source)
10+
11+
Retrieves a config item.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `dhcp_server_id` (String) Dhcp Server Id.
21+
- `site_id` (String) Site Id.
22+
23+
### Read-Only
24+
25+
- `address_family` (String) Address Family: ValidateEnum(enumClass = classOf[IPAddressFamily], DHCP_CONFIG_ADDRESS_FAMILY_INVALID, nullAllowed = false) .
26+
- `broadcast_address` (String) Broadcast Address.
27+
- `custom_options` (Attributes List) Custom Options: Valid . (see [below for nested schema](#nestedatt--custom_options))
28+
- `default_lease_time` (Number) Default Lease Time: Min(error = DHCPSERVER_CONFIG_UNSUPPORTED_DEFAULT_LEASE_TIME: Default lease time should be between 300 and 2^32-1 seconds respectively., value = 300L) Max(error = DHCPSERVER_CONFIG_UNSUPPORTED_DEFAULT_LEASE_TIME: Default lease time should be between 300 and 2^32-1 seconds respectively., value = 4294967295L) .
29+
- `description` (String) Description: Size(max = 256, error = DHCPSERVER_CONFIG_DESCRIPTION_EXCEEDS_LIMIT: Description length exceeds the maximum limit., min = 0) .
30+
- `disabled` (Boolean) Disabled.
31+
- `dns_servers` (List of String) Dns Servers: Size(max = 3, error = DHCPSERVER_CONFIG_DNS_ENTRIES_EXCEEDS_LIMIT: Name servers count exceeds the maximum limit, min = 0) .
32+
- `domain_name` (String) Domain Name: Size(max = 256, error = DHCPSERVER_CONFIG_INVALID_DOMAIN_NAME: Domain name exceeds the maximum limit., min = 0) .
33+
- `etag` (Number) Entity tag for the resource.
34+
- `gateway` (String) Gateway.
35+
- `id` (String) Id.
36+
- `ip_ranges` (Attributes List) Ip Ranges: NotNull(error = DHCPSERVER_CONFIG_IP_RANGE_MISSING: Provide valid IPv4/IPv6 address range for defined subnet.) Size(max = 2147483647, error = DHCPSERVER_CONFIG_IP_RANGE_MISSING: Provide valid IPv4/IPv6 address range for defined subnet., min = 1) Valid . (see [below for nested schema](#nestedatt--ip_ranges))
37+
- `max_lease_time` (Number) Max Lease Time: Min(error = DHCPSERVER_CONFIG_UNSUPPORTED_MAX_LEASE_TIME: Max lease time should be between 300 and 2^32-1 seconds respectively., value = 300L) Max(error = DHCPSERVER_CONFIG_UNSUPPORTED_MAX_LEASE_TIME: Max lease time should be between 300 and 2^32-1 seconds respectively., value = 4294967295L) .
38+
- `network_context_id` (String) Network Context Id: Digits(fraction = 0, integer = 50, error = INVALID_NETWORK_CTX_ID: Invalid network ctrx id.) .
39+
- `static_mappings` (Attributes List) Static Mappings: Valid . (see [below for nested schema](#nestedatt--static_mappings))
40+
- `subnet` (String) Subnet: NotNull(error = DHCPSERVER_CONFIG_INVALID_SUBNET_ADDR: Invalid IPv4 subnet address.) .
41+
- `tags` (List of String) Tags: ListString(allowDuplicate = false, allowEmpty = true, allowNull = true, length = 128, listMaxSize = 10, error = DHCPSERVER_CONFIG_INVALID_TAGS: Tags config is invalid- maximum 10 tags are supported, tag should not exceed maximum limit of 128 characters, it should not have duplicates., noTrim = false, regex = [^,\\s]+, required = false) .
42+
- `tfid` (String) The Terraform ID.
43+
- `vrf_context_id` (String) Vrf Context Id.
44+
45+
<a id="nestedatt--custom_options"></a>
46+
### Nested Schema for `custom_options`
47+
48+
Read-Only:
49+
50+
- `option_definition` (String) Option Definition: NotEmpty(groups = [classOf[Definition]], error = DHCPSERVER_CONFIG_CUSTOM_OPTIONS_DEF_UNSUPPORTED: Custom option definition is not supported) Size(groups = [classOf[Definition]], max = 1024, error = DHCPSERVER_CONFIG_OPTION_DEF_EXCEEDS_LIMIT: Custom option definition length exceeeds maximum limit, min = 0) .
51+
- `option_value` (String) Option Value: NotEmpty(groups = [classOf[Value]], error = DHCPSERVER_CONFIG_CUSTOM_OPTIONS_VAL_UNSUPPORTED: Custom option value is not supported) Size(groups = [classOf[Value]], max = 8192, error = DHCPSERVER_CONFIG_OPTION_VAL_EXCEEDS_LIMIT: Custom option value length exceeds maximum limit, min = 0) .
52+
- `vendor_class_identifier` (String) Vendor Class Identifier.
53+
54+
55+
<a id="nestedatt--ip_ranges"></a>
56+
### Nested Schema for `ip_ranges`
57+
58+
Read-Only:
59+
60+
- `end_ip` (String) End Ip: NotNull(error = DHCPSERVER_CONFIG_IP_RANGE_MISSING: Provide valid IPv4/IPv6 address range for defined subnet.) .
61+
- `start_ip` (String) Start Ip: NotNull(error = DHCPSERVER_CONFIG_IP_RANGE_MISSING: Provide valid IPv4/IPv6 address range for defined subnet.) .
62+
63+
64+
<a id="nestedatt--static_mappings"></a>
65+
### Nested Schema for `static_mappings`
66+
67+
Read-Only:
68+
69+
- `client_duid` (String) Client Duid: Pattern(error = DHCPSERVER_CONFIG_INVALID_STATIC_MAPPING_DUID: Invalid Client duid provided for static mapping., regexp = ([0-9a-fA-F]{1,2}:)*[0-9a-fA-F]{1,2}|([0-9a-fA-F]{1,2}:)*(:([0-9a-fA-F]{1,2}:)*)([0-9a-fA-F]{1,2})*) .
70+
- `ip_address` (String) Ip Address: NotNull(error = DHCPSERVER_CONFIG_STATIC_MAPPING_MISSING: Provide all required attributes for static mappings.) .
71+
- `mac` (String) Mac: MACAddressFiveColons(error = DHCPSERVER_CONFIG_INVALID_STATIC_MAPPING_MAC_ADDR: Invalid mac address provided for static mapping) .
72+
- `name` (String) Name: NotNull(error = DHCPSERVER_CONFIG_STATIC_MAPPING_MISSING: Provide all required attributes for static mappings.) Size(max = 256, error = DHCPSERVER_CONFIG_STATIC_MAPPING_NAME_EXCEEDS_LIMIT: Static Mapping name execeeds the maximum limit, min = 0) Pattern(error = DHCPSERVER_CONFIG_STATIC_MAPPING_UNSUPPORTED_NAME: Provide valid static mapping name, regexp = ^[a-zA-Z0-9]+(([a-zA-Z0-9\\-_])|(\\.?[a-zA-Z0-9\\-]))*\\.?$) .
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "sdwan_dhcp_server_list Data Source - prismasdwan"
4+
subcategory: ""
5+
description: |-
6+
Retrieves a listing of config items.
7+
---
8+
9+
# sdwan_dhcp_server_list (Data Source)
10+
11+
Retrieves a listing of config items.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `site_id` (String) Site Id.
21+
22+
### Read-Only
23+
24+
- `items` (Attributes List) The Items param. (see [below for nested schema](#nestedatt--items))
25+
- `tfid` (String) The Terraform ID.
26+
- `total_items` (Number) The TotalItems param.
27+
28+
<a id="nestedatt--items"></a>
29+
### Nested Schema for `items`
30+
31+
Read-Only:
32+
33+
- `address_family` (String) Address Family: ValidateEnum(enumClass = classOf[IPAddressFamily], DHCP_CONFIG_ADDRESS_FAMILY_INVALID, nullAllowed = false) .
34+
- `broadcast_address` (String) Broadcast Address.
35+
- `custom_options` (Attributes List) Custom Options: Valid . (see [below for nested schema](#nestedatt--items--custom_options))
36+
- `default_lease_time` (Number) Default Lease Time: Min(error = DHCPSERVER_CONFIG_UNSUPPORTED_DEFAULT_LEASE_TIME: Default lease time should be between 300 and 2^32-1 seconds respectively., value = 300L) Max(error = DHCPSERVER_CONFIG_UNSUPPORTED_DEFAULT_LEASE_TIME: Default lease time should be between 300 and 2^32-1 seconds respectively., value = 4294967295L) .
37+
- `description` (String) Description: Size(max = 256, error = DHCPSERVER_CONFIG_DESCRIPTION_EXCEEDS_LIMIT: Description length exceeds the maximum limit., min = 0) .
38+
- `disabled` (Boolean) Disabled.
39+
- `dns_servers` (List of String) Dns Servers: Size(max = 3, error = DHCPSERVER_CONFIG_DNS_ENTRIES_EXCEEDS_LIMIT: Name servers count exceeds the maximum limit, min = 0) .
40+
- `domain_name` (String) Domain Name: Size(max = 256, error = DHCPSERVER_CONFIG_INVALID_DOMAIN_NAME: Domain name exceeds the maximum limit., min = 0) .
41+
- `etag` (Number) Entity tag for the resource.
42+
- `gateway` (String) Gateway.
43+
- `id` (String) Id.
44+
- `ip_ranges` (Attributes List) Ip Ranges: NotNull(error = DHCPSERVER_CONFIG_IP_RANGE_MISSING: Provide valid IPv4/IPv6 address range for defined subnet.) Size(max = 2147483647, error = DHCPSERVER_CONFIG_IP_RANGE_MISSING: Provide valid IPv4/IPv6 address range for defined subnet., min = 1) Valid . (see [below for nested schema](#nestedatt--items--ip_ranges))
45+
- `max_lease_time` (Number) Max Lease Time: Min(error = DHCPSERVER_CONFIG_UNSUPPORTED_MAX_LEASE_TIME: Max lease time should be between 300 and 2^32-1 seconds respectively., value = 300L) Max(error = DHCPSERVER_CONFIG_UNSUPPORTED_MAX_LEASE_TIME: Max lease time should be between 300 and 2^32-1 seconds respectively., value = 4294967295L) .
46+
- `network_context_id` (String) Network Context Id: Digits(fraction = 0, integer = 50, error = INVALID_NETWORK_CTX_ID: Invalid network ctrx id.) .
47+
- `static_mappings` (Attributes List) Static Mappings: Valid . (see [below for nested schema](#nestedatt--items--static_mappings))
48+
- `subnet` (String) Subnet: NotNull(error = DHCPSERVER_CONFIG_INVALID_SUBNET_ADDR: Invalid IPv4 subnet address.) .
49+
- `tags` (List of String) Tags: ListString(allowDuplicate = false, allowEmpty = true, allowNull = true, length = 128, listMaxSize = 10, error = DHCPSERVER_CONFIG_INVALID_TAGS: Tags config is invalid- maximum 10 tags are supported, tag should not exceed maximum limit of 128 characters, it should not have duplicates., noTrim = false, regex = [^,\\s]+, required = false) .
50+
- `vrf_context_id` (String) Vrf Context Id.
51+
52+
<a id="nestedatt--items--custom_options"></a>
53+
### Nested Schema for `items.custom_options`
54+
55+
Read-Only:
56+
57+
- `option_definition` (String) Option Definition: NotEmpty(groups = [classOf[Definition]], error = DHCPSERVER_CONFIG_CUSTOM_OPTIONS_DEF_UNSUPPORTED: Custom option definition is not supported) Size(groups = [classOf[Definition]], max = 1024, error = DHCPSERVER_CONFIG_OPTION_DEF_EXCEEDS_LIMIT: Custom option definition length exceeeds maximum limit, min = 0) .
58+
- `option_value` (String) Option Value: NotEmpty(groups = [classOf[Value]], error = DHCPSERVER_CONFIG_CUSTOM_OPTIONS_VAL_UNSUPPORTED: Custom option value is not supported) Size(groups = [classOf[Value]], max = 8192, error = DHCPSERVER_CONFIG_OPTION_VAL_EXCEEDS_LIMIT: Custom option value length exceeds maximum limit, min = 0) .
59+
- `vendor_class_identifier` (String) Vendor Class Identifier.
60+
61+
62+
<a id="nestedatt--items--ip_ranges"></a>
63+
### Nested Schema for `items.ip_ranges`
64+
65+
Read-Only:
66+
67+
- `end_ip` (String) End Ip: NotNull(error = DHCPSERVER_CONFIG_IP_RANGE_MISSING: Provide valid IPv4/IPv6 address range for defined subnet.) .
68+
- `start_ip` (String) Start Ip: NotNull(error = DHCPSERVER_CONFIG_IP_RANGE_MISSING: Provide valid IPv4/IPv6 address range for defined subnet.) .
69+
70+
71+
<a id="nestedatt--items--static_mappings"></a>
72+
### Nested Schema for `items.static_mappings`
73+
74+
Read-Only:
75+
76+
- `client_duid` (String) Client Duid: Pattern(error = DHCPSERVER_CONFIG_INVALID_STATIC_MAPPING_DUID: Invalid Client duid provided for static mapping., regexp = ([0-9a-fA-F]{1,2}:)*[0-9a-fA-F]{1,2}|([0-9a-fA-F]{1,2}:)*(:([0-9a-fA-F]{1,2}:)*)([0-9a-fA-F]{1,2})*) .
77+
- `ip_address` (String) Ip Address: NotNull(error = DHCPSERVER_CONFIG_STATIC_MAPPING_MISSING: Provide all required attributes for static mappings.) .
78+
- `mac` (String) Mac: MACAddressFiveColons(error = DHCPSERVER_CONFIG_INVALID_STATIC_MAPPING_MAC_ADDR: Invalid mac address provided for static mapping) .
79+
- `name` (String) Name: NotNull(error = DHCPSERVER_CONFIG_STATIC_MAPPING_MISSING: Provide all required attributes for static mappings.) Size(max = 256, error = DHCPSERVER_CONFIG_STATIC_MAPPING_NAME_EXCEEDS_LIMIT: Static Mapping name execeeds the maximum limit, min = 0) Pattern(error = DHCPSERVER_CONFIG_STATIC_MAPPING_UNSUPPORTED_NAME: Provide valid static mapping name, regexp = ^[a-zA-Z0-9]+(([a-zA-Z0-9\\-_])|(\\.?[a-zA-Z0-9\\-]))*\\.?$) .

0 commit comments

Comments
 (0)