@@ -2,6 +2,7 @@ package frontendo11y
2
2
3
3
import (
4
4
"context"
5
+ "fmt"
5
6
6
7
"github.com/hashicorp/terraform-plugin-framework/attr"
7
8
"github.com/hashicorp/terraform-plugin-framework/diag"
@@ -17,6 +18,7 @@ type FrontendO11yAppTFModel struct {
17
18
AllowedOrigins types.List `tfsdk:"allowed_origins"`
18
19
ExtraLogAtrributes types.Map `tfsdk:"extra_log_attributes"`
19
20
Settings types.Map `tfsdk:"settings"`
21
+ CollectorEndpoint types.String `tfsdk:"collector_endpoint"`
20
22
}
21
23
22
24
// toClientModel converts a FrontendO11yAppTFModel instance to a frontendo11yapi.App instance.
@@ -63,6 +65,7 @@ func (tfData FrontendO11yAppTFModel) toClientModel(ctx context.Context) (fronten
63
65
CORSAllowedOrigins : allowedOrigins ,
64
66
ExtraLogLabels : extraLogLabels ,
65
67
Settings : actualSettings ,
68
+ CollectEndpointURL : tfData .CollectorEndpoint .ValueString (),
66
69
}, conversionDiags
67
70
}
68
71
@@ -100,6 +103,7 @@ func convertClientModelToTFModel(stackID int64, app frontendo11yapi.App) (Fronte
100
103
AllowedOrigins : tfAllowedOriginsValue ,
101
104
ExtraLogAtrributes : tfExtraLogAttributes ,
102
105
Settings : tfSettings ,
106
+ CollectorEndpoint : types .StringValue (fmt .Sprintf ("%s/%s" , app .CollectEndpointURL , app .Key )),
103
107
}
104
108
105
109
return resp , diags
0 commit comments