pulumi-harness 0.5.0a1736833425__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pulumi-harness might be problematic. Click here for more details.

Files changed (311) hide show
  1. pulumi_harness/__init__.py +1257 -0
  2. pulumi_harness/_inputs.py +4025 -0
  3. pulumi_harness/_utilities.py +327 -0
  4. pulumi_harness/add_user_to_group.py +241 -0
  5. pulumi_harness/application.py +393 -0
  6. pulumi_harness/application_git_sync.py +411 -0
  7. pulumi_harness/autostopping/__init__.py +27 -0
  8. pulumi_harness/autostopping/_inputs.py +2688 -0
  9. pulumi_harness/autostopping/aws_alb.py +640 -0
  10. pulumi_harness/autostopping/aws_proxy.py +760 -0
  11. pulumi_harness/autostopping/azure_gateway.py +798 -0
  12. pulumi_harness/autostopping/azure_proxy.py +855 -0
  13. pulumi_harness/autostopping/gcp_proxy.py +779 -0
  14. pulumi_harness/autostopping/get_aws_alb.py +278 -0
  15. pulumi_harness/autostopping/get_aws_proxy.py +335 -0
  16. pulumi_harness/autostopping/get_azure_gateway.py +343 -0
  17. pulumi_harness/autostopping/get_azure_proxy.py +375 -0
  18. pulumi_harness/autostopping/get_gcp_proxy.py +340 -0
  19. pulumi_harness/autostopping/get_rule_ecs.py +225 -0
  20. pulumi_harness/autostopping/get_rule_rds.py +205 -0
  21. pulumi_harness/autostopping/get_rule_vm.py +265 -0
  22. pulumi_harness/autostopping/get_schedule.py +193 -0
  23. pulumi_harness/autostopping/outputs.py +1971 -0
  24. pulumi_harness/autostopping/rule_ecs.py +450 -0
  25. pulumi_harness/autostopping/rule_rds.py +448 -0
  26. pulumi_harness/autostopping/rule_vm.py +663 -0
  27. pulumi_harness/autostopping/schedule.py +465 -0
  28. pulumi_harness/cloudprovider/__init__.py +17 -0
  29. pulumi_harness/cloudprovider/_inputs.py +777 -0
  30. pulumi_harness/cloudprovider/aws.py +586 -0
  31. pulumi_harness/cloudprovider/azure.py +393 -0
  32. pulumi_harness/cloudprovider/datacenter.py +233 -0
  33. pulumi_harness/cloudprovider/gcp.py +340 -0
  34. pulumi_harness/cloudprovider/get_delegate_ids.py +148 -0
  35. pulumi_harness/cloudprovider/kubernetes.py +310 -0
  36. pulumi_harness/cloudprovider/outputs.py +657 -0
  37. pulumi_harness/cloudprovider/spot.py +296 -0
  38. pulumi_harness/cloudprovider/tanzu.py +441 -0
  39. pulumi_harness/cluster/__init__.py +9 -0
  40. pulumi_harness/cluster/get_orchestrator.py +134 -0
  41. pulumi_harness/cluster/orchestrator.py +286 -0
  42. pulumi_harness/config/__init__.py +8 -0
  43. pulumi_harness/config/__init__.pyi +40 -0
  44. pulumi_harness/config/vars.py +54 -0
  45. pulumi_harness/delegate_approval.py +267 -0
  46. pulumi_harness/encrypted_text.py +499 -0
  47. pulumi_harness/environment.py +446 -0
  48. pulumi_harness/get_application.py +180 -0
  49. pulumi_harness/get_current_account.py +108 -0
  50. pulumi_harness/get_delegate.py +280 -0
  51. pulumi_harness/get_encrypted_text.py +136 -0
  52. pulumi_harness/get_environment.py +184 -0
  53. pulumi_harness/get_git_connector.py +255 -0
  54. pulumi_harness/get_secret_manager.py +142 -0
  55. pulumi_harness/get_service.py +198 -0
  56. pulumi_harness/get_ssh_credential.py +122 -0
  57. pulumi_harness/get_sso_provider.py +114 -0
  58. pulumi_harness/get_trigger.py +177 -0
  59. pulumi_harness/get_user.py +184 -0
  60. pulumi_harness/get_user_group.py +100 -0
  61. pulumi_harness/get_yaml_config.py +142 -0
  62. pulumi_harness/git_connector.py +738 -0
  63. pulumi_harness/governance/__init__.py +13 -0
  64. pulumi_harness/governance/get_rule.py +168 -0
  65. pulumi_harness/governance/get_rule_enforcement.py +266 -0
  66. pulumi_harness/governance/get_rule_set.py +150 -0
  67. pulumi_harness/governance/rule.py +337 -0
  68. pulumi_harness/governance/rule_enforcement.py +668 -0
  69. pulumi_harness/governance/rule_set.py +321 -0
  70. pulumi_harness/infrastructure_definition.py +1246 -0
  71. pulumi_harness/outputs.py +3306 -0
  72. pulumi_harness/platform/__init__.py +220 -0
  73. pulumi_harness/platform/_inputs.py +22314 -0
  74. pulumi_harness/platform/app_dynamics_connector.py +733 -0
  75. pulumi_harness/platform/artifactory_connector.py +748 -0
  76. pulumi_harness/platform/aws_cc_connector.py +716 -0
  77. pulumi_harness/platform/aws_connector.py +851 -0
  78. pulumi_harness/platform/aws_kms_connector.py +619 -0
  79. pulumi_harness/platform/aws_secret_manager_connector.py +712 -0
  80. pulumi_harness/platform/azure_cloud_cost_connector.py +675 -0
  81. pulumi_harness/platform/azure_cloud_provider_connector.py +826 -0
  82. pulumi_harness/platform/azure_key_vault_connector.py +843 -0
  83. pulumi_harness/platform/bitbucket_connector.py +713 -0
  84. pulumi_harness/platform/connector_azure_artifacts.py +529 -0
  85. pulumi_harness/platform/connector_custom_secret_manager.py +887 -0
  86. pulumi_harness/platform/connector_customhealthsource.py +807 -0
  87. pulumi_harness/platform/connector_jdbc.py +609 -0
  88. pulumi_harness/platform/connector_pdc.py +527 -0
  89. pulumi_harness/platform/connector_rancher.py +617 -0
  90. pulumi_harness/platform/datadog_connector.py +651 -0
  91. pulumi_harness/platform/db_instance.py +636 -0
  92. pulumi_harness/platform/db_schema.py +547 -0
  93. pulumi_harness/platform/delegatetoken.py +520 -0
  94. pulumi_harness/platform/docker_connector.py +669 -0
  95. pulumi_harness/platform/dynatrace_connector.py +601 -0
  96. pulumi_harness/platform/elasticsearch_connector.py +744 -0
  97. pulumi_harness/platform/environment.py +1173 -0
  98. pulumi_harness/platform/environment_clusters_mapping.py +454 -0
  99. pulumi_harness/platform/environment_group.py +560 -0
  100. pulumi_harness/platform/environment_service_overrides.py +688 -0
  101. pulumi_harness/platform/feature_flag.py +724 -0
  102. pulumi_harness/platform/feature_flag_api_key.py +550 -0
  103. pulumi_harness/platform/feature_flag_target.py +473 -0
  104. pulumi_harness/platform/feature_flag_target_group.py +577 -0
  105. pulumi_harness/platform/file_store_file.py +822 -0
  106. pulumi_harness/platform/file_store_folder.py +628 -0
  107. pulumi_harness/platform/filters.py +511 -0
  108. pulumi_harness/platform/gcp_cloud_cost_connector.py +669 -0
  109. pulumi_harness/platform/gcp_connector.py +663 -0
  110. pulumi_harness/platform/gcp_secret_manager_connector.py +594 -0
  111. pulumi_harness/platform/get_api_key.py +292 -0
  112. pulumi_harness/platform/get_app_dynamics_connector.py +271 -0
  113. pulumi_harness/platform/get_artifactory_connector.py +243 -0
  114. pulumi_harness/platform/get_aws_cc_connector.py +271 -0
  115. pulumi_harness/platform/get_aws_connector.py +313 -0
  116. pulumi_harness/platform/get_aws_kms_connector.py +253 -0
  117. pulumi_harness/platform/get_aws_secret_manager_connector.py +267 -0
  118. pulumi_harness/platform/get_azure_cloud_cost_connector.py +257 -0
  119. pulumi_harness/platform/get_azure_cloud_provider_connector.py +257 -0
  120. pulumi_harness/platform/get_azure_key_vault_connector.py +308 -0
  121. pulumi_harness/platform/get_bitbucket_connector.py +285 -0
  122. pulumi_harness/platform/get_ccm_filters.py +221 -0
  123. pulumi_harness/platform/get_connector_custom_secret_manager.py +330 -0
  124. pulumi_harness/platform/get_connector_customhealthsource.py +281 -0
  125. pulumi_harness/platform/get_connector_jdbc.py +243 -0
  126. pulumi_harness/platform/get_connector_pdc.py +229 -0
  127. pulumi_harness/platform/get_connector_rancher.py +236 -0
  128. pulumi_harness/platform/get_current_account.py +126 -0
  129. pulumi_harness/platform/get_current_user.py +252 -0
  130. pulumi_harness/platform/get_datadog_connector.py +262 -0
  131. pulumi_harness/platform/get_db_instance.py +268 -0
  132. pulumi_harness/platform/get_db_schema.py +233 -0
  133. pulumi_harness/platform/get_delegatetoken.py +214 -0
  134. pulumi_harness/platform/get_docker_connector.py +257 -0
  135. pulumi_harness/platform/get_dynatrace_connector.py +242 -0
  136. pulumi_harness/platform/get_elasticsearch_connector.py +257 -0
  137. pulumi_harness/platform/get_environment.py +263 -0
  138. pulumi_harness/platform/get_environment_clusters_mapping.py +262 -0
  139. pulumi_harness/platform/get_environment_group.py +190 -0
  140. pulumi_harness/platform/get_environment_list.py +172 -0
  141. pulumi_harness/platform/get_environment_service_overrides.py +212 -0
  142. pulumi_harness/platform/get_file_store_file.py +327 -0
  143. pulumi_harness/platform/get_file_store_folder.py +271 -0
  144. pulumi_harness/platform/get_filters.py +217 -0
  145. pulumi_harness/platform/get_gcp_cloud_cost_connector.py +257 -0
  146. pulumi_harness/platform/get_gcp_connector.py +243 -0
  147. pulumi_harness/platform/get_gcp_secret_manager_connector.py +238 -0
  148. pulumi_harness/platform/get_git_connector.py +271 -0
  149. pulumi_harness/platform/get_github_connector.py +296 -0
  150. pulumi_harness/platform/get_gitlab_connector.py +285 -0
  151. pulumi_harness/platform/get_gitops_agent.py +303 -0
  152. pulumi_harness/platform/get_gitops_agent_deploy_yaml.py +257 -0
  153. pulumi_harness/platform/get_gitops_app_project.py +191 -0
  154. pulumi_harness/platform/get_gitops_app_project_mapping.py +189 -0
  155. pulumi_harness/platform/get_gitops_applications.py +351 -0
  156. pulumi_harness/platform/get_gitops_cluster.py +216 -0
  157. pulumi_harness/platform/get_gitops_gnupg.py +219 -0
  158. pulumi_harness/platform/get_gitops_repo_cert.py +155 -0
  159. pulumi_harness/platform/get_gitops_repo_cred.py +223 -0
  160. pulumi_harness/platform/get_gitops_repository.py +230 -0
  161. pulumi_harness/platform/get_gitx_webhook.py +194 -0
  162. pulumi_harness/platform/get_helm_connector.py +243 -0
  163. pulumi_harness/platform/get_iacm_default_pipeline.py +168 -0
  164. pulumi_harness/platform/get_infra_module.py +320 -0
  165. pulumi_harness/platform/get_infrastructure.py +287 -0
  166. pulumi_harness/platform/get_input_set.py +238 -0
  167. pulumi_harness/platform/get_jenkins_connector.py +243 -0
  168. pulumi_harness/platform/get_jira_connector.py +285 -0
  169. pulumi_harness/platform/get_kubernetes_cloud_cost_connector.py +228 -0
  170. pulumi_harness/platform/get_kubernetes_connector.py +285 -0
  171. pulumi_harness/platform/get_manual_freeze.py +305 -0
  172. pulumi_harness/platform/get_monitored_service.py +134 -0
  173. pulumi_harness/platform/get_nexus_connector.py +257 -0
  174. pulumi_harness/platform/get_notification_rule.py +156 -0
  175. pulumi_harness/platform/get_oci_helm_connector.py +243 -0
  176. pulumi_harness/platform/get_organization.py +156 -0
  177. pulumi_harness/platform/get_overrides.py +198 -0
  178. pulumi_harness/platform/get_pagerduty_connector.py +224 -0
  179. pulumi_harness/platform/get_permissions.py +149 -0
  180. pulumi_harness/platform/get_pipeline.py +268 -0
  181. pulumi_harness/platform/get_pipeline_filters.py +197 -0
  182. pulumi_harness/platform/get_pipeline_list.py +269 -0
  183. pulumi_harness/platform/get_policy.py +220 -0
  184. pulumi_harness/platform/get_policy_set.py +298 -0
  185. pulumi_harness/platform/get_project.py +210 -0
  186. pulumi_harness/platform/get_project_list.py +249 -0
  187. pulumi_harness/platform/get_prometheus_connector.py +271 -0
  188. pulumi_harness/platform/get_provider.py +85 -0
  189. pulumi_harness/platform/get_repo.py +362 -0
  190. pulumi_harness/platform/get_repo_rule_branch.py +312 -0
  191. pulumi_harness/platform/get_repo_webhook.py +316 -0
  192. pulumi_harness/platform/get_resource_group.py +267 -0
  193. pulumi_harness/platform/get_role_assignments.py +223 -0
  194. pulumi_harness/platform/get_roles.py +240 -0
  195. pulumi_harness/platform/get_secret_file.py +224 -0
  196. pulumi_harness/platform/get_secret_sshkey.py +239 -0
  197. pulumi_harness/platform/get_secret_text.py +264 -0
  198. pulumi_harness/platform/get_service.py +235 -0
  199. pulumi_harness/platform/get_service_account.py +224 -0
  200. pulumi_harness/platform/get_service_list.py +172 -0
  201. pulumi_harness/platform/get_service_now_connector.py +285 -0
  202. pulumi_harness/platform/get_service_overrides_v2.py +220 -0
  203. pulumi_harness/platform/get_slo.py +134 -0
  204. pulumi_harness/platform/get_splunk_connector.py +270 -0
  205. pulumi_harness/platform/get_spot_connector.py +215 -0
  206. pulumi_harness/platform/get_sumologic_connector.py +256 -0
  207. pulumi_harness/platform/get_tas_connector.py +243 -0
  208. pulumi_harness/platform/get_template.py +386 -0
  209. pulumi_harness/platform/get_template_filters.py +221 -0
  210. pulumi_harness/platform/get_terraform_cloud_connector.py +233 -0
  211. pulumi_harness/platform/get_token.py +430 -0
  212. pulumi_harness/platform/get_triggers.py +260 -0
  213. pulumi_harness/platform/get_user.py +222 -0
  214. pulumi_harness/platform/get_usergroup.py +340 -0
  215. pulumi_harness/platform/get_variables.py +209 -0
  216. pulumi_harness/platform/get_vault_connector.py +574 -0
  217. pulumi_harness/platform/get_workspace.py +411 -0
  218. pulumi_harness/platform/get_workspace_output_value.py +168 -0
  219. pulumi_harness/platform/git_connector.py +713 -0
  220. pulumi_harness/platform/git_ops_agent.py +727 -0
  221. pulumi_harness/platform/git_ops_applications.py +1090 -0
  222. pulumi_harness/platform/git_ops_cluster.py +438 -0
  223. pulumi_harness/platform/git_ops_gnupg.py +453 -0
  224. pulumi_harness/platform/git_ops_repo_cert.py +437 -0
  225. pulumi_harness/platform/git_ops_repo_cred.py +533 -0
  226. pulumi_harness/platform/git_ops_repository.py +831 -0
  227. pulumi_harness/platform/github_connector.py +807 -0
  228. pulumi_harness/platform/gitlab_connector.py +713 -0
  229. pulumi_harness/platform/gitops_app_project.py +485 -0
  230. pulumi_harness/platform/gitops_app_project_mapping.py +423 -0
  231. pulumi_harness/platform/gitx_webhook.py +616 -0
  232. pulumi_harness/platform/helm_connector.py +617 -0
  233. pulumi_harness/platform/iacm_default_pipeline.py +343 -0
  234. pulumi_harness/platform/infra_module.py +755 -0
  235. pulumi_harness/platform/infrastructure.py +937 -0
  236. pulumi_harness/platform/input_set.py +689 -0
  237. pulumi_harness/platform/jenkins_connector.py +566 -0
  238. pulumi_harness/platform/jira_connector.py +714 -0
  239. pulumi_harness/platform/kubernetes_cloud_cost_connector.py +558 -0
  240. pulumi_harness/platform/kubernetes_connector.py +895 -0
  241. pulumi_harness/platform/manual_freeze.py +835 -0
  242. pulumi_harness/platform/monitored_service.py +1984 -0
  243. pulumi_harness/platform/newrelic_connector.py +651 -0
  244. pulumi_harness/platform/nexus_connector.py +622 -0
  245. pulumi_harness/platform/notification_rule.py +526 -0
  246. pulumi_harness/platform/oci_helm_connector.py +617 -0
  247. pulumi_harness/platform/organization.py +336 -0
  248. pulumi_harness/platform/outputs.py +23361 -0
  249. pulumi_harness/platform/overrides.py +669 -0
  250. pulumi_harness/platform/pagerduty_connector.py +547 -0
  251. pulumi_harness/platform/pipeline.py +991 -0
  252. pulumi_harness/platform/pipeline_filters.py +711 -0
  253. pulumi_harness/platform/policy.py +944 -0
  254. pulumi_harness/platform/policy_set.py +594 -0
  255. pulumi_harness/platform/project.py +453 -0
  256. pulumi_harness/platform/prometheus_connector.py +710 -0
  257. pulumi_harness/platform/provider.py +349 -0
  258. pulumi_harness/platform/repo.py +737 -0
  259. pulumi_harness/platform/repo_rule_branch.py +645 -0
  260. pulumi_harness/platform/repo_webhook.py +664 -0
  261. pulumi_harness/platform/resource_group.py +718 -0
  262. pulumi_harness/platform/role_assignments.py +524 -0
  263. pulumi_harness/platform/roles.py +546 -0
  264. pulumi_harness/platform/secret_file.py +548 -0
  265. pulumi_harness/platform/secret_sshkey.py +569 -0
  266. pulumi_harness/platform/secret_text.py +620 -0
  267. pulumi_harness/platform/service.py +1195 -0
  268. pulumi_harness/platform/service_account.py +548 -0
  269. pulumi_harness/platform/service_now_connector.py +714 -0
  270. pulumi_harness/platform/service_overrides_v2.py +915 -0
  271. pulumi_harness/platform/slo.py +462 -0
  272. pulumi_harness/platform/splunk_connector.py +701 -0
  273. pulumi_harness/platform/spot_connector.py +452 -0
  274. pulumi_harness/platform/sumologic_connector.py +651 -0
  275. pulumi_harness/platform/tas_connector.py +570 -0
  276. pulumi_harness/platform/template.py +861 -0
  277. pulumi_harness/platform/template_filters.py +515 -0
  278. pulumi_harness/platform/terraform_cloud_connector.py +545 -0
  279. pulumi_harness/platform/token.py +977 -0
  280. pulumi_harness/platform/triggers.py +680 -0
  281. pulumi_harness/platform/user.py +522 -0
  282. pulumi_harness/platform/usergroup.py +1104 -0
  283. pulumi_harness/platform/variables.py +509 -0
  284. pulumi_harness/platform/vault_connector.py +1919 -0
  285. pulumi_harness/platform/workspace.py +1145 -0
  286. pulumi_harness/platform_api_key.py +617 -0
  287. pulumi_harness/platform_ccm_filters.py +515 -0
  288. pulumi_harness/provider.py +227 -0
  289. pulumi_harness/pulumi-plugin.json +6 -0
  290. pulumi_harness/py.typed +0 -0
  291. pulumi_harness/service/__init__.py +18 -0
  292. pulumi_harness/service/_inputs.py +660 -0
  293. pulumi_harness/service/ami.py +336 -0
  294. pulumi_harness/service/codedeploy.py +336 -0
  295. pulumi_harness/service/ecs.py +336 -0
  296. pulumi_harness/service/helm.py +336 -0
  297. pulumi_harness/service/kubernetes.py +409 -0
  298. pulumi_harness/service/lambda_.py +336 -0
  299. pulumi_harness/service/outputs.py +388 -0
  300. pulumi_harness/service/ssh.py +386 -0
  301. pulumi_harness/service/tanzu.py +336 -0
  302. pulumi_harness/service/winrm.py +386 -0
  303. pulumi_harness/ssh_credential.py +361 -0
  304. pulumi_harness/user.py +423 -0
  305. pulumi_harness/user_group.py +713 -0
  306. pulumi_harness/user_group_permissions.py +247 -0
  307. pulumi_harness/yaml_config.py +336 -0
  308. pulumi_harness-0.5.0a1736833425.dist-info/METADATA +69 -0
  309. pulumi_harness-0.5.0a1736833425.dist-info/RECORD +311 -0
  310. pulumi_harness-0.5.0a1736833425.dist-info/WHEEL +5 -0
  311. pulumi_harness-0.5.0a1736833425.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1984 @@
1
+ # coding=utf-8
2
+ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
3
+ # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+
5
+ import copy
6
+ import warnings
7
+ import sys
8
+ import pulumi
9
+ import pulumi.runtime
10
+ from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
15
+ from .. import _utilities
16
+ from . import outputs
17
+ from ._inputs import *
18
+
19
+ __all__ = ['MonitoredServiceArgs', 'MonitoredService']
20
+
21
+ @pulumi.input_type
22
+ class MonitoredServiceArgs:
23
+ def __init__(__self__, *,
24
+ identifier: pulumi.Input[str],
25
+ org_id: pulumi.Input[str],
26
+ project_id: pulumi.Input[str],
27
+ request: Optional[pulumi.Input['MonitoredServiceRequestArgs']] = None):
28
+ """
29
+ The set of arguments for constructing a MonitoredService resource.
30
+ :param pulumi.Input[str] identifier: Identifier of the monitored service.
31
+ :param pulumi.Input[str] org_id: Identifier of the organization in which the monitored service is configured.
32
+ :param pulumi.Input[str] project_id: Identifier of the project in which the monitored service is configured.
33
+ :param pulumi.Input['MonitoredServiceRequestArgs'] request: Request for creating or updating a monitored service.
34
+ """
35
+ pulumi.set(__self__, "identifier", identifier)
36
+ pulumi.set(__self__, "org_id", org_id)
37
+ pulumi.set(__self__, "project_id", project_id)
38
+ if request is not None:
39
+ pulumi.set(__self__, "request", request)
40
+
41
+ @property
42
+ @pulumi.getter
43
+ def identifier(self) -> pulumi.Input[str]:
44
+ """
45
+ Identifier of the monitored service.
46
+ """
47
+ return pulumi.get(self, "identifier")
48
+
49
+ @identifier.setter
50
+ def identifier(self, value: pulumi.Input[str]):
51
+ pulumi.set(self, "identifier", value)
52
+
53
+ @property
54
+ @pulumi.getter(name="orgId")
55
+ def org_id(self) -> pulumi.Input[str]:
56
+ """
57
+ Identifier of the organization in which the monitored service is configured.
58
+ """
59
+ return pulumi.get(self, "org_id")
60
+
61
+ @org_id.setter
62
+ def org_id(self, value: pulumi.Input[str]):
63
+ pulumi.set(self, "org_id", value)
64
+
65
+ @property
66
+ @pulumi.getter(name="projectId")
67
+ def project_id(self) -> pulumi.Input[str]:
68
+ """
69
+ Identifier of the project in which the monitored service is configured.
70
+ """
71
+ return pulumi.get(self, "project_id")
72
+
73
+ @project_id.setter
74
+ def project_id(self, value: pulumi.Input[str]):
75
+ pulumi.set(self, "project_id", value)
76
+
77
+ @property
78
+ @pulumi.getter
79
+ def request(self) -> Optional[pulumi.Input['MonitoredServiceRequestArgs']]:
80
+ """
81
+ Request for creating or updating a monitored service.
82
+ """
83
+ return pulumi.get(self, "request")
84
+
85
+ @request.setter
86
+ def request(self, value: Optional[pulumi.Input['MonitoredServiceRequestArgs']]):
87
+ pulumi.set(self, "request", value)
88
+
89
+
90
+ @pulumi.input_type
91
+ class _MonitoredServiceState:
92
+ def __init__(__self__, *,
93
+ identifier: Optional[pulumi.Input[str]] = None,
94
+ org_id: Optional[pulumi.Input[str]] = None,
95
+ project_id: Optional[pulumi.Input[str]] = None,
96
+ request: Optional[pulumi.Input['MonitoredServiceRequestArgs']] = None):
97
+ """
98
+ Input properties used for looking up and filtering MonitoredService resources.
99
+ :param pulumi.Input[str] identifier: Identifier of the monitored service.
100
+ :param pulumi.Input[str] org_id: Identifier of the organization in which the monitored service is configured.
101
+ :param pulumi.Input[str] project_id: Identifier of the project in which the monitored service is configured.
102
+ :param pulumi.Input['MonitoredServiceRequestArgs'] request: Request for creating or updating a monitored service.
103
+ """
104
+ if identifier is not None:
105
+ pulumi.set(__self__, "identifier", identifier)
106
+ if org_id is not None:
107
+ pulumi.set(__self__, "org_id", org_id)
108
+ if project_id is not None:
109
+ pulumi.set(__self__, "project_id", project_id)
110
+ if request is not None:
111
+ pulumi.set(__self__, "request", request)
112
+
113
+ @property
114
+ @pulumi.getter
115
+ def identifier(self) -> Optional[pulumi.Input[str]]:
116
+ """
117
+ Identifier of the monitored service.
118
+ """
119
+ return pulumi.get(self, "identifier")
120
+
121
+ @identifier.setter
122
+ def identifier(self, value: Optional[pulumi.Input[str]]):
123
+ pulumi.set(self, "identifier", value)
124
+
125
+ @property
126
+ @pulumi.getter(name="orgId")
127
+ def org_id(self) -> Optional[pulumi.Input[str]]:
128
+ """
129
+ Identifier of the organization in which the monitored service is configured.
130
+ """
131
+ return pulumi.get(self, "org_id")
132
+
133
+ @org_id.setter
134
+ def org_id(self, value: Optional[pulumi.Input[str]]):
135
+ pulumi.set(self, "org_id", value)
136
+
137
+ @property
138
+ @pulumi.getter(name="projectId")
139
+ def project_id(self) -> Optional[pulumi.Input[str]]:
140
+ """
141
+ Identifier of the project in which the monitored service is configured.
142
+ """
143
+ return pulumi.get(self, "project_id")
144
+
145
+ @project_id.setter
146
+ def project_id(self, value: Optional[pulumi.Input[str]]):
147
+ pulumi.set(self, "project_id", value)
148
+
149
+ @property
150
+ @pulumi.getter
151
+ def request(self) -> Optional[pulumi.Input['MonitoredServiceRequestArgs']]:
152
+ """
153
+ Request for creating or updating a monitored service.
154
+ """
155
+ return pulumi.get(self, "request")
156
+
157
+ @request.setter
158
+ def request(self, value: Optional[pulumi.Input['MonitoredServiceRequestArgs']]):
159
+ pulumi.set(self, "request", value)
160
+
161
+
162
+ class MonitoredService(pulumi.CustomResource):
163
+ @overload
164
+ def __init__(__self__,
165
+ resource_name: str,
166
+ opts: Optional[pulumi.ResourceOptions] = None,
167
+ identifier: Optional[pulumi.Input[str]] = None,
168
+ org_id: Optional[pulumi.Input[str]] = None,
169
+ project_id: Optional[pulumi.Input[str]] = None,
170
+ request: Optional[pulumi.Input[Union['MonitoredServiceRequestArgs', 'MonitoredServiceRequestArgsDict']]] = None,
171
+ __props__=None):
172
+ """
173
+ Resource for creating a monitored service.
174
+
175
+ ## Example Usage
176
+
177
+ ```python
178
+ import pulumi
179
+ import json
180
+ import pulumi_harness as harness
181
+
182
+ #Sample template for Elastic Search Log Health Source
183
+ example = harness.platform.MonitoredService("example",
184
+ org_id="org_id",
185
+ project_id="project_id",
186
+ identifier="identifier",
187
+ request={
188
+ "name": "name",
189
+ "type": "Application",
190
+ "description": "description",
191
+ "service_ref": "service_ref",
192
+ "environment_ref": "environment_ref",
193
+ "tags": [
194
+ "foo:bar",
195
+ "bar:foo",
196
+ ],
197
+ "health_sources": [{
198
+ "name": "name",
199
+ "identifier": "identifier",
200
+ "type": "ElasticSearch",
201
+ "version": "v2",
202
+ "spec": json.dumps({
203
+ "connectorRef": "connectorRef",
204
+ "queryDefinitions": [
205
+ {
206
+ "name": "error_4xx",
207
+ "identifier": "error_4xx_id",
208
+ "query": "Bad Request",
209
+ "index": "index",
210
+ "groupName": "Logs_Group",
211
+ "queryParams": {
212
+ "index": "index",
213
+ "serviceInstanceField": "serviceInstanceIdentifier",
214
+ "timeStampIdentifier": "timeStampIdentifier",
215
+ "timeStampFormat": "timeStampFormat",
216
+ "messageIdentifier": "messageIdentifier",
217
+ },
218
+ },
219
+ {
220
+ "name": "error_5xx",
221
+ "identifier": "error_5xx_id",
222
+ "query": "Internal Server Error",
223
+ "index": "index2",
224
+ "groupName": "Logs_Group",
225
+ "queryParams": {
226
+ "index": "index",
227
+ "serviceInstanceField": "serviceInstanceIdentifier",
228
+ "timeStampIdentifier": "timeStampIdentifier",
229
+ "timeStampFormat": "timeStampFormat",
230
+ "messageIdentifier": "messageIdentifier",
231
+ },
232
+ },
233
+ ],
234
+ }),
235
+ }],
236
+ "change_sources": [
237
+ {
238
+ "name": "BAC",
239
+ "identifier": "BAC",
240
+ "type": "PagerDuty",
241
+ "enabled": True,
242
+ "spec": json.dumps({
243
+ "connectorRef": "account.pd",
244
+ "pagerDutyServiceId": "P0N21OB",
245
+ }),
246
+ "category": "Alert",
247
+ },
248
+ {
249
+ "name": "FH",
250
+ "identifier": "FH",
251
+ "type": "CustomIncident",
252
+ "enabled": True,
253
+ "spec": json.dumps({
254
+ "name": "FH",
255
+ "webhookUrl": "https://harness.io/cv/api/account/sampleAcc/org/sampleOrg/project/sampleProj/webhook/custom-change?monitoredServiceIdentifier=checkout_prod&changeSourceIdentifier=FH",
256
+ "webhookCurlCommand": "curl -X POST -H 'content-type: application/json' -H 'X-Api-Key: sample_api_key' --url 'https://harness.io/cv/api/account/sampleAcc/org/sampleOrg/project/sampleProj/webhook/custom-change?monitoredServiceIdentifier=checkout_prod&changeSourceIdentifier=FH' -d '{ \\"eventIdentifier\\": \\"<string>\\" (optional), \\"user\\": \\"user@harness.io\\", \\"startTime\\": timeInMs, \\"endTime\\": timeInMs, \\"eventDetail\\": { \\"description\\": \\"<String>\\", \\"changeEventDetailsLink\\": \\"urlString\\" (optional), \\"externalLinkToEntity\\": \\"urlString\\" (optional), \\"name\\": \\"changeEventName\\" } }'",
257
+ "type": "Alert",
258
+ }),
259
+ "category": "Alert",
260
+ },
261
+ {
262
+ "name": "customff",
263
+ "identifier": "customff",
264
+ "type": "CustomFF",
265
+ "enabled": True,
266
+ "category": "FeatureFlag",
267
+ "spec": json.dumps({
268
+ "type": "FeatureFlag",
269
+ }),
270
+ },
271
+ {
272
+ "name": "customdeploy",
273
+ "identifier": "customdeploy",
274
+ "type": "CustomDeploy",
275
+ "enabled": True,
276
+ "category": "Deployment",
277
+ "spec": json.dumps({
278
+ "type": "Deployment",
279
+ }),
280
+ },
281
+ {
282
+ "name": "customincident",
283
+ "identifier": "customincident",
284
+ "type": "CustomIncident",
285
+ "enabled": True,
286
+ "category": "Alert",
287
+ "spec": json.dumps({
288
+ "type": "Alert",
289
+ "authorizationToken": "abc",
290
+ }),
291
+ },
292
+ ],
293
+ "notification_rule_refs": [
294
+ {
295
+ "notification_rule_ref": "notification_rule_ref",
296
+ "enabled": True,
297
+ },
298
+ {
299
+ "notification_rule_ref": "notification_rule_ref1",
300
+ "enabled": False,
301
+ },
302
+ ],
303
+ })
304
+ #Sample template for Sumologic Metrics Health Source
305
+ example1 = harness.platform.MonitoredService("example1",
306
+ org_id="org_id",
307
+ project_id="project_id",
308
+ identifier="identifier",
309
+ request={
310
+ "name": "name",
311
+ "type": "Application",
312
+ "description": "description",
313
+ "service_ref": "service_ref",
314
+ "environment_ref": "environment_ref",
315
+ "tags": [
316
+ "foo:bar",
317
+ "bar:foo",
318
+ ],
319
+ "health_sources": [{
320
+ "name": "sumologicmetrics",
321
+ "identifier": "sumo_metric_identifier",
322
+ "type": "SumologicMetrics",
323
+ "version": "v2",
324
+ "spec": json.dumps({
325
+ "connectorRef": "connectorRef",
326
+ "queryDefinitions": [
327
+ {
328
+ "name": "metric_cpu",
329
+ "identifier": "metric_cpu",
330
+ "query": "metric=cpu",
331
+ "groupName": "g1",
332
+ "queryParams": {
333
+ "serviceInstanceField": "_sourcehost",
334
+ },
335
+ "riskProfile": {
336
+ "riskCategory": "Performance_Other",
337
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
338
+ },
339
+ "liveMonitoringEnabled": "true",
340
+ "continuousVerificationEnabled": "true",
341
+ "sliEnabled": "false",
342
+ "metricThresholds": [
343
+ {
344
+ "type": "IgnoreThreshold",
345
+ "spec": {
346
+ "action": "Ignore",
347
+ },
348
+ "criteria": {
349
+ "type": "Absolute",
350
+ "spec": {
351
+ "greaterThan": 100,
352
+ },
353
+ },
354
+ "metricType": "Custom",
355
+ "metricName": "metric_cpu",
356
+ },
357
+ {
358
+ "type": "FailImmediately",
359
+ "spec": {
360
+ "action": "FailAfterOccurrence",
361
+ "spec": {
362
+ "count": 2,
363
+ },
364
+ },
365
+ "criteria": {
366
+ "type": "Absolute",
367
+ "spec": {
368
+ "greaterThan": 100,
369
+ },
370
+ },
371
+ "metricType": "Custom",
372
+ "metricName": "metric_cpu",
373
+ },
374
+ ],
375
+ },
376
+ {
377
+ "name": "name2",
378
+ "identifier": "identifier2",
379
+ "groupName": "g2",
380
+ "query": "metric=memory",
381
+ "queryParams": {
382
+ "serviceInstanceField": "_sourcehost",
383
+ },
384
+ "riskProfile": {
385
+ "riskCategory": "Performance_Other",
386
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
387
+ },
388
+ "liveMonitoringEnabled": "false",
389
+ "continuousVerificationEnabled": "false",
390
+ "sliEnabled": "false",
391
+ },
392
+ ],
393
+ }),
394
+ }],
395
+ })
396
+ #Sample template for Sumologic Log Health Source
397
+ example2 = harness.platform.MonitoredService("example2",
398
+ org_id="org_id",
399
+ project_id="project_id",
400
+ identifier="identifier",
401
+ request={
402
+ "name": "name",
403
+ "type": "Application",
404
+ "description": "description",
405
+ "service_ref": "service_ref",
406
+ "environment_ref": "environment_ref",
407
+ "tags": [
408
+ "foo:bar",
409
+ "bar:foo",
410
+ ],
411
+ "health_sources": [{
412
+ "name": "sumologic",
413
+ "identifier": "sumo_metric_identifier",
414
+ "type": "SumologicLogs",
415
+ "version": "v2",
416
+ "spec": json.dumps({
417
+ "connectorRef": "connectorRef",
418
+ "queryDefinitions": [
419
+ {
420
+ "name": "log1",
421
+ "identifier": "log1",
422
+ "query": "*",
423
+ "groupName": "Logs Group",
424
+ "queryParams": {
425
+ "serviceInstanceField": "_sourcehost",
426
+ },
427
+ },
428
+ {
429
+ "name": "log2",
430
+ "identifier": "identifier2",
431
+ "groupName": "g2",
432
+ "query": "error",
433
+ "queryParams": {
434
+ "serviceInstanceField": "_sourcehost",
435
+ },
436
+ },
437
+ ],
438
+ }),
439
+ }],
440
+ })
441
+ #Sample template for Splunk Signal FX Health Source
442
+ example3 = harness.platform.MonitoredService("example3",
443
+ org_id="org_id",
444
+ project_id="project_id",
445
+ identifier="identifier",
446
+ request={
447
+ "name": "name",
448
+ "type": "Application",
449
+ "description": "description",
450
+ "service_ref": "service_ref",
451
+ "environment_ref": "environment_ref",
452
+ "tags": [
453
+ "foo:bar",
454
+ "bar:foo",
455
+ ],
456
+ "health_sources": [{
457
+ "name": "signalfxmetrics",
458
+ "identifier": "signalfxmetrics",
459
+ "type": "SplunkSignalFXMetrics",
460
+ "version": "v2",
461
+ "spec": json.dumps({
462
+ "connectorRef": "connectorRef",
463
+ "queryDefinitions": [
464
+ {
465
+ "name": "metric_infra_cpu",
466
+ "identifier": "metric_infra_cpu",
467
+ "query": "***",
468
+ "groupName": "g",
469
+ "riskProfile": {
470
+ "riskCategory": "Errors",
471
+ "thresholdTypes": [
472
+ "ACT_WHEN_HIGHER",
473
+ "ACT_WHEN_LOWER",
474
+ ],
475
+ },
476
+ "liveMonitoringEnabled": "true",
477
+ "continuousVerificationEnabled": "true",
478
+ "sliEnabled": "false",
479
+ },
480
+ {
481
+ "name": "name2",
482
+ "identifier": "identifier2",
483
+ "groupName": "g2",
484
+ "query": "*",
485
+ "riskProfile": {
486
+ "riskCategory": "Performance_Other",
487
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
488
+ },
489
+ "liveMonitoringEnabled": "true",
490
+ "continuousVerificationEnabled": "false",
491
+ "sliEnabled": "false",
492
+ "metricThresholds": [
493
+ {
494
+ "type": "IgnoreThreshold",
495
+ "spec": {
496
+ "action": "Ignore",
497
+ },
498
+ "criteria": {
499
+ "type": "Absolute",
500
+ "spec": {
501
+ "greaterThan": 100,
502
+ },
503
+ },
504
+ "metrictype": "Custom",
505
+ "metricName": "identifier2",
506
+ },
507
+ {
508
+ "type": "FailImmediately",
509
+ "spec": {
510
+ "action": "FailAfterOccurrence",
511
+ "spec": {
512
+ "count": 2,
513
+ },
514
+ },
515
+ "criteria": {
516
+ "type": "Absolute",
517
+ "spec": {
518
+ "greaterThan": 100,
519
+ },
520
+ },
521
+ "metricType": "Custom",
522
+ "metricName": "identifier2",
523
+ },
524
+ ],
525
+ },
526
+ ],
527
+ }),
528
+ }],
529
+ })
530
+ #Sample template for Grafana Loki Log Health Source
531
+ example4 = harness.platform.MonitoredService("example4",
532
+ org_id="org_id",
533
+ project_id="project_id",
534
+ identifier="identifier",
535
+ request={
536
+ "name": "name",
537
+ "type": "Application",
538
+ "description": "description",
539
+ "service_ref": "service_ref",
540
+ "environment_ref": "environment_ref",
541
+ "tags": [
542
+ "foo:bar",
543
+ "bar:foo",
544
+ ],
545
+ "health_sources": [{
546
+ "name": "Test",
547
+ "identifier": "Test",
548
+ "type": "GrafanaLokiLogs",
549
+ "version": "v2",
550
+ "spec": json.dumps({
551
+ "connectorRef": "connectorRef",
552
+ "queryDefinitions": [
553
+ {
554
+ "name": "Demo",
555
+ "identifier": "Demo",
556
+ "query": "{job=~\\".+\\"}",
557
+ "groupName": "Log_Group",
558
+ "queryParams": {
559
+ "serviceInstanceField": "job",
560
+ },
561
+ },
562
+ {
563
+ "name": "log2",
564
+ "identifier": "identifier2",
565
+ "groupName": "g2",
566
+ "query": "error",
567
+ "queryParams": {
568
+ "serviceInstanceField": "_sourcehost",
569
+ },
570
+ "liveMonitoringEnabled": "false",
571
+ "continuousVerificationEnabled": "false",
572
+ "sliEnabled": "false",
573
+ },
574
+ ],
575
+ }),
576
+ }],
577
+ })
578
+ #Sample template for Azure Metrics Health Source
579
+ example5 = harness.platform.MonitoredService("example5",
580
+ org_id="org_id",
581
+ project_id="project_id",
582
+ identifier="identifier",
583
+ request={
584
+ "name": "name",
585
+ "type": "Application",
586
+ "description": "description",
587
+ "service_ref": "service_ref",
588
+ "environment_ref": "environment_ref",
589
+ "tags": [
590
+ "foo:bar",
591
+ "bar:foo",
592
+ ],
593
+ "health_sources": [{
594
+ "name": "azure metrics verify step",
595
+ "identifier": "azure_metrics_verify_step",
596
+ "type": "AzureMetrics",
597
+ "version": "v2",
598
+ "spec": json.dumps({
599
+ "connectorRef": "connectorRef",
600
+ "queryDefinitions": [
601
+ {
602
+ "name": "metric",
603
+ "identifier": "metric",
604
+ "query": "default",
605
+ "groupName": "g1",
606
+ "queryParams": {
607
+ "serviceInstanceField": "host",
608
+ "index": "/subscriptions/12d2db62-5aa9-471d-84bb-faa489b3e319/resourceGroups/srm-test/providers/Microsoft.ContainerService/managedClusters/srm-test",
609
+ "healthSourceMetricName": "cpuUsagePercentage",
610
+ "healthSourceMetricNamespace": "insights.container/nodes",
611
+ "aggregationType": "average",
612
+ },
613
+ "riskProfile": {
614
+ "riskCategory": "Performance_Other",
615
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
616
+ },
617
+ "liveMonitoringEnabled": "true",
618
+ "continuousVerificationEnabled": "true",
619
+ "sliEnabled": "false",
620
+ "metricThresholds": [
621
+ {
622
+ "type": "IgnoreThreshold",
623
+ "spec": {
624
+ "action": "Ignore",
625
+ },
626
+ "criteria": {
627
+ "type": "Absolute",
628
+ "spec": {
629
+ "greaterThan": 100,
630
+ },
631
+ },
632
+ "metrictype": "Custom",
633
+ "metricName": "metric",
634
+ },
635
+ {
636
+ "type": "FailImmediately",
637
+ "spec": {
638
+ "action": "FailAfterOccurrence",
639
+ "spec": {
640
+ "count": 2,
641
+ },
642
+ },
643
+ "criteria": {
644
+ "type": "Absolute",
645
+ "spec": {
646
+ "greaterThan": 100,
647
+ },
648
+ },
649
+ "metricType": "Custom",
650
+ "metricName": "metric",
651
+ },
652
+ ],
653
+ },
654
+ {
655
+ "name": "name2",
656
+ "identifier": "identifier2",
657
+ "groupName": "g2",
658
+ "queryParams": {
659
+ "serviceInstanceField": "host",
660
+ "index": "/subscriptions/12d2db62-5aa9-471d-84bb-faa489b3e319/resourceGroups/srm-test/providers/Microsoft.ContainerService/managedClusters/srm-test",
661
+ "healthSourceMetricName": "cpuUsagePercentage",
662
+ "healthSourceMetricNamespace": "insights.container/nodes",
663
+ "aggregationType": "average",
664
+ },
665
+ "riskProfile": {
666
+ "riskCategory": "Performance_Other",
667
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
668
+ },
669
+ "liveMonitoringEnabled": "false",
670
+ "continuousVerificationEnabled": "false",
671
+ "sliEnabled": "false",
672
+ },
673
+ ],
674
+ }),
675
+ }],
676
+ })
677
+ #Sample template for Azure Log Health Source
678
+ example6 = harness.platform.MonitoredService("example6",
679
+ org_id="org_id",
680
+ project_id="project_id",
681
+ identifier="identifier",
682
+ request={
683
+ "name": "name",
684
+ "type": "Application",
685
+ "description": "description",
686
+ "service_ref": "service_ref",
687
+ "environment_ref": "environment_ref",
688
+ "tags": [
689
+ "foo:bar",
690
+ "bar:foo",
691
+ ],
692
+ "health_sources": [{
693
+ "name": "Demo azure",
694
+ "identifier": "Demo_azure",
695
+ "type": "AzureLogs",
696
+ "version": "v2",
697
+ "spec": json.dumps({
698
+ "connectorRef": "connectorRef",
699
+ "queryDefinitions": [{
700
+ "name": "name2",
701
+ "identifier": "identifier2",
702
+ "groupName": "g2",
703
+ "query": "*",
704
+ "queryParams": {
705
+ "serviceInstanceField": "Name",
706
+ "timeStampIdentifier": "StartedTime",
707
+ "messageIdentifier": "Image",
708
+ "index": "/subscriptions/12d2db62-5aa9-471d-84bb-faa489b3e319/resourceGroups/srm-test/providers/Microsoft.ContainerService/managedClusters/srm-test",
709
+ },
710
+ "liveMonitoringEnabled": "false",
711
+ "continuousVerificationEnabled": "false",
712
+ }],
713
+ }),
714
+ }],
715
+ })
716
+ #Sample template for Prometheus Metrics Health Source
717
+ example7 = harness.platform.MonitoredService("example7",
718
+ org_id="org_id",
719
+ project_id="project_id",
720
+ identifier="identifier",
721
+ request={
722
+ "name": "name",
723
+ "type": "Application",
724
+ "description": "description",
725
+ "service_ref": "service_ref",
726
+ "environment_ref": "environment_ref",
727
+ "tags": [
728
+ "foo:bar",
729
+ "bar:foo",
730
+ ],
731
+ "health_sources": [{
732
+ "name": "prometheus metrics verify step",
733
+ "identifier": "prometheus_metrics",
734
+ "type": "Prometheus",
735
+ "spec": json.dumps({
736
+ "connectorRef": "connectorRef",
737
+ "metricDefinitions": [{
738
+ "identifier": "Prometheus_Metric",
739
+ "metricName": "Prometheus Metric",
740
+ "riskProfile": {
741
+ "riskCategory": "Performance_Other",
742
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
743
+ },
744
+ "analysis": {
745
+ "liveMonitoring": {
746
+ "enabled": True,
747
+ },
748
+ "deploymentVerification": {
749
+ "enabled": True,
750
+ "serviceInstanceFieldName": "pod_name",
751
+ },
752
+ },
753
+ "query": "count(up{group=\\"cv\\",group=\\"cv\\"})",
754
+ "groupName": "met",
755
+ "isManualQuery": True,
756
+ }],
757
+ "metricPacks": [{
758
+ "identifier": "Custom",
759
+ "metricThresholds": [
760
+ {
761
+ "type": "IgnoreThreshold",
762
+ "spec": {
763
+ "action": "Ignore",
764
+ },
765
+ "criteria": {
766
+ "type": "Absolute",
767
+ "spec": {
768
+ "greaterThan": 100,
769
+ },
770
+ },
771
+ "metrictype": "Custom",
772
+ "metricName": "Prometheus Metric",
773
+ },
774
+ {
775
+ "type": "FailImmediately",
776
+ "spec": {
777
+ "action": "FailAfterOccurrence",
778
+ "spec": {
779
+ "count": 2,
780
+ },
781
+ },
782
+ "criteria": {
783
+ "type": "Absolute",
784
+ "spec": {
785
+ "greaterThan": 100,
786
+ },
787
+ },
788
+ "metricType": "Custom",
789
+ "metricName": "Prometheus Metric",
790
+ },
791
+ ],
792
+ }],
793
+ }),
794
+ }],
795
+ })
796
+ #Sample template for Datadog Metrics Health Source
797
+ example8 = harness.platform.MonitoredService("example8",
798
+ org_id="org_id",
799
+ project_id="project_id",
800
+ identifier="identifier",
801
+ request={
802
+ "name": "name",
803
+ "type": "Application",
804
+ "description": "description",
805
+ "service_ref": "service_ref",
806
+ "environment_ref": "environment_ref",
807
+ "tags": [
808
+ "foo:bar",
809
+ "bar:foo",
810
+ ],
811
+ "health_sources": [{
812
+ "name": "ddm",
813
+ "identifier": "ddm",
814
+ "type": "DatadogMetrics",
815
+ "spec": json.dumps({
816
+ "connectorRef": "connectorRef",
817
+ "feature": "Datadog Cloud Metrics",
818
+ "metricDefinitions": [
819
+ {
820
+ "metricName": "metric",
821
+ "metricPath": "M1",
822
+ "identifier": "metric",
823
+ "query": \"\"\"avg:kubernetes.cpu.limits{*}.rollup(avg, 60);
824
+ avg:kubernetes.cpu.limits{*}.rollup(avg, 30);
825
+ (a+b)/10\"\"\",
826
+ "isManualQuery": True,
827
+ "isCustomCreatedMetric": True,
828
+ "riskProfile": {
829
+ "riskCategory": "Performance_Other",
830
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
831
+ },
832
+ "analysis": {
833
+ "liveMonitoring": {
834
+ "enabled": True,
835
+ },
836
+ "deploymentVerification": {
837
+ "enabled": True,
838
+ "serviceInstanceFieldName": "pod",
839
+ },
840
+ },
841
+ },
842
+ {
843
+ "metricName": "dashboard_metric_cpu",
844
+ "identifier": "metric_cpu",
845
+ "query": \"\"\"avg:kubernetes.cpu.limits{*}.rollup(avg, 60);
846
+ avg:kubernetes.cpu.limits{*}.rollup(avg, 30);
847
+ (a+b)/10\"\"\",
848
+ "isManualQuery": False,
849
+ "dashboardName": "dashboard",
850
+ "metricPath": "M1",
851
+ "groupingQuery": "avg:kubernetes.cpu.limits{*} by {host}.rollup(avg, 60)",
852
+ "metric": "kubernetes.cpu.limits",
853
+ "aggregation": "avg",
854
+ "isCustomCreatedMetric": True,
855
+ "riskProfile": {
856
+ "riskCategory": "Performance_Other",
857
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
858
+ },
859
+ "analysis": {
860
+ "liveMonitoring": {
861
+ "enabled": True,
862
+ },
863
+ "deploymentVerification": {
864
+ "enabled": True,
865
+ "serviceInstanceFieldName": "pod",
866
+ },
867
+ },
868
+ },
869
+ ],
870
+ "metricPacks": [{
871
+ "identifier": "Custom",
872
+ "metricThresholds": [
873
+ {
874
+ "type": "IgnoreThreshold",
875
+ "spec": {
876
+ "action": "Ignore",
877
+ },
878
+ "criteria": {
879
+ "type": "Absolute",
880
+ "spec": {
881
+ "greaterThan": 100,
882
+ },
883
+ },
884
+ "metrictype": "Custom",
885
+ "metricName": "metric",
886
+ },
887
+ {
888
+ "type": "FailImmediately",
889
+ "spec": {
890
+ "action": "FailAfterOccurrence",
891
+ "spec": {
892
+ "count": 2,
893
+ },
894
+ },
895
+ "criteria": {
896
+ "type": "Absolute",
897
+ "spec": {
898
+ "greaterThan": 100,
899
+ },
900
+ },
901
+ "metricType": "Custom",
902
+ "metricName": "metric",
903
+ },
904
+ ],
905
+ }],
906
+ }),
907
+ }],
908
+ })
909
+ #Sample template for New Relic Metrics Health Source
910
+ example9 = harness.platform.MonitoredService("example9",
911
+ org_id="org_id",
912
+ project_id="project_id",
913
+ identifier="identifier",
914
+ request={
915
+ "name": "name",
916
+ "type": "Application",
917
+ "description": "description",
918
+ "service_ref": "service_ref",
919
+ "environment_ref": "environment_ref",
920
+ "tags": [
921
+ "foo:bar",
922
+ "bar:foo",
923
+ ],
924
+ "health_sources": [{
925
+ "name": "name",
926
+ "identifier": "identifier",
927
+ "type": "NewRelic",
928
+ "spec": json.dumps({
929
+ "connectorRef": "account.Newrelicautomation_do_not_delete",
930
+ "feature": "apm",
931
+ "applicationId": "107019083",
932
+ "applicationName": "My Application",
933
+ "metricData": {
934
+ "Performance": True,
935
+ },
936
+ "metricPacks": [{
937
+ "identifier": "Performance",
938
+ }],
939
+ "newRelicMetricDefinitions": [{
940
+ "identifier": "New_Relic_Metric",
941
+ "metricName": "New Relic Metric",
942
+ "riskProfile": {
943
+ "riskCategory": "Performance_Other",
944
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
945
+ },
946
+ "analysis": {
947
+ "deploymentVerification": {
948
+ "enabled": True,
949
+ },
950
+ },
951
+ "groupName": "group1",
952
+ "nrql": "SELECT count(apm.service.instance.count) FROM Metric WHERE appName LIKE 'My Application' TIMESERIES",
953
+ "responseMapping": {
954
+ "metricValueJsonPath": "$.['timeSeries'].[*].['results'].[*].['count']",
955
+ "timestampJsonPath": "$.['timeSeries'].[*].['beginTimeSeconds']",
956
+ },
957
+ }],
958
+ "metricPacks": [{
959
+ "identifier": "Custom",
960
+ "metricThresholds": [
961
+ {
962
+ "type": "IgnoreThreshold",
963
+ "spec": {
964
+ "action": "Ignore",
965
+ },
966
+ "criteria": {
967
+ "type": "Absolute",
968
+ "spec": {
969
+ "greaterThan": 100,
970
+ },
971
+ },
972
+ "metricType": "Custom",
973
+ "metricName": "New Relic Metric",
974
+ },
975
+ {
976
+ "type": "FailImmediately",
977
+ "spec": {
978
+ "action": "FailAfterOccurrence",
979
+ "spec": {
980
+ "count": 2,
981
+ },
982
+ },
983
+ "criteria": {
984
+ "type": "Absolute",
985
+ "spec": {
986
+ "greaterThan": 100,
987
+ },
988
+ },
989
+ "metricType": "Custom",
990
+ "metricName": "New Relic Metric",
991
+ },
992
+ ],
993
+ }],
994
+ }),
995
+ }],
996
+ })
997
+ ```
998
+
999
+ ## Import
1000
+
1001
+ Import account level monitored_service
1002
+
1003
+ ```sh
1004
+ $ pulumi import harness:platform/monitoredService:MonitoredService example <monitored_service_id>
1005
+ ```
1006
+
1007
+ Import organization level monitored_service
1008
+
1009
+ ```sh
1010
+ $ pulumi import harness:platform/monitoredService:MonitoredService example <org_id>/<monitored_service_id>
1011
+ ```
1012
+
1013
+ Import project level monitored_service
1014
+
1015
+ ```sh
1016
+ $ pulumi import harness:platform/monitoredService:MonitoredService example <org_id>/<project_id>/<monitored_service_id>
1017
+ ```
1018
+
1019
+ :param str resource_name: The name of the resource.
1020
+ :param pulumi.ResourceOptions opts: Options for the resource.
1021
+ :param pulumi.Input[str] identifier: Identifier of the monitored service.
1022
+ :param pulumi.Input[str] org_id: Identifier of the organization in which the monitored service is configured.
1023
+ :param pulumi.Input[str] project_id: Identifier of the project in which the monitored service is configured.
1024
+ :param pulumi.Input[Union['MonitoredServiceRequestArgs', 'MonitoredServiceRequestArgsDict']] request: Request for creating or updating a monitored service.
1025
+ """
1026
+ ...
1027
+ @overload
1028
+ def __init__(__self__,
1029
+ resource_name: str,
1030
+ args: MonitoredServiceArgs,
1031
+ opts: Optional[pulumi.ResourceOptions] = None):
1032
+ """
1033
+ Resource for creating a monitored service.
1034
+
1035
+ ## Example Usage
1036
+
1037
+ ```python
1038
+ import pulumi
1039
+ import json
1040
+ import pulumi_harness as harness
1041
+
1042
+ #Sample template for Elastic Search Log Health Source
1043
+ example = harness.platform.MonitoredService("example",
1044
+ org_id="org_id",
1045
+ project_id="project_id",
1046
+ identifier="identifier",
1047
+ request={
1048
+ "name": "name",
1049
+ "type": "Application",
1050
+ "description": "description",
1051
+ "service_ref": "service_ref",
1052
+ "environment_ref": "environment_ref",
1053
+ "tags": [
1054
+ "foo:bar",
1055
+ "bar:foo",
1056
+ ],
1057
+ "health_sources": [{
1058
+ "name": "name",
1059
+ "identifier": "identifier",
1060
+ "type": "ElasticSearch",
1061
+ "version": "v2",
1062
+ "spec": json.dumps({
1063
+ "connectorRef": "connectorRef",
1064
+ "queryDefinitions": [
1065
+ {
1066
+ "name": "error_4xx",
1067
+ "identifier": "error_4xx_id",
1068
+ "query": "Bad Request",
1069
+ "index": "index",
1070
+ "groupName": "Logs_Group",
1071
+ "queryParams": {
1072
+ "index": "index",
1073
+ "serviceInstanceField": "serviceInstanceIdentifier",
1074
+ "timeStampIdentifier": "timeStampIdentifier",
1075
+ "timeStampFormat": "timeStampFormat",
1076
+ "messageIdentifier": "messageIdentifier",
1077
+ },
1078
+ },
1079
+ {
1080
+ "name": "error_5xx",
1081
+ "identifier": "error_5xx_id",
1082
+ "query": "Internal Server Error",
1083
+ "index": "index2",
1084
+ "groupName": "Logs_Group",
1085
+ "queryParams": {
1086
+ "index": "index",
1087
+ "serviceInstanceField": "serviceInstanceIdentifier",
1088
+ "timeStampIdentifier": "timeStampIdentifier",
1089
+ "timeStampFormat": "timeStampFormat",
1090
+ "messageIdentifier": "messageIdentifier",
1091
+ },
1092
+ },
1093
+ ],
1094
+ }),
1095
+ }],
1096
+ "change_sources": [
1097
+ {
1098
+ "name": "BAC",
1099
+ "identifier": "BAC",
1100
+ "type": "PagerDuty",
1101
+ "enabled": True,
1102
+ "spec": json.dumps({
1103
+ "connectorRef": "account.pd",
1104
+ "pagerDutyServiceId": "P0N21OB",
1105
+ }),
1106
+ "category": "Alert",
1107
+ },
1108
+ {
1109
+ "name": "FH",
1110
+ "identifier": "FH",
1111
+ "type": "CustomIncident",
1112
+ "enabled": True,
1113
+ "spec": json.dumps({
1114
+ "name": "FH",
1115
+ "webhookUrl": "https://harness.io/cv/api/account/sampleAcc/org/sampleOrg/project/sampleProj/webhook/custom-change?monitoredServiceIdentifier=checkout_prod&changeSourceIdentifier=FH",
1116
+ "webhookCurlCommand": "curl -X POST -H 'content-type: application/json' -H 'X-Api-Key: sample_api_key' --url 'https://harness.io/cv/api/account/sampleAcc/org/sampleOrg/project/sampleProj/webhook/custom-change?monitoredServiceIdentifier=checkout_prod&changeSourceIdentifier=FH' -d '{ \\"eventIdentifier\\": \\"<string>\\" (optional), \\"user\\": \\"user@harness.io\\", \\"startTime\\": timeInMs, \\"endTime\\": timeInMs, \\"eventDetail\\": { \\"description\\": \\"<String>\\", \\"changeEventDetailsLink\\": \\"urlString\\" (optional), \\"externalLinkToEntity\\": \\"urlString\\" (optional), \\"name\\": \\"changeEventName\\" } }'",
1117
+ "type": "Alert",
1118
+ }),
1119
+ "category": "Alert",
1120
+ },
1121
+ {
1122
+ "name": "customff",
1123
+ "identifier": "customff",
1124
+ "type": "CustomFF",
1125
+ "enabled": True,
1126
+ "category": "FeatureFlag",
1127
+ "spec": json.dumps({
1128
+ "type": "FeatureFlag",
1129
+ }),
1130
+ },
1131
+ {
1132
+ "name": "customdeploy",
1133
+ "identifier": "customdeploy",
1134
+ "type": "CustomDeploy",
1135
+ "enabled": True,
1136
+ "category": "Deployment",
1137
+ "spec": json.dumps({
1138
+ "type": "Deployment",
1139
+ }),
1140
+ },
1141
+ {
1142
+ "name": "customincident",
1143
+ "identifier": "customincident",
1144
+ "type": "CustomIncident",
1145
+ "enabled": True,
1146
+ "category": "Alert",
1147
+ "spec": json.dumps({
1148
+ "type": "Alert",
1149
+ "authorizationToken": "abc",
1150
+ }),
1151
+ },
1152
+ ],
1153
+ "notification_rule_refs": [
1154
+ {
1155
+ "notification_rule_ref": "notification_rule_ref",
1156
+ "enabled": True,
1157
+ },
1158
+ {
1159
+ "notification_rule_ref": "notification_rule_ref1",
1160
+ "enabled": False,
1161
+ },
1162
+ ],
1163
+ })
1164
+ #Sample template for Sumologic Metrics Health Source
1165
+ example1 = harness.platform.MonitoredService("example1",
1166
+ org_id="org_id",
1167
+ project_id="project_id",
1168
+ identifier="identifier",
1169
+ request={
1170
+ "name": "name",
1171
+ "type": "Application",
1172
+ "description": "description",
1173
+ "service_ref": "service_ref",
1174
+ "environment_ref": "environment_ref",
1175
+ "tags": [
1176
+ "foo:bar",
1177
+ "bar:foo",
1178
+ ],
1179
+ "health_sources": [{
1180
+ "name": "sumologicmetrics",
1181
+ "identifier": "sumo_metric_identifier",
1182
+ "type": "SumologicMetrics",
1183
+ "version": "v2",
1184
+ "spec": json.dumps({
1185
+ "connectorRef": "connectorRef",
1186
+ "queryDefinitions": [
1187
+ {
1188
+ "name": "metric_cpu",
1189
+ "identifier": "metric_cpu",
1190
+ "query": "metric=cpu",
1191
+ "groupName": "g1",
1192
+ "queryParams": {
1193
+ "serviceInstanceField": "_sourcehost",
1194
+ },
1195
+ "riskProfile": {
1196
+ "riskCategory": "Performance_Other",
1197
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
1198
+ },
1199
+ "liveMonitoringEnabled": "true",
1200
+ "continuousVerificationEnabled": "true",
1201
+ "sliEnabled": "false",
1202
+ "metricThresholds": [
1203
+ {
1204
+ "type": "IgnoreThreshold",
1205
+ "spec": {
1206
+ "action": "Ignore",
1207
+ },
1208
+ "criteria": {
1209
+ "type": "Absolute",
1210
+ "spec": {
1211
+ "greaterThan": 100,
1212
+ },
1213
+ },
1214
+ "metricType": "Custom",
1215
+ "metricName": "metric_cpu",
1216
+ },
1217
+ {
1218
+ "type": "FailImmediately",
1219
+ "spec": {
1220
+ "action": "FailAfterOccurrence",
1221
+ "spec": {
1222
+ "count": 2,
1223
+ },
1224
+ },
1225
+ "criteria": {
1226
+ "type": "Absolute",
1227
+ "spec": {
1228
+ "greaterThan": 100,
1229
+ },
1230
+ },
1231
+ "metricType": "Custom",
1232
+ "metricName": "metric_cpu",
1233
+ },
1234
+ ],
1235
+ },
1236
+ {
1237
+ "name": "name2",
1238
+ "identifier": "identifier2",
1239
+ "groupName": "g2",
1240
+ "query": "metric=memory",
1241
+ "queryParams": {
1242
+ "serviceInstanceField": "_sourcehost",
1243
+ },
1244
+ "riskProfile": {
1245
+ "riskCategory": "Performance_Other",
1246
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
1247
+ },
1248
+ "liveMonitoringEnabled": "false",
1249
+ "continuousVerificationEnabled": "false",
1250
+ "sliEnabled": "false",
1251
+ },
1252
+ ],
1253
+ }),
1254
+ }],
1255
+ })
1256
+ #Sample template for Sumologic Log Health Source
1257
+ example2 = harness.platform.MonitoredService("example2",
1258
+ org_id="org_id",
1259
+ project_id="project_id",
1260
+ identifier="identifier",
1261
+ request={
1262
+ "name": "name",
1263
+ "type": "Application",
1264
+ "description": "description",
1265
+ "service_ref": "service_ref",
1266
+ "environment_ref": "environment_ref",
1267
+ "tags": [
1268
+ "foo:bar",
1269
+ "bar:foo",
1270
+ ],
1271
+ "health_sources": [{
1272
+ "name": "sumologic",
1273
+ "identifier": "sumo_metric_identifier",
1274
+ "type": "SumologicLogs",
1275
+ "version": "v2",
1276
+ "spec": json.dumps({
1277
+ "connectorRef": "connectorRef",
1278
+ "queryDefinitions": [
1279
+ {
1280
+ "name": "log1",
1281
+ "identifier": "log1",
1282
+ "query": "*",
1283
+ "groupName": "Logs Group",
1284
+ "queryParams": {
1285
+ "serviceInstanceField": "_sourcehost",
1286
+ },
1287
+ },
1288
+ {
1289
+ "name": "log2",
1290
+ "identifier": "identifier2",
1291
+ "groupName": "g2",
1292
+ "query": "error",
1293
+ "queryParams": {
1294
+ "serviceInstanceField": "_sourcehost",
1295
+ },
1296
+ },
1297
+ ],
1298
+ }),
1299
+ }],
1300
+ })
1301
+ #Sample template for Splunk Signal FX Health Source
1302
+ example3 = harness.platform.MonitoredService("example3",
1303
+ org_id="org_id",
1304
+ project_id="project_id",
1305
+ identifier="identifier",
1306
+ request={
1307
+ "name": "name",
1308
+ "type": "Application",
1309
+ "description": "description",
1310
+ "service_ref": "service_ref",
1311
+ "environment_ref": "environment_ref",
1312
+ "tags": [
1313
+ "foo:bar",
1314
+ "bar:foo",
1315
+ ],
1316
+ "health_sources": [{
1317
+ "name": "signalfxmetrics",
1318
+ "identifier": "signalfxmetrics",
1319
+ "type": "SplunkSignalFXMetrics",
1320
+ "version": "v2",
1321
+ "spec": json.dumps({
1322
+ "connectorRef": "connectorRef",
1323
+ "queryDefinitions": [
1324
+ {
1325
+ "name": "metric_infra_cpu",
1326
+ "identifier": "metric_infra_cpu",
1327
+ "query": "***",
1328
+ "groupName": "g",
1329
+ "riskProfile": {
1330
+ "riskCategory": "Errors",
1331
+ "thresholdTypes": [
1332
+ "ACT_WHEN_HIGHER",
1333
+ "ACT_WHEN_LOWER",
1334
+ ],
1335
+ },
1336
+ "liveMonitoringEnabled": "true",
1337
+ "continuousVerificationEnabled": "true",
1338
+ "sliEnabled": "false",
1339
+ },
1340
+ {
1341
+ "name": "name2",
1342
+ "identifier": "identifier2",
1343
+ "groupName": "g2",
1344
+ "query": "*",
1345
+ "riskProfile": {
1346
+ "riskCategory": "Performance_Other",
1347
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
1348
+ },
1349
+ "liveMonitoringEnabled": "true",
1350
+ "continuousVerificationEnabled": "false",
1351
+ "sliEnabled": "false",
1352
+ "metricThresholds": [
1353
+ {
1354
+ "type": "IgnoreThreshold",
1355
+ "spec": {
1356
+ "action": "Ignore",
1357
+ },
1358
+ "criteria": {
1359
+ "type": "Absolute",
1360
+ "spec": {
1361
+ "greaterThan": 100,
1362
+ },
1363
+ },
1364
+ "metrictype": "Custom",
1365
+ "metricName": "identifier2",
1366
+ },
1367
+ {
1368
+ "type": "FailImmediately",
1369
+ "spec": {
1370
+ "action": "FailAfterOccurrence",
1371
+ "spec": {
1372
+ "count": 2,
1373
+ },
1374
+ },
1375
+ "criteria": {
1376
+ "type": "Absolute",
1377
+ "spec": {
1378
+ "greaterThan": 100,
1379
+ },
1380
+ },
1381
+ "metricType": "Custom",
1382
+ "metricName": "identifier2",
1383
+ },
1384
+ ],
1385
+ },
1386
+ ],
1387
+ }),
1388
+ }],
1389
+ })
1390
+ #Sample template for Grafana Loki Log Health Source
1391
+ example4 = harness.platform.MonitoredService("example4",
1392
+ org_id="org_id",
1393
+ project_id="project_id",
1394
+ identifier="identifier",
1395
+ request={
1396
+ "name": "name",
1397
+ "type": "Application",
1398
+ "description": "description",
1399
+ "service_ref": "service_ref",
1400
+ "environment_ref": "environment_ref",
1401
+ "tags": [
1402
+ "foo:bar",
1403
+ "bar:foo",
1404
+ ],
1405
+ "health_sources": [{
1406
+ "name": "Test",
1407
+ "identifier": "Test",
1408
+ "type": "GrafanaLokiLogs",
1409
+ "version": "v2",
1410
+ "spec": json.dumps({
1411
+ "connectorRef": "connectorRef",
1412
+ "queryDefinitions": [
1413
+ {
1414
+ "name": "Demo",
1415
+ "identifier": "Demo",
1416
+ "query": "{job=~\\".+\\"}",
1417
+ "groupName": "Log_Group",
1418
+ "queryParams": {
1419
+ "serviceInstanceField": "job",
1420
+ },
1421
+ },
1422
+ {
1423
+ "name": "log2",
1424
+ "identifier": "identifier2",
1425
+ "groupName": "g2",
1426
+ "query": "error",
1427
+ "queryParams": {
1428
+ "serviceInstanceField": "_sourcehost",
1429
+ },
1430
+ "liveMonitoringEnabled": "false",
1431
+ "continuousVerificationEnabled": "false",
1432
+ "sliEnabled": "false",
1433
+ },
1434
+ ],
1435
+ }),
1436
+ }],
1437
+ })
1438
+ #Sample template for Azure Metrics Health Source
1439
+ example5 = harness.platform.MonitoredService("example5",
1440
+ org_id="org_id",
1441
+ project_id="project_id",
1442
+ identifier="identifier",
1443
+ request={
1444
+ "name": "name",
1445
+ "type": "Application",
1446
+ "description": "description",
1447
+ "service_ref": "service_ref",
1448
+ "environment_ref": "environment_ref",
1449
+ "tags": [
1450
+ "foo:bar",
1451
+ "bar:foo",
1452
+ ],
1453
+ "health_sources": [{
1454
+ "name": "azure metrics verify step",
1455
+ "identifier": "azure_metrics_verify_step",
1456
+ "type": "AzureMetrics",
1457
+ "version": "v2",
1458
+ "spec": json.dumps({
1459
+ "connectorRef": "connectorRef",
1460
+ "queryDefinitions": [
1461
+ {
1462
+ "name": "metric",
1463
+ "identifier": "metric",
1464
+ "query": "default",
1465
+ "groupName": "g1",
1466
+ "queryParams": {
1467
+ "serviceInstanceField": "host",
1468
+ "index": "/subscriptions/12d2db62-5aa9-471d-84bb-faa489b3e319/resourceGroups/srm-test/providers/Microsoft.ContainerService/managedClusters/srm-test",
1469
+ "healthSourceMetricName": "cpuUsagePercentage",
1470
+ "healthSourceMetricNamespace": "insights.container/nodes",
1471
+ "aggregationType": "average",
1472
+ },
1473
+ "riskProfile": {
1474
+ "riskCategory": "Performance_Other",
1475
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
1476
+ },
1477
+ "liveMonitoringEnabled": "true",
1478
+ "continuousVerificationEnabled": "true",
1479
+ "sliEnabled": "false",
1480
+ "metricThresholds": [
1481
+ {
1482
+ "type": "IgnoreThreshold",
1483
+ "spec": {
1484
+ "action": "Ignore",
1485
+ },
1486
+ "criteria": {
1487
+ "type": "Absolute",
1488
+ "spec": {
1489
+ "greaterThan": 100,
1490
+ },
1491
+ },
1492
+ "metrictype": "Custom",
1493
+ "metricName": "metric",
1494
+ },
1495
+ {
1496
+ "type": "FailImmediately",
1497
+ "spec": {
1498
+ "action": "FailAfterOccurrence",
1499
+ "spec": {
1500
+ "count": 2,
1501
+ },
1502
+ },
1503
+ "criteria": {
1504
+ "type": "Absolute",
1505
+ "spec": {
1506
+ "greaterThan": 100,
1507
+ },
1508
+ },
1509
+ "metricType": "Custom",
1510
+ "metricName": "metric",
1511
+ },
1512
+ ],
1513
+ },
1514
+ {
1515
+ "name": "name2",
1516
+ "identifier": "identifier2",
1517
+ "groupName": "g2",
1518
+ "queryParams": {
1519
+ "serviceInstanceField": "host",
1520
+ "index": "/subscriptions/12d2db62-5aa9-471d-84bb-faa489b3e319/resourceGroups/srm-test/providers/Microsoft.ContainerService/managedClusters/srm-test",
1521
+ "healthSourceMetricName": "cpuUsagePercentage",
1522
+ "healthSourceMetricNamespace": "insights.container/nodes",
1523
+ "aggregationType": "average",
1524
+ },
1525
+ "riskProfile": {
1526
+ "riskCategory": "Performance_Other",
1527
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
1528
+ },
1529
+ "liveMonitoringEnabled": "false",
1530
+ "continuousVerificationEnabled": "false",
1531
+ "sliEnabled": "false",
1532
+ },
1533
+ ],
1534
+ }),
1535
+ }],
1536
+ })
1537
+ #Sample template for Azure Log Health Source
1538
+ example6 = harness.platform.MonitoredService("example6",
1539
+ org_id="org_id",
1540
+ project_id="project_id",
1541
+ identifier="identifier",
1542
+ request={
1543
+ "name": "name",
1544
+ "type": "Application",
1545
+ "description": "description",
1546
+ "service_ref": "service_ref",
1547
+ "environment_ref": "environment_ref",
1548
+ "tags": [
1549
+ "foo:bar",
1550
+ "bar:foo",
1551
+ ],
1552
+ "health_sources": [{
1553
+ "name": "Demo azure",
1554
+ "identifier": "Demo_azure",
1555
+ "type": "AzureLogs",
1556
+ "version": "v2",
1557
+ "spec": json.dumps({
1558
+ "connectorRef": "connectorRef",
1559
+ "queryDefinitions": [{
1560
+ "name": "name2",
1561
+ "identifier": "identifier2",
1562
+ "groupName": "g2",
1563
+ "query": "*",
1564
+ "queryParams": {
1565
+ "serviceInstanceField": "Name",
1566
+ "timeStampIdentifier": "StartedTime",
1567
+ "messageIdentifier": "Image",
1568
+ "index": "/subscriptions/12d2db62-5aa9-471d-84bb-faa489b3e319/resourceGroups/srm-test/providers/Microsoft.ContainerService/managedClusters/srm-test",
1569
+ },
1570
+ "liveMonitoringEnabled": "false",
1571
+ "continuousVerificationEnabled": "false",
1572
+ }],
1573
+ }),
1574
+ }],
1575
+ })
1576
+ #Sample template for Prometheus Metrics Health Source
1577
+ example7 = harness.platform.MonitoredService("example7",
1578
+ org_id="org_id",
1579
+ project_id="project_id",
1580
+ identifier="identifier",
1581
+ request={
1582
+ "name": "name",
1583
+ "type": "Application",
1584
+ "description": "description",
1585
+ "service_ref": "service_ref",
1586
+ "environment_ref": "environment_ref",
1587
+ "tags": [
1588
+ "foo:bar",
1589
+ "bar:foo",
1590
+ ],
1591
+ "health_sources": [{
1592
+ "name": "prometheus metrics verify step",
1593
+ "identifier": "prometheus_metrics",
1594
+ "type": "Prometheus",
1595
+ "spec": json.dumps({
1596
+ "connectorRef": "connectorRef",
1597
+ "metricDefinitions": [{
1598
+ "identifier": "Prometheus_Metric",
1599
+ "metricName": "Prometheus Metric",
1600
+ "riskProfile": {
1601
+ "riskCategory": "Performance_Other",
1602
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
1603
+ },
1604
+ "analysis": {
1605
+ "liveMonitoring": {
1606
+ "enabled": True,
1607
+ },
1608
+ "deploymentVerification": {
1609
+ "enabled": True,
1610
+ "serviceInstanceFieldName": "pod_name",
1611
+ },
1612
+ },
1613
+ "query": "count(up{group=\\"cv\\",group=\\"cv\\"})",
1614
+ "groupName": "met",
1615
+ "isManualQuery": True,
1616
+ }],
1617
+ "metricPacks": [{
1618
+ "identifier": "Custom",
1619
+ "metricThresholds": [
1620
+ {
1621
+ "type": "IgnoreThreshold",
1622
+ "spec": {
1623
+ "action": "Ignore",
1624
+ },
1625
+ "criteria": {
1626
+ "type": "Absolute",
1627
+ "spec": {
1628
+ "greaterThan": 100,
1629
+ },
1630
+ },
1631
+ "metrictype": "Custom",
1632
+ "metricName": "Prometheus Metric",
1633
+ },
1634
+ {
1635
+ "type": "FailImmediately",
1636
+ "spec": {
1637
+ "action": "FailAfterOccurrence",
1638
+ "spec": {
1639
+ "count": 2,
1640
+ },
1641
+ },
1642
+ "criteria": {
1643
+ "type": "Absolute",
1644
+ "spec": {
1645
+ "greaterThan": 100,
1646
+ },
1647
+ },
1648
+ "metricType": "Custom",
1649
+ "metricName": "Prometheus Metric",
1650
+ },
1651
+ ],
1652
+ }],
1653
+ }),
1654
+ }],
1655
+ })
1656
+ #Sample template for Datadog Metrics Health Source
1657
+ example8 = harness.platform.MonitoredService("example8",
1658
+ org_id="org_id",
1659
+ project_id="project_id",
1660
+ identifier="identifier",
1661
+ request={
1662
+ "name": "name",
1663
+ "type": "Application",
1664
+ "description": "description",
1665
+ "service_ref": "service_ref",
1666
+ "environment_ref": "environment_ref",
1667
+ "tags": [
1668
+ "foo:bar",
1669
+ "bar:foo",
1670
+ ],
1671
+ "health_sources": [{
1672
+ "name": "ddm",
1673
+ "identifier": "ddm",
1674
+ "type": "DatadogMetrics",
1675
+ "spec": json.dumps({
1676
+ "connectorRef": "connectorRef",
1677
+ "feature": "Datadog Cloud Metrics",
1678
+ "metricDefinitions": [
1679
+ {
1680
+ "metricName": "metric",
1681
+ "metricPath": "M1",
1682
+ "identifier": "metric",
1683
+ "query": \"\"\"avg:kubernetes.cpu.limits{*}.rollup(avg, 60);
1684
+ avg:kubernetes.cpu.limits{*}.rollup(avg, 30);
1685
+ (a+b)/10\"\"\",
1686
+ "isManualQuery": True,
1687
+ "isCustomCreatedMetric": True,
1688
+ "riskProfile": {
1689
+ "riskCategory": "Performance_Other",
1690
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
1691
+ },
1692
+ "analysis": {
1693
+ "liveMonitoring": {
1694
+ "enabled": True,
1695
+ },
1696
+ "deploymentVerification": {
1697
+ "enabled": True,
1698
+ "serviceInstanceFieldName": "pod",
1699
+ },
1700
+ },
1701
+ },
1702
+ {
1703
+ "metricName": "dashboard_metric_cpu",
1704
+ "identifier": "metric_cpu",
1705
+ "query": \"\"\"avg:kubernetes.cpu.limits{*}.rollup(avg, 60);
1706
+ avg:kubernetes.cpu.limits{*}.rollup(avg, 30);
1707
+ (a+b)/10\"\"\",
1708
+ "isManualQuery": False,
1709
+ "dashboardName": "dashboard",
1710
+ "metricPath": "M1",
1711
+ "groupingQuery": "avg:kubernetes.cpu.limits{*} by {host}.rollup(avg, 60)",
1712
+ "metric": "kubernetes.cpu.limits",
1713
+ "aggregation": "avg",
1714
+ "isCustomCreatedMetric": True,
1715
+ "riskProfile": {
1716
+ "riskCategory": "Performance_Other",
1717
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
1718
+ },
1719
+ "analysis": {
1720
+ "liveMonitoring": {
1721
+ "enabled": True,
1722
+ },
1723
+ "deploymentVerification": {
1724
+ "enabled": True,
1725
+ "serviceInstanceFieldName": "pod",
1726
+ },
1727
+ },
1728
+ },
1729
+ ],
1730
+ "metricPacks": [{
1731
+ "identifier": "Custom",
1732
+ "metricThresholds": [
1733
+ {
1734
+ "type": "IgnoreThreshold",
1735
+ "spec": {
1736
+ "action": "Ignore",
1737
+ },
1738
+ "criteria": {
1739
+ "type": "Absolute",
1740
+ "spec": {
1741
+ "greaterThan": 100,
1742
+ },
1743
+ },
1744
+ "metrictype": "Custom",
1745
+ "metricName": "metric",
1746
+ },
1747
+ {
1748
+ "type": "FailImmediately",
1749
+ "spec": {
1750
+ "action": "FailAfterOccurrence",
1751
+ "spec": {
1752
+ "count": 2,
1753
+ },
1754
+ },
1755
+ "criteria": {
1756
+ "type": "Absolute",
1757
+ "spec": {
1758
+ "greaterThan": 100,
1759
+ },
1760
+ },
1761
+ "metricType": "Custom",
1762
+ "metricName": "metric",
1763
+ },
1764
+ ],
1765
+ }],
1766
+ }),
1767
+ }],
1768
+ })
1769
+ #Sample template for New Relic Metrics Health Source
1770
+ example9 = harness.platform.MonitoredService("example9",
1771
+ org_id="org_id",
1772
+ project_id="project_id",
1773
+ identifier="identifier",
1774
+ request={
1775
+ "name": "name",
1776
+ "type": "Application",
1777
+ "description": "description",
1778
+ "service_ref": "service_ref",
1779
+ "environment_ref": "environment_ref",
1780
+ "tags": [
1781
+ "foo:bar",
1782
+ "bar:foo",
1783
+ ],
1784
+ "health_sources": [{
1785
+ "name": "name",
1786
+ "identifier": "identifier",
1787
+ "type": "NewRelic",
1788
+ "spec": json.dumps({
1789
+ "connectorRef": "account.Newrelicautomation_do_not_delete",
1790
+ "feature": "apm",
1791
+ "applicationId": "107019083",
1792
+ "applicationName": "My Application",
1793
+ "metricData": {
1794
+ "Performance": True,
1795
+ },
1796
+ "metricPacks": [{
1797
+ "identifier": "Performance",
1798
+ }],
1799
+ "newRelicMetricDefinitions": [{
1800
+ "identifier": "New_Relic_Metric",
1801
+ "metricName": "New Relic Metric",
1802
+ "riskProfile": {
1803
+ "riskCategory": "Performance_Other",
1804
+ "thresholdTypes": ["ACT_WHEN_HIGHER"],
1805
+ },
1806
+ "analysis": {
1807
+ "deploymentVerification": {
1808
+ "enabled": True,
1809
+ },
1810
+ },
1811
+ "groupName": "group1",
1812
+ "nrql": "SELECT count(apm.service.instance.count) FROM Metric WHERE appName LIKE 'My Application' TIMESERIES",
1813
+ "responseMapping": {
1814
+ "metricValueJsonPath": "$.['timeSeries'].[*].['results'].[*].['count']",
1815
+ "timestampJsonPath": "$.['timeSeries'].[*].['beginTimeSeconds']",
1816
+ },
1817
+ }],
1818
+ "metricPacks": [{
1819
+ "identifier": "Custom",
1820
+ "metricThresholds": [
1821
+ {
1822
+ "type": "IgnoreThreshold",
1823
+ "spec": {
1824
+ "action": "Ignore",
1825
+ },
1826
+ "criteria": {
1827
+ "type": "Absolute",
1828
+ "spec": {
1829
+ "greaterThan": 100,
1830
+ },
1831
+ },
1832
+ "metricType": "Custom",
1833
+ "metricName": "New Relic Metric",
1834
+ },
1835
+ {
1836
+ "type": "FailImmediately",
1837
+ "spec": {
1838
+ "action": "FailAfterOccurrence",
1839
+ "spec": {
1840
+ "count": 2,
1841
+ },
1842
+ },
1843
+ "criteria": {
1844
+ "type": "Absolute",
1845
+ "spec": {
1846
+ "greaterThan": 100,
1847
+ },
1848
+ },
1849
+ "metricType": "Custom",
1850
+ "metricName": "New Relic Metric",
1851
+ },
1852
+ ],
1853
+ }],
1854
+ }),
1855
+ }],
1856
+ })
1857
+ ```
1858
+
1859
+ ## Import
1860
+
1861
+ Import account level monitored_service
1862
+
1863
+ ```sh
1864
+ $ pulumi import harness:platform/monitoredService:MonitoredService example <monitored_service_id>
1865
+ ```
1866
+
1867
+ Import organization level monitored_service
1868
+
1869
+ ```sh
1870
+ $ pulumi import harness:platform/monitoredService:MonitoredService example <org_id>/<monitored_service_id>
1871
+ ```
1872
+
1873
+ Import project level monitored_service
1874
+
1875
+ ```sh
1876
+ $ pulumi import harness:platform/monitoredService:MonitoredService example <org_id>/<project_id>/<monitored_service_id>
1877
+ ```
1878
+
1879
+ :param str resource_name: The name of the resource.
1880
+ :param MonitoredServiceArgs args: The arguments to use to populate this resource's properties.
1881
+ :param pulumi.ResourceOptions opts: Options for the resource.
1882
+ """
1883
+ ...
1884
+ def __init__(__self__, resource_name: str, *args, **kwargs):
1885
+ resource_args, opts = _utilities.get_resource_args_opts(MonitoredServiceArgs, pulumi.ResourceOptions, *args, **kwargs)
1886
+ if resource_args is not None:
1887
+ __self__._internal_init(resource_name, opts, **resource_args.__dict__)
1888
+ else:
1889
+ __self__._internal_init(resource_name, *args, **kwargs)
1890
+
1891
+ def _internal_init(__self__,
1892
+ resource_name: str,
1893
+ opts: Optional[pulumi.ResourceOptions] = None,
1894
+ identifier: Optional[pulumi.Input[str]] = None,
1895
+ org_id: Optional[pulumi.Input[str]] = None,
1896
+ project_id: Optional[pulumi.Input[str]] = None,
1897
+ request: Optional[pulumi.Input[Union['MonitoredServiceRequestArgs', 'MonitoredServiceRequestArgsDict']]] = None,
1898
+ __props__=None):
1899
+ opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
1900
+ if not isinstance(opts, pulumi.ResourceOptions):
1901
+ raise TypeError('Expected resource options to be a ResourceOptions instance')
1902
+ if opts.id is None:
1903
+ if __props__ is not None:
1904
+ raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
1905
+ __props__ = MonitoredServiceArgs.__new__(MonitoredServiceArgs)
1906
+
1907
+ if identifier is None and not opts.urn:
1908
+ raise TypeError("Missing required property 'identifier'")
1909
+ __props__.__dict__["identifier"] = identifier
1910
+ if org_id is None and not opts.urn:
1911
+ raise TypeError("Missing required property 'org_id'")
1912
+ __props__.__dict__["org_id"] = org_id
1913
+ if project_id is None and not opts.urn:
1914
+ raise TypeError("Missing required property 'project_id'")
1915
+ __props__.__dict__["project_id"] = project_id
1916
+ __props__.__dict__["request"] = request
1917
+ super(MonitoredService, __self__).__init__(
1918
+ 'harness:platform/monitoredService:MonitoredService',
1919
+ resource_name,
1920
+ __props__,
1921
+ opts)
1922
+
1923
+ @staticmethod
1924
+ def get(resource_name: str,
1925
+ id: pulumi.Input[str],
1926
+ opts: Optional[pulumi.ResourceOptions] = None,
1927
+ identifier: Optional[pulumi.Input[str]] = None,
1928
+ org_id: Optional[pulumi.Input[str]] = None,
1929
+ project_id: Optional[pulumi.Input[str]] = None,
1930
+ request: Optional[pulumi.Input[Union['MonitoredServiceRequestArgs', 'MonitoredServiceRequestArgsDict']]] = None) -> 'MonitoredService':
1931
+ """
1932
+ Get an existing MonitoredService resource's state with the given name, id, and optional extra
1933
+ properties used to qualify the lookup.
1934
+
1935
+ :param str resource_name: The unique name of the resulting resource.
1936
+ :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
1937
+ :param pulumi.ResourceOptions opts: Options for the resource.
1938
+ :param pulumi.Input[str] identifier: Identifier of the monitored service.
1939
+ :param pulumi.Input[str] org_id: Identifier of the organization in which the monitored service is configured.
1940
+ :param pulumi.Input[str] project_id: Identifier of the project in which the monitored service is configured.
1941
+ :param pulumi.Input[Union['MonitoredServiceRequestArgs', 'MonitoredServiceRequestArgsDict']] request: Request for creating or updating a monitored service.
1942
+ """
1943
+ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
1944
+
1945
+ __props__ = _MonitoredServiceState.__new__(_MonitoredServiceState)
1946
+
1947
+ __props__.__dict__["identifier"] = identifier
1948
+ __props__.__dict__["org_id"] = org_id
1949
+ __props__.__dict__["project_id"] = project_id
1950
+ __props__.__dict__["request"] = request
1951
+ return MonitoredService(resource_name, opts=opts, __props__=__props__)
1952
+
1953
+ @property
1954
+ @pulumi.getter
1955
+ def identifier(self) -> pulumi.Output[str]:
1956
+ """
1957
+ Identifier of the monitored service.
1958
+ """
1959
+ return pulumi.get(self, "identifier")
1960
+
1961
+ @property
1962
+ @pulumi.getter(name="orgId")
1963
+ def org_id(self) -> pulumi.Output[str]:
1964
+ """
1965
+ Identifier of the organization in which the monitored service is configured.
1966
+ """
1967
+ return pulumi.get(self, "org_id")
1968
+
1969
+ @property
1970
+ @pulumi.getter(name="projectId")
1971
+ def project_id(self) -> pulumi.Output[str]:
1972
+ """
1973
+ Identifier of the project in which the monitored service is configured.
1974
+ """
1975
+ return pulumi.get(self, "project_id")
1976
+
1977
+ @property
1978
+ @pulumi.getter
1979
+ def request(self) -> pulumi.Output[Optional['outputs.MonitoredServiceRequest']]:
1980
+ """
1981
+ Request for creating or updating a monitored service.
1982
+ """
1983
+ return pulumi.get(self, "request")
1984
+