diff --git a/.changelog/783.txt b/.changelog/783.txt new file mode 100644 index 000000000..9ca07c6c9 --- /dev/null +++ b/.changelog/783.txt @@ -0,0 +1,3 @@ +```release-note:feature +resource/deployment: Added support for symbols and profiling endpoints. +``` diff --git a/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_payload.go b/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_payload.go index 990f23689..1c66dbc66 100644 --- a/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_payload.go +++ b/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_payload.go @@ -47,8 +47,10 @@ type IntegrationsServerTF struct { } type EndpointsTF struct { - Fleet *string `tfsdk:"fleet"` - APM *string `tfsdk:"apm"` + Fleet *string `tfsdk:"fleet"` + APM *string `tfsdk:"apm"` + Symbols *string `tfsdk:"symbols"` + Profiling *string `tfsdk:"profiling"` } func (srv IntegrationsServerTF) payload(ctx context.Context, payload models.IntegrationsServerPayload) (*models.IntegrationsServerPayload, diag.Diagnostics) { diff --git a/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_read.go b/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_read.go index fd32071e3..3e82b5e83 100644 --- a/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_read.go +++ b/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_read.go @@ -43,8 +43,10 @@ type IntegrationsServer struct { } type Endpoints struct { - Fleet *string `tfsdk:"fleet"` - APM *string `tfsdk:"apm"` + Fleet *string `tfsdk:"fleet"` + APM *string `tfsdk:"apm"` + Symbols *string `tfsdk:"symbols"` + Profiling *string `tfsdk:"profiling"` } func ReadIntegrationsServers(in []*models.IntegrationsServerResourceInfo) (*IntegrationsServer, error) { @@ -121,6 +123,12 @@ func readEndpoints(in *models.IntegrationsServerResourceInfo) *Endpoints { case "fleet": endpoints.Fleet = url.URL hasValidEndpoints = true + case "symbols": + endpoints.Symbols = url.URL + hasValidEndpoints = true + case "profiling": + endpoints.Profiling = url.URL + hasValidEndpoints = true } } diff --git a/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_read_test.go b/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_read_test.go index ddeeecc1d..5e7ae836d 100644 --- a/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_read_test.go +++ b/ec/ecresource/deploymentresource/integrationsserver/v2/integrations_server_read_test.go @@ -84,6 +84,14 @@ func Test_readIntegrationsServer(t *testing.T) { Service: ec.String("fleet"), URL: ec.String("https://fleet_endpoint.cloud.elastic.co"), }, + { + Service: ec.String("symbols"), + URL: ec.String("https://symbols_endpoint.cloud.elastic.co"), + }, + { + Service: ec.String("profiling"), + URL: ec.String("https://profiling_endpoint.cloud.elastic.co"), + }, }, }, PlanInfo: &models.IntegrationsServerPlansInfo{Current: &models.IntegrationsServerPlanInfo{ @@ -115,8 +123,10 @@ func Test_readIntegrationsServer(t *testing.T) { HttpEndpoint: ec.String("http://integrations_serverresource.cloud.elastic.co:9200"), HttpsEndpoint: ec.String("https://integrations_serverresource.cloud.elastic.co:9243"), Endpoints: &Endpoints{ - Fleet: ec.String("https://fleet_endpoint.cloud.elastic.co"), - APM: ec.String("https://apm_endpoint.cloud.elastic.co"), + Fleet: ec.String("https://fleet_endpoint.cloud.elastic.co"), + APM: ec.String("https://apm_endpoint.cloud.elastic.co"), + Symbols: ec.String("https://symbols_endpoint.cloud.elastic.co"), + Profiling: ec.String("https://profiling_endpoint.cloud.elastic.co"), }, InstanceConfigurationId: ec.String("aws.integrations_server.r4"), InstanceConfigurationVersion: ec.Int(5), @@ -153,6 +163,14 @@ func Test_readIntegrationsServer(t *testing.T) { Service: ec.String("fleet"), URL: ec.String("https://fleet_endpoint.cloud.elastic.co"), }, + { + Service: ec.String("symbols"), + URL: ec.String("https://symbols_endpoint.cloud.elastic.co"), + }, + { + Service: ec.String("profiling"), + URL: ec.String("https://profiling_endpoint.cloud.elastic.co"), + }, }, }, PlanInfo: &models.IntegrationsServerPlansInfo{Current: &models.IntegrationsServerPlanInfo{ @@ -207,6 +225,14 @@ func Test_readIntegrationsServer(t *testing.T) { Service: ec.String("fleet"), URL: ec.String("https://fleet_endpoint.cloud.elastic.co"), }, + { + Service: ec.String("symbols"), + URL: ec.String("https://symbols_endpoint.cloud.elastic.co"), + }, + { + Service: ec.String("profiling"), + URL: ec.String("https://profiling_endpoint.cloud.elastic.co"), + }, }, }, PlanInfo: &models.IntegrationsServerPlansInfo{Current: &models.IntegrationsServerPlanInfo{ @@ -247,8 +273,10 @@ func Test_readIntegrationsServer(t *testing.T) { HttpEndpoint: ec.String("http://integrations_serverresource.cloud.elastic.co:9200"), HttpsEndpoint: ec.String("https://integrations_serverresource.cloud.elastic.co:9243"), Endpoints: &Endpoints{ - Fleet: ec.String("https://fleet_endpoint.cloud.elastic.co"), - APM: ec.String("https://apm_endpoint.cloud.elastic.co"), + Fleet: ec.String("https://fleet_endpoint.cloud.elastic.co"), + APM: ec.String("https://apm_endpoint.cloud.elastic.co"), + Symbols: ec.String("https://symbols_endpoint.cloud.elastic.co"), + Profiling: ec.String("https://profiling_endpoint.cloud.elastic.co"), }, InstanceConfigurationId: ec.String("aws.integrations_server.r4"), Size: ec.String("1g"), @@ -289,6 +317,14 @@ func Test_readIntegrationsServer(t *testing.T) { Service: ec.String("fleet"), URL: ec.String("https://fleet_endpoint.cloud.elastic.co"), }, + { + Service: ec.String("symbols"), + URL: ec.String("https://symbols_endpoint.cloud.elastic.co"), + }, + { + Service: ec.String("profiling"), + URL: ec.String("https://profiling_endpoint.cloud.elastic.co"), + }, }, }, PlanInfo: &models.IntegrationsServerPlansInfo{Current: &models.IntegrationsServerPlanInfo{ @@ -330,8 +366,10 @@ func Test_readIntegrationsServer(t *testing.T) { HttpEndpoint: ec.String("http://integrations_serverresource.cloud.elastic.co:9200"), HttpsEndpoint: ec.String("https://integrations_serverresource.cloud.elastic.co:9243"), Endpoints: &Endpoints{ - Fleet: ec.String("https://fleet_endpoint.cloud.elastic.co"), - APM: ec.String("https://apm_endpoint.cloud.elastic.co"), + Fleet: ec.String("https://fleet_endpoint.cloud.elastic.co"), + APM: ec.String("https://apm_endpoint.cloud.elastic.co"), + Symbols: ec.String("https://symbols_endpoint.cloud.elastic.co"), + Profiling: ec.String("https://profiling_endpoint.cloud.elastic.co"), }, InstanceConfigurationId: ec.String("aws.integrations_server.r4"), Size: ec.String("1g"), diff --git a/ec/ecresource/deploymentresource/integrationsserver/v2/schema.go b/ec/ecresource/deploymentresource/integrationsserver/v2/schema.go index 46e54d1e8..f368da866 100644 --- a/ec/ecresource/deploymentresource/integrationsserver/v2/schema.go +++ b/ec/ecresource/deploymentresource/integrationsserver/v2/schema.go @@ -76,8 +76,10 @@ func IntegrationsServerSchema() schema.Attribute { Computed: true, Description: "URLs for the accessing the Fleet and APM API's within this Integrations Server resource.", AttributeTypes: map[string]attr.Type{ - "apm": types.StringType, - "fleet": types.StringType, + "apm": types.StringType, + "fleet": types.StringType, + "symbols": types.StringType, + "profiling": types.StringType, }, PlanModifiers: []planmodifier.Object{ objectplanmodifier.UseStateForUnknown(),