Skip to content

Commit

Permalink
Merge pull request linode#153 from Charliekenney23/feat/firewalls
Browse files Browse the repository at this point in the history
add linode_firewall resource
  • Loading branch information
0xch4z committed May 26, 2020
2 parents 1962184 + 28ace9d commit 5c3b788
Show file tree
Hide file tree
Showing 8 changed files with 714 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/hashicorp/hcl/v2 v2.3.0 // indirect
github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 // indirect
github.com/hashicorp/terraform-plugin-sdk v1.11.0
github.com/linode/linodego v0.15.0
github.com/linode/linodego v0.17.0
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/linode/linodego v0.15.0 h1:hIPphfUvQlheBEV2YbTQQ1KUPE5LPe0EDHvoySwuiu4=
github.com/linode/linodego v0.15.0/go.mod h1:vlzb2glsL9XrRYTRJ5JrgUoKZ5yfZBe11GYfEB68McY=
github.com/linode/linodego v0.17.0 h1:YP6ItAMRCW46leDJaHK1qlIR6hBhuZ+wRqIWxn67/Ag=
github.com/linode/linodego v0.17.0/go.mod h1:vlzb2glsL9XrRYTRJ5JrgUoKZ5yfZBe11GYfEB68McY=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
Expand Down
31 changes: 31 additions & 0 deletions linode/expand.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package linode

import "github.com/hashicorp/terraform-plugin-sdk/helper/schema"

func expandStringList(list []interface{}) []string {
slice := make([]string, 0, len(list))
for _, s := range list {
if val, ok := s.(string); ok && val != "" {
slice = append(slice, val)
}
}
return slice
}

func expandStringSet(set *schema.Set) []string {
return expandStringList(set.List())
}

func expandIntList(list []interface{}) []int {
slice := make([]int, 0, len(list))
for _, n := range list {
if val, ok := n.(int); ok {
slice = append(slice, val)
}
}
return slice
}

func expandIntSet(set *schema.Set) []int {
return expandIntList(set.List())
}
1 change: 1 addition & 0 deletions linode/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func Provider() terraform.ResourceProvider {
ResourcesMap: map[string]*schema.Resource{
"linode_domain": resourceLinodeDomain(),
"linode_domain_record": resourceLinodeDomainRecord(),
"linode_firewall": resourceLinodeFirewall(),
"linode_image": resourceLinodeImage(),
"linode_instance": resourceLinodeInstance(),
"linode_lke_cluster": resourceLinodeLKECluster(),
Expand Down
Loading

0 comments on commit 5c3b788

Please sign in to comment.