Skip to content

Commit a8448f9

Browse files
committed
Updated dynatrace_cloudapp_workloaddetection resource
1 parent 8ce6dd9 commit a8448f9

File tree

4 files changed

+121
-20
lines changed

4 files changed

+121
-20
lines changed

dynatrace/api/builtin/processgroup/cloudapplication/workloaddetection/schema.json

+48-5
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
}
7171
},
7272
"docker": {
73-
"description": "Enable this setting for plain Docker environments to get \n * Container resource metrics (Container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups).",
74-
"displayName": "Docker",
73+
"description": "Enable this setting for plain Docker and Podman environments to get \n * Container resource metrics (Container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups). \n * Docker support requires OneAgent 1.257+. \n * Podman support requires OneAgent 1.267+.",
74+
"displayName": "Docker and Podman",
7575
"documentation": "",
7676
"maxObjects": 1,
7777
"metadata": {
@@ -96,6 +96,20 @@
9696
"type": {
9797
"$ref": "#/types/KubernetesOpenShiftCAWD"
9898
}
99+
},
100+
"serverless": {
101+
"description": "Enable this setting to \n * Detect containers based on captured cloud-vendor metadata such as e.g. AWS ECS / Fargate, Azure Container Apps, [and many more](https://dt-url.net/2m02q7b).\n * Container resource metrics (Container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups).",
102+
"displayName": "Serverless Container Services",
103+
"documentation": "",
104+
"maxObjects": 1,
105+
"metadata": {
106+
"minAgentVersion": "1.297"
107+
},
108+
"modificationPolicy": "DEFAULT",
109+
"nullable": false,
110+
"type": {
111+
"$ref": "#/types/ServerlessCAWD"
112+
}
99113
}
100114
},
101115
"schemaGroups": [
@@ -136,7 +150,7 @@
136150
"enabled": {
137151
"default": true,
138152
"description": "",
139-
"displayName": "Enable cloud application and workload detection for Docker",
153+
"displayName": "Enable cloud application and workload detection for Docker and Podman",
140154
"documentation": "",
141155
"maxObjects": 1,
142156
"metadata": {
@@ -277,7 +291,7 @@
277291
"filters": {
278292
"constraints": [
279293
{
280-
"customMessage": "Namespace name and match operator must be unique",
294+
"customMessage": "The list of defined rules violates uniqueness constraints. Check, whether each combination of namespace name and match operator is unique and that there is only one rule present which uses the \"exists\" operator.",
281295
"type": "UNIQUE",
282296
"uniqueProperties": [
283297
"matchFilter.namespace",
@@ -310,22 +324,27 @@
310324
"columns": [
311325
{
312326
"displayName": "Namespace name",
327+
"id": "incNamespace",
313328
"propertyRef": "./inclusionToggles/incNamespace"
314329
},
315330
{
316331
"displayName": "Base pod name",
332+
"id": "incBasepod",
317333
"propertyRef": "./inclusionToggles/incBasepod"
318334
},
319335
{
320336
"displayName": "Container name",
337+
"id": "incContainer",
321338
"propertyRef": "./inclusionToggles/incContainer"
322339
},
323340
{
324341
"displayName": "Stage",
342+
"id": "incStage",
325343
"propertyRef": "./inclusionToggles/incStage"
326344
},
327345
{
328346
"displayName": "Product",
347+
"id": "incProduct",
329348
"propertyRef": "./inclusionToggles/incProduct"
330349
}
331350
]
@@ -385,7 +404,31 @@
385404
"type": "object",
386405
"version": "0",
387406
"versionInfo": ""
407+
},
408+
"ServerlessCAWD": {
409+
"description": "",
410+
"displayName": "",
411+
"documentation": "",
412+
"properties": {
413+
"enabled": {
414+
"default": false,
415+
"description": "",
416+
"displayName": "Enable container detection for serverless container services",
417+
"documentation": "",
418+
"maxObjects": 1,
419+
"metadata": {
420+
"minAgentVersion": "1.297"
421+
},
422+
"modificationPolicy": "DEFAULT",
423+
"nullable": false,
424+
"type": "boolean"
425+
}
426+
},
427+
"summaryPattern": "",
428+
"type": "object",
429+
"version": "0",
430+
"versionInfo": ""
388431
}
389432
},
390-
"version": "1.4"
433+
"version": "1.5"
391434
}

dynatrace/api/builtin/processgroup/cloudapplication/workloaddetection/service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/dynatrace-oss/terraform-provider-dynatrace/dynatrace/settings/services/settings20"
2424
)
2525

26-
const SchemaVersion = "1.4.1"
26+
const SchemaVersion = "1.5"
2727
const SchemaID = "builtin:process-group.cloud-application-workload-detection"
2828

2929
func Service(credentials *settings.Credentials) settings.CRUDService[*workloaddetection.Settings] {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Dynatrace LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package workloaddetection
19+
20+
import (
21+
"github.com/dynatrace-oss/terraform-provider-dynatrace/terraform/hcl"
22+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
23+
)
24+
25+
type ServerlessCAWD struct {
26+
Enabled bool `json:"enabled"` // This setting is enabled (`true`) or disabled (`false`)
27+
}
28+
29+
func (me *ServerlessCAWD) Schema() map[string]*schema.Schema {
30+
return map[string]*schema.Schema{
31+
"enabled": {
32+
Type: schema.TypeBool,
33+
Description: "This setting is enabled (`true`) or disabled (`false`)",
34+
Required: true,
35+
},
36+
}
37+
}
38+
39+
func (me *ServerlessCAWD) MarshalHCL(properties hcl.Properties) error {
40+
return properties.EncodeAll(map[string]any{
41+
"enabled": me.Enabled,
42+
})
43+
}
44+
45+
func (me *ServerlessCAWD) UnmarshalHCL(decoder hcl.Decoder) error {
46+
return decoder.DecodeAll(map[string]any{
47+
"enabled": &me.Enabled,
48+
})
49+
}

dynatrace/api/builtin/processgroup/cloudapplication/workloaddetection/settings/settings.go

+23-14
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ import (
2424

2525
type Settings struct {
2626
CloudFoundry *CloudFoundryCAWD `json:"cloudFoundry"` // Enable this setting to get \n * Processes of Cloud Foundry application instances merged into process groups by Cloud Foundry application. \n * Container resource metrics (Container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups).
27-
Docker *DockerCAWD `json:"docker"` // Enable this setting for plain Docker environments to get \n * Container resource metrics (Container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups).
27+
Docker *DockerCAWD `json:"docker"` // Enable this setting for plain Docker and Podman environments to get \n * Container resource metrics (Container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups). \n * Docker support requires OneAgent 1.257+. \n * Podman support requires OneAgent 1.267+.
2828
Kubernetes *KubernetesOpenShiftCAWD `json:"kubernetes"` // Enable this setting to get \n * Insights into your Kubernetes namespaces, workloads and pods (cloud application namespace, cloud application and cloud application instance and entities). \n * Container resource metrics (container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups). \n * Similar workloads merged into process groups based on defined rules (see below). \n * Version detection for services that run in Kubernetes workloads.
29+
Serverless *ServerlessCAWD `json:"serverless"` // Enable this setting to \n * Detect containers based on captured cloud-vendor metadata such as e.g. AWS ECS / Fargate, Azure Container Apps, [and many more](https://dt-url.net/2m02q7b).\n * Container resource metrics (Container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups).
2930
}
3031

3132
func (me *Settings) Name() string {
@@ -38,28 +39,34 @@ func (me *Settings) Schema() map[string]*schema.Schema {
3839
Type: schema.TypeList,
3940
Description: "Enable this setting to get \n * Processes of Cloud Foundry application instances merged into process groups by Cloud Foundry application. \n * Container resource metrics (Container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups).",
4041
Required: true,
41-
42-
Elem: &schema.Resource{Schema: new(CloudFoundryCAWD).Schema()},
43-
MinItems: 1,
44-
MaxItems: 1,
42+
Elem: &schema.Resource{Schema: new(CloudFoundryCAWD).Schema()},
43+
MinItems: 1,
44+
MaxItems: 1,
4545
},
4646
"docker": {
4747
Type: schema.TypeList,
48-
Description: "Enable this setting for plain Docker environments to get \n * Container resource metrics (Container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups).",
48+
Description: "Enable this setting for plain Docker and Podman environments to get \n * Container resource metrics (Container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups). \n * Docker support requires OneAgent 1.257+. \n * Podman support requires OneAgent 1.267+.",
4949
Required: true,
50-
51-
Elem: &schema.Resource{Schema: new(DockerCAWD).Schema()},
52-
MinItems: 1,
53-
MaxItems: 1,
50+
Elem: &schema.Resource{Schema: new(DockerCAWD).Schema()},
51+
MinItems: 1,
52+
MaxItems: 1,
5453
},
5554
"kubernetes": {
5655
Type: schema.TypeList,
5756
Description: "Enable this setting to get \n * Insights into your Kubernetes namespaces, workloads and pods (cloud application namespace, cloud application and cloud application instance and entities). \n * Container resource metrics (container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups). \n * Similar workloads merged into process groups based on defined rules (see below). \n * Version detection for services that run in Kubernetes workloads.",
5857
Required: true,
59-
60-
Elem: &schema.Resource{Schema: new(KubernetesOpenShiftCAWD).Schema()},
61-
MinItems: 1,
62-
MaxItems: 1,
58+
Elem: &schema.Resource{Schema: new(KubernetesOpenShiftCAWD).Schema()},
59+
MinItems: 1,
60+
MaxItems: 1,
61+
},
62+
"serverless": {
63+
Type: schema.TypeList,
64+
Description: "Enable this setting to \n * Detect containers based on captured cloud-vendor metadata such as e.g. AWS ECS / Fargate, Azure Container Apps, [and many more](https://dt-url.net/2m02q7b).\n * Container resource metrics (Container group instance entities) and [related screens](https://www.dynatrace.com/support/help/shortlink/container-groups).",
65+
Optional: true,
66+
Elem: &schema.Resource{Schema: new(ServerlessCAWD).Schema()},
67+
MinItems: 1,
68+
MaxItems: 1,
69+
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { return new == "0" },
6370
},
6471
}
6572
}
@@ -69,6 +76,7 @@ func (me *Settings) MarshalHCL(properties hcl.Properties) error {
6976
"cloud_foundry": me.CloudFoundry,
7077
"docker": me.Docker,
7178
"kubernetes": me.Kubernetes,
79+
"serverless": me.Serverless,
7280
})
7381
}
7482

@@ -77,5 +85,6 @@ func (me *Settings) UnmarshalHCL(decoder hcl.Decoder) error {
7785
"cloud_foundry": &me.CloudFoundry,
7886
"docker": &me.Docker,
7987
"kubernetes": &me.Kubernetes,
88+
"serverless": &me.Serverless,
8089
})
8190
}

0 commit comments

Comments
 (0)