Skip to content

Commit

Permalink
fixed data type of cidr
Browse files Browse the repository at this point in the history
  • Loading branch information
stobias123 committed Jan 6, 2020
1 parent 91ec40f commit 3be8d24
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
docker:
docker build -t stobias123/terraform-provider-orion . && docker push stobias123/terraform-provider-orion
local:
rm test/terraform-provider-orion || true
go build -o test/terraform-provider-orion .
rm example/terraform-provider-orion || true
go build -o example/terraform-provider-orion .
tftest:
rm test/terraform.tfstate* || true
rm -rf test/.terraform || true
rm example/terraform.tfstate* || true
rm -rf example/.terraform || true
cd test
terraform init && terraform apply -auto-approve
terraform init && terraform apply -auto-approve
clean:
rm example/terraform.tfstate* || true
rm -rf example/.terraform || true
rm example/terraform-provider-orion || true
rm example/log || true
3 changes: 2 additions & 1 deletion data_source_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func dataSourceSubnet() *schema.Resource {
Computed: true,
},
"cidr": &schema.Schema{
Type: schema.TypeString,
Type: schema.TypeInt,
Computed: true,
},
"vlan": &schema.Schema{
Expand Down Expand Up @@ -79,6 +79,7 @@ func dataSourceSubnetRead(d *schema.ResourceData, meta interface{}) error {
}

log.Infof("Subnet found: %s", s)
log.Infof("CIDR found: %s", s.CIDR)
d.SetId(s.VLAN)
d.Set("address", s.Address)
d.Set("cidr", s.CIDR)
Expand Down
4 changes: 4 additions & 0 deletions example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ output "orion_ip" {

output "orion_subnet" {
value = data.orion_subnet.test.address
}

output "orion_cidr" {
value = data.orion_subnet.test.cidr
}

0 comments on commit 3be8d24

Please sign in to comment.