From 9a647868ef227631d3d7e38d235c5f2fcc878d2b Mon Sep 17 00:00:00 2001 From: Dimitrios Karagiannis Date: Wed, 12 Feb 2020 16:36:30 +0000 Subject: [PATCH] megaport_mcr: set term attribute if mcr is v1.x Signed-off-by: Dimitrios Karagiannis --- megaport/resource_megaport_mcr.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/megaport/resource_megaport_mcr.go b/megaport/resource_megaport_mcr.go index 69f6db3..e9067d6 100644 --- a/megaport/resource_megaport_mcr.go +++ b/megaport/resource_megaport_mcr.go @@ -74,6 +74,11 @@ func resourceMegaportMcrRead(d *schema.ResourceData, m interface{}) error { if err := d.Set("mcr_version", p.McrVersion()); err != nil { return err } + if p.McrVersion() == 1 { + if err := d.Set("term", int(p.ContractTermMonths)); err != nil { + return err + } + } if err := d.Set("location_id", int(p.LocationId)); err != nil { return err }