Skip to content

Commit

Permalink
Release v3.4.0 (#35)
Browse files Browse the repository at this point in the history
New Features:
 - Introduced new resource types: netris_servercluster and netris_serverclustertemplate
 - Added the flavor and the role arguments in the netris_softgate resource
  • Loading branch information
pogossian authored Aug 30, 2024
1 parent 9504dde commit 7101688
Show file tree
Hide file tree
Showing 11 changed files with 785 additions and 32 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HOSTNAME=registry.terraform.io
NAMESPACE=netrisai
NAME=netris
BINARY=terraform-provider-${NAME}
VERSION=3.3.0
VERSION=3.4.0
OS_ARCH=darwin_arm64
WORKDIRECTORY=examples

Expand All @@ -27,7 +27,7 @@ init: install
cd ${WORKDIRECTORY} && terraform init

apply: init
cd ${WORKDIRECTORY} && terraform apply -auto-approve
cd ${WORKDIRECTORY} && terraform apply

plan: init
cd ${WORKDIRECTORY} && terraform plan
Expand Down
4 changes: 4 additions & 0 deletions docs/resources/softgate.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ resource "netris_softgate" "my-softgate" {
profileid = data.netris_inventory_profile.my-profile.id
mainip = "auto"
mgmtip = "192.0.2.11"
# flavor = "sg-hs"
# role = "snat"
depends_on = [
netris_subnet.my-subnet-mgmt,
netris_subnet.my-subnet-loopback,
Expand All @@ -64,3 +66,5 @@ resource "netris_softgate" "my-softgate" {

- **description** (String) Softgate description.
- **profileid** (Number) An inventory profile ID to define global configuration (NTP, DNS, timezone, etc...)
- **flavor** (String) Softgate's flavor. Valid values are `sg`, `sg-pro` or `sg-hs`. The default value is `sg`.
- **role** (String) Softgate's role. Only when flavor == `sg-hs` Valid values are `general` or `snat`. The default value is `general`.
12 changes: 12 additions & 0 deletions examples/servercluster_example.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "netris_servercluster" "my-servercluster1" {
name = "my-servercluster1"
adminid = data.netris_tenant.admin.id
siteid = netris_site.santa-clara.id
# vpcid = netris_vpc.my-vpc.id
templateid = netris_serverclustertemplate.my-serverclustertemplate1.id
tags = ["boo", "foo"]
servers = [
netris_server.my-server01.id,
# netris_server.my-server02.id,
]
}
44 changes: 44 additions & 0 deletions examples/serverclustertemplate_example.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
resource "netris_serverclustertemplate" "my-serverclustertemplate1" {
name = "my-serverclustertemplate1"
vnets = jsonencode(
[
{
"postfix" : "East-West",
"serverNics" : [
"eth1",
"eth2",
"eth3",
"eth4",
"eth5",
"eth6",
"eth7",
"eth8"
],
"type" : "l3vpn",
"vlan" : "untagged",
"vlanID" : "auto"
},
{
"ipv4Gateway" : "192.168.0.254/24",
"postfix" : "North-South-in-band-and-storage",
"serverNics" : [
"eth9",
"eth10"
],
"type" : "l2vpn",
"vlan" : "untagged",
"vlanID" : "auto"
},
{
"ipv4Gateway" : "192.168.10.254/24",
"postfix" : "OOB-Management",
"serverNics" : [
"eth13"
],
"type" : "l2vpn",
"vlan" : "untagged",
"vlanID" : "auto"
}
]
)
}
16 changes: 16 additions & 0 deletions examples/softgate_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,19 @@ resource "netris_softgate" "my-softgate02" {
netris_subnet.my-subnet-loopback,
]
}

resource "netris_softgate" "my-softgate03" {
name = "my-softgate03"
tenantid = data.netris_tenant.admin.id
siteid = netris_site.santa-clara.id
description = "Softgate 3 HS"
profileid = netris_inventory_profile.my-profile.id
mainip = "auto"
mgmtip = "auto"
flavor = "sg-hs"
# role = "snat"
depends_on = [
netris_subnet.my-subnet-mgmt,
netris_subnet.my-subnet-loopback,
]
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
github.com/hashicorp/terraform-plugin-sdk v1.17.2
github.com/netrisai/netriswebapi v0.0.0-20240624201752-7537b8c6ef39
github.com/netrisai/netriswebapi v0.0.0-20240829195911-a229c1ed9c3d

)

Expand Down
28 changes: 28 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,34 @@ github.com/netrisai/netriswebapi v0.0.0-20240621231958-81424d0be8e5 h1:DDMixgsSS
github.com/netrisai/netriswebapi v0.0.0-20240621231958-81424d0be8e5/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240624201752-7537b8c6ef39 h1:DKdfwcFtv0DZm1x83QHTLkSKW8aYpMZTFbfPbjGkgO4=
github.com/netrisai/netriswebapi v0.0.0-20240624201752-7537b8c6ef39/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240701210406-ad73955ae992 h1:2Va56gsHy75PKiBkBxzWfmSUmD701pBG0/5dT0kQomc=
github.com/netrisai/netriswebapi v0.0.0-20240701210406-ad73955ae992/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240701220119-41fde49f20c9 h1:gadBXALRMnshtVbUdb3VxdoiGU6Z+Wsv14W4CEvlrRc=
github.com/netrisai/netriswebapi v0.0.0-20240701220119-41fde49f20c9/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240702181736-9a1e451283e7 h1:vkK49maVvhPD6TpqeWvtmhgEFLA0ad4sqUyRon99C+U=
github.com/netrisai/netriswebapi v0.0.0-20240702181736-9a1e451283e7/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240703015542-91cc7a37d546 h1:g3jsRGSa9qZC+opCsWroqfpnQ5y6ozIuLNTq/z2KaZE=
github.com/netrisai/netriswebapi v0.0.0-20240703015542-91cc7a37d546/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240703221045-0453d03ee3b0 h1:n4FnD7pQc5xc4xD5tmF38iPovgV1XvPhF3hybYKp3/E=
github.com/netrisai/netriswebapi v0.0.0-20240703221045-0453d03ee3b0/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240705170221-19b3f814c5df h1:GliVO+qxw75WNfZaMIEWit1Ss9bCDWli0lgKlCVNVTk=
github.com/netrisai/netriswebapi v0.0.0-20240705170221-19b3f814c5df/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240705215344-9a4c0a76c6a9 h1:0doNkDJdiyXbiPj/LBWb9/Wca4VcmGtcHgXzLh3E/SI=
github.com/netrisai/netriswebapi v0.0.0-20240705215344-9a4c0a76c6a9/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240705224217-360bb235b6b1 h1:XQaVJODw1fOJDUWBL1wxuUpqzPyRbAnsrCiCkfIv2M0=
github.com/netrisai/netriswebapi v0.0.0-20240705224217-360bb235b6b1/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240705230033-c9abf9b65b5c h1:ICARm3NWu5sPXYRotrZja0+eQ4S8miD5r1xVZ6lIwmg=
github.com/netrisai/netriswebapi v0.0.0-20240705230033-c9abf9b65b5c/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240705231342-f57062246765 h1:Oqnw+McIGUTbEnrOTiGWfzGffFfgpr8M7ZbpmXoWtW8=
github.com/netrisai/netriswebapi v0.0.0-20240705231342-f57062246765/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240709183005-574b327d7bdb h1:dJmrZ1CHR55SZ2sdFJ4uZElf5PqpeCsRRaJpfNiFlwM=
github.com/netrisai/netriswebapi v0.0.0-20240709183005-574b327d7bdb/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240709183133-e22fd70196e8 h1:A5dgIswvJCcxDBTDmpodY7yOEqimXMSw9Lz58K5DmwU=
github.com/netrisai/netriswebapi v0.0.0-20240709183133-e22fd70196e8/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240829015755-e99db53a40ef h1:PcFJ0n8O0fpTYjQS/AWis1v9tuzM5lE0uOZXRdK5X5o=
github.com/netrisai/netriswebapi v0.0.0-20240829015755-e99db53a40ef/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240829195911-a229c1ed9c3d h1:oioJ5wHmRe5k7O+I6Wi9H59VCtAMvV/t6SBqP0OKY38=
github.com/netrisai/netriswebapi v0.0.0-20240829195911-a229c1ed9c3d/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
Expand Down
62 changes: 33 additions & 29 deletions netris/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import (
"github.com/netrisai/terraform-provider-netris/netris/route"
"github.com/netrisai/terraform-provider-netris/netris/routemap"
"github.com/netrisai/terraform-provider-netris/netris/server"
"github.com/netrisai/terraform-provider-netris/netris/servercluster"
"github.com/netrisai/terraform-provider-netris/netris/serverclustertemplate"
"github.com/netrisai/terraform-provider-netris/netris/site"
"github.com/netrisai/terraform-provider-netris/netris/softgate"
"github.com/netrisai/terraform-provider-netris/netris/subnet"
Expand Down Expand Up @@ -72,35 +74,37 @@ func Provider() terraform.ResourceProvider {
},
},
ResourcesMap: map[string]*schema.Resource{
"netris_vnet": vnet.Resource(),
"netris_bgp": bgp.Resource(),
"netris_l4lb": l4lb.Resource(),
"netris_allocation": allocation.Resource(),
"netris_subnet": subnet.Resource(),
"netris_tenant": tenant.Resource(),
"netris_switch": sw.Resource(),
"netris_controller": controller.Resource(),
"netris_softgate": softgate.Resource(),
"netris_server": server.Resource(),
"netris_user_role": userrole.Resource(),
"netris_user": user.Resource(),
"netris_permission_group": pgroup.Resource(),
"netris_acl": acl.Resource(),
"netris_roh": roh.Resource(),
"netris_portgroup": portgroup.Resource(),
"netris_inventory_profile": inventoryprofile.Resource(),
"netris_bgp_object": bgpobject.Resource(),
"netris_site": site.Resource(),
"netris_routemap": routemap.Resource(),
"netris_link": link.Resource(),
"netris_nat": nat.Resource(),
"netris_port": port.Resource(),
"netris_network_interface": networkinterface.Resource(),
"netris_route": route.Resource(),
"netris_acltwozero": acl2.Resource(),
"netris_dhcp_option_set": dhcpoptionset.Resource(),
"netris_vpc": vpc.Resource(),
"netris_lag": lag.Resource(),
"netris_vnet": vnet.Resource(),
"netris_bgp": bgp.Resource(),
"netris_l4lb": l4lb.Resource(),
"netris_allocation": allocation.Resource(),
"netris_subnet": subnet.Resource(),
"netris_tenant": tenant.Resource(),
"netris_switch": sw.Resource(),
"netris_controller": controller.Resource(),
"netris_softgate": softgate.Resource(),
"netris_server": server.Resource(),
"netris_user_role": userrole.Resource(),
"netris_user": user.Resource(),
"netris_permission_group": pgroup.Resource(),
"netris_acl": acl.Resource(),
"netris_roh": roh.Resource(),
"netris_portgroup": portgroup.Resource(),
"netris_inventory_profile": inventoryprofile.Resource(),
"netris_bgp_object": bgpobject.Resource(),
"netris_site": site.Resource(),
"netris_routemap": routemap.Resource(),
"netris_link": link.Resource(),
"netris_nat": nat.Resource(),
"netris_port": port.Resource(),
"netris_network_interface": networkinterface.Resource(),
"netris_route": route.Resource(),
"netris_acltwozero": acl2.Resource(),
"netris_dhcp_option_set": dhcpoptionset.Resource(),
"netris_vpc": vpc.Resource(),
"netris_lag": lag.Resource(),
"netris_servercluster": servercluster.Resource(),
"netris_serverclustertemplate": serverclustertemplate.Resource(),
},
DataSourcesMap: map[string]*schema.Resource{
"netris_site": site.DataResource(),
Expand Down
Loading

0 comments on commit 7101688

Please sign in to comment.