diff --git a/internal/teclient/models.go b/internal/teclient/models.go index a4ae56d..7332bf4 100644 --- a/internal/teclient/models.go +++ b/internal/teclient/models.go @@ -109,6 +109,7 @@ type VCLConfAPIModel struct { type NewVCLConfAPIModel struct { VCLCode string `json:"config_body"` + Comment string `json:"comment"` } // Certificates diff --git a/internal/teclient/vclconfs.go b/internal/teclient/vclconfs.go index 071b415..cbe2434 100644 --- a/internal/teclient/vclconfs.go +++ b/internal/teclient/vclconfs.go @@ -50,6 +50,11 @@ func (c *Client) GetActiveVCLConf(environment APIEnvironment) (*VCLConfAPIModel, func (c *Client) CreateVclconf(vclconf NewVCLConfAPIModel, environment APIEnvironment) (*VCLConfAPIModel, error) { envpath := c.MustGetAPIEnvironmentPath(environment) + + // Add a fixed comment to annotate that this configuration is being managed by terraform + // TODO: consider porting this to the state in the future + vclconf.Comment = fmt.Sprintf("Managed with %s", c.UserAgent) + req, err := c.prepareJSONRequest(vclconf, "POST", fmt.Sprintf("%s/v1/%s/%d/config/", c.HostURL, envpath, c.CompanyId)) if err != nil { return nil, err