Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

add new datadog app connection

adilson6f04deb56006
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index ecf161488d..cac34aad10 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -2794,6 +2794,11 @@ export const AppConnections = {
instanceUrl: "The Octopus Deploy instance URL to connect to.",
apiKey: "The API key used to authenticate with Octopus Deploy."
},
+ DATADOG: {
+ url: "The Datadog site URL to connect to (e.g., 'https://api.datadoghq.com').",
+ apiKey: "The Datadog API key used to authenticate.",
+ applicationKey: "The Datadog Application key used to authenticate."
+ },
SSH: {
host: "The hostname or IP address of the SSH server.",
port: "The port number of the SSH server (default: 22).",
diff --git a/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts
index cc00ac74a3..57e02bee7d 100644
--- a/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts
+++ b/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts
@@ -73,6 +73,10 @@ import {
DatabricksConnectionListItemSchema,
SanitizedDatabricksConnectionSchema
} from "@app/services/app-connection/databricks";
+import {
+ DatadogConnectionListItemSchema,
+ SanitizedDatadogConnectionSchema
+} from "@app/services/app-connection/datadog";
import { DbtConnectionListItemSchema, SanitizedDbtConnectionSchema } from "@app/services/app-connection/dbt";
import { DevinConnectionListItemSchema, SanitizedDevinConnectionSchema } from "@app/services/app-connection/devin";
import {
@@ -259,7 +263,8 @@ const SanitizedAppConnectionSchema = z.union([
...SanitizedOnaConnectionSchema.options,
...SanitizedDigiCertConnectionSchema.options,
...SanitizedTravisCIConnectionSchema.options,
- ...SanitizedSnowflakeConnectionSchema.options
+ ...SanitizedSnowflakeConnectionSchema.options,
+ ...SanitizedDatadogConnectionSchema.options
]);
const AppConnectionOptionsSchema = z.discriminatedUnion("app", [
@@ -326,7 +331,8 @@ const AppConnectionOptionsSchema = z.discriminatedUnion("app", [
OnaConnectionListItemSchema,
DigiCertConnectionListItemSchema,
TravisCIConnectionListItemSchema,
- SnowflakeConnectionListItemSchema
+ SnowflakeConnectionListItemSchema,
+ DatadogConnectionListItemSchema
]);
export const registerAppConnectionRouter = async (server: FastifyZodProvider) => {
diff --git a/backend/src/server/routes/v1/app-connection-routers/datadog-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/datadog-connection-router.ts
new file mode 100644
index 0000000000..1c2faa8c6c
--- /dev/null
+++ b/backend/src/server/routes/v1/app-connection-routers/datadog-connection-router.ts
@@ -0,0 +1,18 @@
+import { AppConnection } from "@app/services/app-connection/app-connection-enums";
+import {
+ CreateDatadogConnectionSchema,
+ SanitizedDatadogConnectionSchema,
+ UpdateDatadogConnectionSchema
+} from "@app/services/app-connection/datadog";
+
+import { registerAppConnectionEndpoints } from "./app-connection-endpoints";
+
+export const registerDatadogConnectionRouter = async (server: FastifyZodProvider) => {
+ registerAppConnectionEndpoints({
+ app: AppConnection.Datadog,
+ server,
+ sanitizedResponseSchema: SanitizedDatadogConnectionSchema,
+ createSchema: CreateDatadogConnectionSchema,
+ updateSchema: UpdateDatadogConnectionSchema
+ });
+};
diff --git a/backend/src/server/routes/v1/app-connection-routers/index.ts b/backend/src/server/routes/v1/app-connection-routers/index.ts
index 5558e53fa1..52566fa7aa 100644
--- a/backend/src/server/routes/v1/app-connection-routers/index.ts
+++ b/backend/src/server/routes/v1/app-connection-routers/index.ts
@@ -20,6 +20,7 @@ import { registerChecklyConnectionRouter } from "./checkly-connection-router";
import { registerCircleCIConnectionRouter } from "./circleci-connection-router";
import { registerCloudflareConnectionRouter } from "./cloudflare-connection-router";
import { registerDatabricksConnectionRouter } from "./databricks-connection-router";
+import { registerDatadogConnectionRouter } from "./datadog-connection-router";
import { registerDbtConnectionRouter } from "./dbt-connection-router";
import { registerDevinConnectionRouter } from "./devin-connection-router";
import { registerDigiCertConnectionRouter } from "./digicert-connection-router";
@@ -132,5 +133,6 @@ export const APP_CONNECTION_REGISTER_ROUTER_MAP: Record<AppConnection, (server:
[AppConnection.Ona]: registerOnaConnectionRouter,
[AppConnection.DigiCert]: registerDigiCertConnectionRouter,
[AppConnection.TravisCI]: registerTravisCIConnectionRouter,
- [AppConnection.Snowflake]: registerSnowflakeConnectionRouter
+ [AppConnection.Snowflake]: registerSnowflakeConnectionRouter,
+ [AppConnection.Datadog]: registerDatadogConnectionRouter
};
diff --git a/backend/src/services/app-connection/app-connection-enums.ts b/backend/src/services/app-connection/app-connection-enums.ts
index cb6f8a724c..556ce1e2f4 100644
--- a/backend/src/services/app-connection/app-connection-enums.ts
+++ b/backend/src/services/app-connection/app-connection-enums.ts
@@ -62,7 +62,8 @@ export enum AppConnection {
Ona = "ona",
DigiCert = "digicert",
TravisCI = "travis-ci",
- Snowflake = "snowflake"
+ Snowflake = "snowflake",
+ Datadog = "datadog"
}
export enum AWSRegion {
diff --git a/backend/src/services/app-connection/app-connection-fns.ts b/backend/src/services/app-connection/app-connection-fns.ts
index 056cb0849b..8788a865f3 100644
--- a/backend/src/services/app-connection/app-connection-fns.ts
+++ b/backend/src/services/app-connection/app-connection-fns.ts
@@ -107,6 +107,7 @@ import {
getDatabricksConnectionListItem,
validateDatabricksConnectionCredentials
} from "./databricks/databricks-connection-fns";
+import { DatadogConnectionMethod, getDatadogConnectionListItem, validateDatadogConnectionCredentials } from "./datadog";
import { DbtConnectionMethod, getDbtConnectionListItem, validateDbtConnectionCredentials } from "./dbt";
import { DevinConnectionMethod, getDevinConnectionListItem, validateDevinConnectionCredentials } from "./devin";
import {
@@ -327,7 +328,8 @@ export const listAppConnectionOptions = (projectType?: ProjectType) => {
getOnaConnectionListItem(),
getDigiCertConnectionListItem(),
getTravisCIConnectionListItem(),
- getSnowflakeConnectionListItem()
+ getSnowflakeConnectionListItem(),
+ getDatadogConnectionListItem()
]
.filter((option) => {
switch (projectType) {
@@ -490,7 +492,8 @@ export const validateAppConnectionCredentials = async (
[AppConnection.Doppler]: validateDopplerConnectionCredentials as TAppConnectionCredentialsValidator,
[AppConnection.OVH]: validateOvhConnectionCredentials as TAppConnectionCredentialsValidator,
[AppConnection.DigiCert]: validateDigiCertConnectionCredentials as TAppConnectionCredentialsValidator,
- [AppConnection.Snowflake]: validateSnowflakeConnectionCredentials as TAppConnectionCredentialsValidator
+ [AppConnection.Snowflake]: validateSnowflakeConnectionCredentials as TAppConnectionCredentialsValidator,
+ [AppConnection.Datadog]: validateDatadogConnectionCredentials as TAppConnectionCredentialsValidator
};
return VALIDATE_APP_CONNECTION_CREDENTIALS_MAP[appConnection.app](appConnection, gatewayService, gatewayV2Service);
@@ -582,6 +585,7 @@ export const getAppConnectionMethodName = (method: TAppConnection["method"]) =>
case AnthropicConnectionMethod.ApiKey:
case DevinConnectionMethod.ApiKey:
case DigiCertConnectionMethod.ApiKey:
+ case DatadogConnectionMethod.ApiKey:
return "API Key";
case ChefConnectionMethod.UserKey:
return "User Key";
@@ -712,7 +716,8 @@ export const TRANSITION_CONNECTION_CREDENTIALS_TO_PLATFORM: Record<
[AppConnection.Ona]: platformManagedCredentialsNotSupported,
[AppConnection.DigiCert]: platformManagedCredentialsNotSupported,
[AppConnection.TravisCI]: platformManagedCredentialsNotSupported,
- [AppConnection.Snowflake]: platformManagedCredentialsNotSupported
+ [AppConnection.Snowflake]: platformManagedCredentialsNotSupported,
+ [AppConnection.Datadog]: platformManagedCredentialsNotSupported
};
export const enterpriseAppCheck = async (
diff --git a/backend/src/services/app-connection/app-connection-maps.ts b/backend/src/services/app-connection/app-connection-maps.ts
index f4d814933f..e33a869165 100644
--- a/backend/src/services/app-connection/app-connection-maps.ts
+++ b/backend/src/services/app-connection/app-connection-maps.ts
@@ -64,7 +64,8 @@ export const APP_CONNECTION_NAME_MAP: Record<AppConnection, string> = {
[AppConnection.Ona]: "Ona",
[AppConnection.DigiCert]: "DigiCert",
[AppConnection.TravisCI]: "Travis CI",
- [AppConnection.Snowflake]: "Snowflake"
+ [AppConnection.Snowflake]: "Snowflake",
+ [AppConnection.Datadog]: "Datadog"
};
export const APP_CONNECTION_PLAN_MAP: Record<AppConnection, AppConnectionPlanType> = {
@@ -131,5 +132,6 @@ export const APP_CONNECTION_PLAN_MAP: Record<AppConnection, AppConnectionPlanTyp
[AppConnection.Ona]: AppConnectionPlanType.Regular,
[AppConnection.DigiCert]: AppConnectionPlanType.Regular,
[AppConnection.TravisCI]: AppConnectionPlanType.Regular,
- [AppConnection.Snowflake]: AppConnectionPlanType.Regular
+ [AppConnection.Snowflake]: AppConnectionPlanType.Regular,
+ [AppConnection.Datadog]: AppConnectionPlanType.Regular
};
diff --git a/backend/src/services/app-connection/app-connection-service.ts b/backend/src/services/app-connection/app-connection-service.ts
index 48a373ba89..a209d37336 100644
--- a/backend/src/services/app-connection/app-connection-service.ts
+++ b/backend/src/services/app-connection/app-connection-service.ts
@@ -84,6 +84,7 @@ import { cloudflareConnectionService } from "./cloudflare/cloudflare-connection-
import { TAppConnectionCredentialRotationServiceFactory } from "./credential-rotation";
import { ValidateDatabricksConnectionCredentialsSchema } from "./databricks";
import { databricksConnectionService } from "./databricks/databricks-connection-service";
+import { ValidateDatadogConnectionCredentialsSchema } from "./datadog";
import { ValidateDbtConnectionCredentialsSchema } from "./dbt";
import { dbtConnectionService } from "./dbt/dbt-connection-service";
import { ValidateDevinConnectionCredentialsSchema } from "./devin";
@@ -240,7 +241,8 @@ const VALIDATE_APP_CONNECTION_CREDENTIALS_MAP: Record<AppConnection, TValidateAp
[AppConnection.Ona]: ValidateOnaConnectionCredentialsSchema,
[AppConnection.DigiCert]: ValidateDigiCertConnectionCredentialsSchema,
[AppConnection.TravisCI]: ValidateTravisCIConnectionCredentialsSchema,
- [AppConnection.Snowflake]: ValidateSnowflakeConnectionCredentialsSchema
+ [AppConnection.Snowflake]: ValidateSnowflakeConnectionCredentialsSchema,
+ [AppConnection.Datadog]: ValidateDatadogConnectionCredentialsSchema
};
export const appConnectionServiceFactory = ({
diff --git a/backend/src/services/app-connection/app-connection-types.ts b/backend/src/services/app-connection/app-connection-types.ts
index e4ef01f103..06271e6115 100644
--- a/backend/src/services/app-connection/app-connection-types.ts
+++ b/backend/src/services/app-connection/app-connection-types.ts
@@ -124,6 +124,12 @@ import {
TDatabricksConnectionInput,
TValidateDatabricksConnectionCredentialsSchema
} from "./databricks";
+import {
+ TDatadogConnection,
+ TDatadogConnectionConfig,
+ TDatadogConnectionInput,
+ TValidateDatadogConnectionCredentialsSchema
+} from "./datadog";
import {
TDbtConnection,
TDbtConnectionConfig,
@@ -443,6 +449,7 @@ export type TAppConnection = { id: string } & (
| TDigiCertConnection
| TTravisCIConnection
| TSnowflakeConnection
+ | TDatadogConnection
);
export type TAppConnectionRaw = NonNullable<Awaited<ReturnType<TAppConnectionDALFactory["findById"]>>>;
@@ -518,6 +525,7 @@ export type TAppConnectionInput = { id: string } & (
| TDigiCertConnectionInput
| TTravisCIConnectionInput
| TSnowflakeConnectionInput
+ | TDatadogConnectionInput
);
export type TSqlConnectionInput =
@@ -621,7 +629,8 @@ export type TAppConnectionConfig =
| TOnaConnectionConfig
| TDigiCertConnectionConfig
| TTravisCIConnectionConfig
- | TSnowflakeConnectionConfig;
+ | TSnowflakeConnectionConfig
+ | TDatadogConnectionConfig;
export type TValidateAppConnectionCredentialsSchema =
| TValidateAwsConnectionCredentialsSchema
@@ -687,7 +696,8 @@ export type TValidateAppConnectionCredentialsSchema =
| TValidateOnaConnectionCredentialsSchema
| TValidateDigiCertConnectionCredentialsSchema
| TValidateTravisCIConnectionCredentialsSchema
- | TValidateSnowflakeConnectionCredentialsSchema;
+ | TValidateSnowflakeConnectionCredentialsSchema
+ | TValidateDatadogConnectionCredentialsSchema;
export type TListAwsConnectionKmsKeys = {
connectionId: string;
diff --git a/backend/src/services/app-connection/datadog/datadog-connection-enums.ts b/backend/src/services/app-connection/datadog/datadog-connection-enums.ts
new file mode 100644
index 0000000000..d05b5eb61a
--- /dev/null
+++ b/backend/src/services/app-connection/datadog/datadog-connection-enums.ts
@@ -0,0 +1,3 @@
+export enum DatadogConnectionMethod {
+ ApiKey = "api-key"
+}
diff --git a/backend/src/services/app-connection/datadog/datadog-connection-fns.ts b/backend/src/services/app-connection/datadog/datadog-connection-fns.ts
new file mode 100644
index 0000000000..a6dcc8c85e
--- /dev/null
+++ b/backend/src/services/app-connection/datadog/datadog-connection-fns.ts
@@ -0,0 +1,70 @@
+import { AxiosError } from "axios";
+
+import { request } from "@app/lib/config/request";
+import { BadRequestError } from "@app/lib/errors";
+import { removeTrailingSlash } from "@app/lib/fn";
+import { blockLocalAndPrivateIpAddresses } from "@app/lib/validator";
+
+import { AppConnection } from "../app-connection-enums";
+import { DatadogConnectionMethod } from "./datadog-connection-enums";
+import { TDatadogConnectionConfig } from "./datadog-connection-types";
+
+const DATADOG_ALLOWED_DOMAINS = ["datadoghq", "ddog-gov"];
+
+export const getDatadogBaseUrl = async (config: TDatadogConnectionConfig) => {
+ const rawUrl = removeTrailingSlash(config.credentials.url);
+
+ let parsed: URL;
+ try {
+ parsed = new URL(rawUrl);
+ } catch {
+ throw new BadRequestError({ message: "Invalid Datadog URL" });
+ }
+
+ const labels = parsed.hostname.split(".");
+ const secondLevelLabel = labels[labels.length - 2];
+ if (!secondLevelLabel || !DATADOG_ALLOWED_DOMAINS.includes(secondLevelLabel)) {
+ throw new BadRequestError({
+ message: "Datadog URL must be a datadoghq.* or ddog-gov.* domain"
+ });
+ }
+
+ await blockLocalAndPrivateIpAddresses(rawUrl);
+
+ return rawUrl;
+};
+
+export const getDatadogConnectionListItem = () => {
+ return {
+ name: "Datadog" as const,
+ app: AppConnection.Datadog as const,
+ methods: Object.values(DatadogConnectionMethod) as [DatadogConnectionMethod.ApiKey]
+ };
+};
+
+export const validateDatadogConnectionCredentials = async (config: TDatadogConnectionConfig) => {
+ const baseUrl = await getDatadogBaseUrl(config);
+ const { apiKey, applicationKey } = config.credentials;
+
+ try {
+ await request.get(`${baseUrl}/api/v2/permissions`, {
+ headers: {
+ "DD-API-KEY": apiKey,
+ "DD-APPLICATION-KEY": applicationKey,
+ Accept: "application/json"
+ }
+ });
+ } catch (error: unknown) {
+ if (error instanceof AxiosError) {
+ throw new BadRequestError({
+ message: `Failed to validate Datadog credentials: ${error.message || "Unknown error"}`
+ });
+ }
+
+ throw new BadRequestError({
+ message: "Failed to validate Datadog credentials - verify URL, API key and Application key are correct"
+ });
+ }
+
+ return config.credentials;
+};
diff --git a/backend/src/services/app-connection/datadog/datadog-connection-schemas.ts b/backend/src/services/app-connection/datadog/datadog-connection-schemas.ts
new file mode 100644
index 0000000000..2c098ebc4f
--- /dev/null
+++ b/backend/src/services/app-connection/datadog/datadog-connection-schemas.ts
@@ -0,0 +1,75 @@
+import z from "zod";
+
+import { AppConnections } from "@app/lib/api-docs";
+import { AppConnection } from "@app/services/app-connection/app-connection-enums";
+import {
+ BaseAppConnectionSchema,
+ GenericCreateAppConnectionFieldsSchema,
+ GenericUpdateAppConnectionFieldsSchema
+} from "@app/services/app-connection/app-connection-schemas";
+
+import { APP_CONNECTION_NAME_MAP } from "../app-connection-maps";
+import { DatadogConnectionMethod } from "./datadog-connection-enums";
+
+export const DatadogConnectionApiKeyCredentialsSchema = z.object({
+ url: z
+ .string()
+ .trim()
+ .url("Invalid Datadog URL")
+ .min(1, "URL required")
+ .max(255)
+ .describe(AppConnections.CREDENTIALS.DATADOG.url),
+ apiKey: z.string().trim().min(1, "API Key required").describe(AppConnections.CREDENTIALS.DATADOG.apiKey),
+ applicationKey: z
+ .string()
+ .trim()
+ .min(1, "Application Key required")
+ .describe(AppConnections.CREDENTIALS.DATADOG.applicationKey)
+});
+
+const BaseDatadogConnectionSchema = BaseAppConnectionSchema.extend({
+ app: z.literal(AppConnection.Datadog)
+});
+
+export const DatadogConnectionSchema = z.discriminatedUnion("method", [
+ BaseDatadogConnectionSchema.extend({
+ method: z.literal(DatadogConnectionMethod.ApiKey),
+ credentials: DatadogConnectionApiKeyCredentialsSchema
+ })
+]);
+
+export const SanitizedDatadogConnectionSchema = z.discriminatedUnion("method", [
+ BaseDatadogConnectionSchema.extend({
+ method: z.literal(DatadogConnectionMethod.ApiKey),
+ credentials: DatadogConnectionApiKeyCredentialsSchema.pick({ url: true })
+ }).describe(JSON.stringify({ title: `${APP_CONNECTION_NAME_MAP[AppConnection.Datadog]} (API Key)` }))
+]);
+
+export const ValidateDatadogConnectionCredentialsSchema = z.discriminatedUnion("method", [
+ z.object({
+ method: z.literal(DatadogConnectionMethod.ApiKey).describe(AppConnections.CREATE(AppConnection.Datadog).method),
+ credentials: DatadogConnectionApiKeyCredentialsSchema.describe(
+ AppConnections.CREATE(AppConnection.Datadog).credentials
+ )
+ })
+]);
+
+export const CreateDatadogConnectionSchema = ValidateDatadogConnectionCredentialsSchema.and(
+ GenericCreateAppConnectionFieldsSchema(AppConnection.Datadog)
+);
+
+export const UpdateDatadogConnectionSchema = z
+ .object({
+ credentials: DatadogConnectionApiKeyCredentialsSchema.optional().describe(
+ AppConnections.UPDATE(AppConnection.Datadog).credentials
+ )
+ })
+ .and(GenericUpdateAppConnectionFieldsSchema(AppConnection.Datadog));
+
+export const DatadogConnectionListItemSchema = z
+ .object({
+ name: z.literal("Datadog"),
+ app: z.literal(AppConnection.Datadog),
+ methods: z.nativeEnum(DatadogConnectionMethod).array()
+ })
+ .describe(JSON.stringify({ title: APP_CONNECTION_NAME_MAP[AppConnection.Datadog] }));
diff --git a/backend/src/services/app-connection/datadog/datadog-connection-types.ts b/backend/src/services/app-connection/datadog/datadog-connection-types.ts
new file mode 100644
index 0000000000..4c6dbad629
--- /dev/null
+++ b/backend/src/services/app-connection/datadog/datadog-connection-types.ts
@@ -0,0 +1,20 @@
+import z from "zod";
+
+import { DiscriminativePick } from "@app/lib/types";
+
+import { AppConnection } from "../app-connection-enums";
+import {
+ CreateDatadogConnectionSchema,
+ DatadogConnectionSchema,
+ ValidateDatadogConnectionCredentialsSchema
+} from "./datadog-connection-schemas";
+
+export type TDatadogConnection = z.infer<typeof DatadogConnectionSchema>;
+
+export type TDatadogConnectionInput = z.infer<typeof CreateDatadogConnectionSchema> & {
+ app: AppConnection.Datadog;
+};
+
+export type TValidateDatadogConnectionCredentialsSchema = typeof ValidateDatadogConnectionCredentialsSchema;
+
+export type TDatadogConnectionConfig = DiscriminativePick<TDatadogConnectionInput, "method" | "app" | "credentials">;
diff --git a/backend/src/services/app-connection/datadog/index.ts b/backend/src/services/app-connection/datadog/index.ts
new file mode 100644
index 0000000000..67e0dd338b
--- /dev/null
+++ b/backend/src/services/app-connection/datadog/index.ts
@@ -0,0 +1,4 @@
+export * from "./datadog-connection-enums";
+export * from "./datadog-connection-fns";
+export * from "./datadog-connection-schemas";
+export * from "./datadog-connection-types";
diff --git a/frontend/public/images/integrations/DatadogWhite.png b/frontend/public/images/integrations/DatadogWhite.png
new file mode 100644
index 0000000000..32e7136ce0
Binary files /dev/null and b/frontend/public/images/integrations/DatadogWhite.png differ
diff --git a/frontend/src/helpers/appConnections.ts b/frontend/src/helpers/appConnections.ts
index 11b81812e7..189e2f944c 100644
--- a/frontend/src/helpers/appConnections.ts
+++ b/frontend/src/helpers/appConnections.ts
@@ -56,6 +56,7 @@ import { BitbucketConnectionMethod } from "@app/hooks/api/appConnections/types/b
import { ChecklyConnectionMethod } from "@app/hooks/api/appConnections/types/checkly-connection";
import { ChefConnectionMethod } from "@app/hooks/api/appConnections/types/chef-connection";
import { CircleCIConnectionMethod } from "@app/hooks/api/appConnections/types/circleci-connection";
+import { DatadogConnectionMethod } from "@app/hooks/api/appConnections/types/datadog-connection";
import { DigiCertConnectionMethod } from "@app/hooks/api/appConnections/types/digicert-connection";
import { DigitalOceanConnectionMethod } from "@app/hooks/api/appConnections/types/digital-ocean";
import { DNSMadeEasyConnectionMethod } from "@app/hooks/api/appConnections/types/dns-made-easy-connection";
@@ -177,7 +178,8 @@ export const APP_CONNECTION_MAP: Record<
[AppConnection.Ona]: { name: "Ona", image: "Ona.png", aliases: ["gitpod"] },
[AppConnection.DigiCert]: { name: "DigiCert", image: "DigiCert.png" },
[AppConnection.TravisCI]: { name: "Travis CI", image: "Travis CI.png" },
- [AppConnection.Snowflake]: { name: "Snowflake", image: "Snowflake.png" }
+ [AppConnection.Snowflake]: { name: "Snowflake", image: "Snowflake.png" },
+ [AppConnection.Datadog]: { name: "Datadog", image: "DatadogWhite.png" }
};
export const getAppConnectionMethodDetails = (method: TAppConnection["method"]) => {
@@ -280,6 +282,7 @@ export const getAppConnectionMethodDetails = (method: TAppConnection["method"])
case AzureEntraIdConnectionMethod.ClientSecret:
return { name: "Client Secret", icon: faKey };
case OctopusDeployConnectionMethod.ApiKey:
+ case DatadogConnectionMethod.ApiKey:
return { name: "API Key", icon: faKey };
case SshConnectionMethod.Password:
return { name: "Password", icon: faLock };
diff --git a/frontend/src/hooks/api/appConnections/enums.ts b/frontend/src/hooks/api/appConnections/enums.ts
index 7a9af11109..5b7fed5030 100644
--- a/frontend/src/hooks/api/appConnections/enums.ts
+++ b/frontend/src/hooks/api/appConnections/enums.ts
@@ -62,5 +62,6 @@ export enum AppConnection {
Ona = "ona",
DigiCert = "digicert",
TravisCI = "travis-ci",
- Snowflake = "snowflake"
+ Snowflake = "snowflake",
+ Datadog = "datadog"
}
diff --git a/frontend/src/hooks/api/appConnections/types/app-options.ts b/frontend/src/hooks/api/appConnections/types/app-options.ts
index 5895128cda..1b70b1bdd3 100644
--- a/frontend/src/hooks/api/appConnections/types/app-options.ts
+++ b/frontend/src/hooks/api/appConnections/types/app-options.ts
@@ -270,6 +270,10 @@ export type TSnowflakeConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.Snowflake;
};
+export type TDatadogConnectionOption = TAppConnectionOptionBase & {
+ app: AppConnection.Datadog;
+};
+
export type TAppConnectionOption =
| TAwsConnectionOption
| TGitHubConnectionOption
@@ -334,7 +338,8 @@ export type TAppConnectionOption =
| TOnaConnectionOption
| TDigiCertConnectionOption
| TTravisCIConnectionOption
- | TSnowflakeConnectionOption;
+ | TSnowflakeConnectionOption
+ | TDatadogConnectionOption;
export type TAppConnectionOptionMap = {
[AppConnection.AWS]: TAwsConnectionOption;
@@ -401,4 +406,5 @@ export type TAppConnectionOptionMap = {
[AppConnection.DigiCert]: TDigiCertConnectionOption;
[AppConnection.TravisCI]: TTravisCIConnectionOption;
[AppConnection.Snowflake]: TSnowflakeConnectionOption;
+ [AppConnection.Datadog]: TDatadogConnectionOption;
};
diff --git a/frontend/src/hooks/api/appConnections/types/datadog-connection.ts b/frontend/src/hooks/api/appConnections/types/datadog-connection.ts
new file mode 100644
index 0000000000..186220ea38
--- /dev/null
+++ b/frontend/src/hooks/api/appConnections/types/datadog-connection.ts
@@ -0,0 +1,15 @@
+import { AppConnection } from "@app/hooks/api/appConnections/enums";
+import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";
+
+export enum DatadogConnectionMethod {
+ ApiKey = "api-key"
+}
+
+export type TDatadogConnection = TRootAppConnection & { app: AppConnection.Datadog } & {
+ method: DatadogConnectionMethod.ApiKey;
+ credentials: {
+ url: string;
+ apiKey: string;
+ applicationKey: string;
+ };
+};
diff --git a/frontend/src/hooks/api/appConnections/types/index.ts b/frontend/src/hooks/api/appConnections/types/index.ts
index 78bee7c0ba..420d3792ca 100644
--- a/frontend/src/hooks/api/appConnections/types/index.ts
+++ b/frontend/src/hooks/api/appConnections/types/index.ts
@@ -18,6 +18,7 @@ import { TChefConnection } from "./chef-connection";
import { TCircleCIConnection } from "./circleci-connection";
import { TCloudflareConnection } from "./cloudflare-connection";
import { TDatabricksConnection } from "./databricks-connection";
+import { TDatadogConnection } from "./datadog-connection";
import { TDbtConnection } from "./dbt-connection";
import { TDevinConnection } from "./devin-connection";
import { TDigiCertConnection } from "./digicert-connection";
@@ -82,6 +83,7 @@ export * from "./chef-connection";
export * from "./circleci-connection";
export * from "./cloudflare-connection";
export * from "./databricks-connection";
+export * from "./datadog-connection";
export * from "./dbt-connection";
export * from "./devin-connection";
export * from "./digicert-connection";
@@ -192,7 +194,8 @@ export type TAppConnection =
| TOnaConnection
| TDigiCertConnection
| TTravisCIConnection
- | TSnowflakeConnection;
+ | TSnowflakeConnection
+ | TDatadogConnection;
export type TAvailableAppConnection = Pick<TAppConnection, "name" | "id" | "projectId">;
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx
index 9593d93a4c..70fa54dfb7 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx
@@ -32,6 +32,7 @@ import { ChefConnectionForm } from "./ChefConnectionForm";
import { CircleCIConnectionForm } from "./CircleCIConnectionForm";
import { CloudflareConnectionForm } from "./CloudflareConnectionForm";
import { DatabricksConnectionForm } from "./DatabricksConnectionForm";
+import { DatadogConnectionForm } from "./DatadogConnectionForm";
import { DbtConnectionForm } from "./DbtConnectionForm";
import { DevinConnectionForm } from "./DevinConnectionForm";
import { DigiCertConnectionForm } from "./DigiCertConnectionForm";
@@ -300,6 +301,8 @@ const CreateForm = ({ app, onComplete, projectId }: CreateFormProps) => {
return <TravisCIConnectionForm onSubmit={onSubmit} />;
case AppConnection.Snowflake:
return <SnowflakeConnectionForm onSubmit={onSubmit} />;
+ case AppConnection.Datadog:
+ return <DatadogConnectionForm onSubmit={onSubmit} />;
default:
throw new Error(`Unhandled App ${app}`);
}
@@ -525,6 +528,8 @@ const UpdateForm = ({ appConnection, onComplete }: UpdateFormProps) => {
return <TravisCIConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;
case AppConnection.Snowflake:
return <SnowflakeConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;
+ case AppConnection.Datadog:
+ return <DatadogConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;
case AppConnection.Venafi:
return <VenafiConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;
case AppConnection.VenafiTpp:
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/DatadogConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/DatadogConnectionForm.tsx
new file mode 100644
index 0000000000..2988091d06
--- /dev/null
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/DatadogConnectionForm.tsx
@@ -0,0 +1,142 @@
+import { Controller, FormProvider, useForm } from "react-hook-form";
+import { zodResolver } from "@hookform/resolvers/zod";
+import { z } from "zod";
+
+import {
+ Button,
+ FormControl,
+ Input,
+ ModalClose,
+ SecretInput,
+ Select,
+ SelectItem
+} from "@app/components/v2";
+import { APP_CONNECTION_MAP, getAppConnectionMethodDetails } from "@app/helpers/appConnections";
+import { AppConnection } from "@app/hooks/api/appConnections/enums";
+import {
+ DatadogConnectionMethod,
+ TDatadogConnection
+} from "@app/hooks/api/appConnections/types/datadog-connection";
+
+import {
+ genericAppConnectionFieldsSchema,
+ GenericAppConnectionsFields
+} from "./GenericAppConnectionFields";
+
+type Props = {
+ appConnection?: TDatadogConnection;
+ onSubmit: (formData: FormData) => void;
+};
+
+const rootSchema = genericAppConnectionFieldsSchema.extend({
+ app: z.literal(AppConnection.Datadog)
+});
+
+const formSchema = z.discriminatedUnion("method", [
+ rootSchema.extend({
+ method: z.literal(DatadogConnectionMethod.ApiKey),
+ credentials: z.object({
+ url: z.string().trim().url("Invalid Datadog URL").min(1, "URL required").max(255),
+ apiKey: z.string().trim().min(1, "API Key required"),
+ applicationKey: z.string().trim().min(1, "Application Key required")
+ })
+ })
+]);
+
+type FormData = z.infer<typeof formSchema>;
+
+export const DatadogConnectionForm = ({ appConnection, onSubmit }: Props) => {
+ const isUpdate = Boolean(appConnection);
+
+ const form = useForm<FormData>({
+ resolver: zodResolver(formSchema),
+ defaultValues: appConnection ?? {
+ app: AppConnection.Datadog,
+ method: DatadogConnectionMethod.ApiKey
+ }
+ });
+
+ const {
+ handleSubmit,
+ control,
+ formState: { isSubmitting, isDirty }
+ } = form;
+
+ return (
+ <FormProvider {...form}>
+ <form onSubmit={handleSubmit(onSubmit)}>
+ {!isUpdate && <GenericAppConnectionsFields />}
+
+ <Controller
+ name="credentials.url"
+ control={control}
+ shouldUnregister
+ render={({ field, fieldState: { error } }) => (
+ <FormControl
+ errorText={error?.message}
+ isError={Boolean(error?.message)}
+ label="Datadog URL"
+ tooltipClassName="max-w-sm"
+ tooltipText="The Datadog site URL to connect to (e.g., https://api.datadoghq.com)."
+ >
+ <Input {...field} placeholder="https://api.datadoghq.com" />
+ </FormControl>
+ )}
+ />
+ <Controller
+ name="credentials.apiKey"
+ control={control}
+ shouldUnregister
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ errorText={error?.message}
+ isError={Boolean(error?.message)}
+ label="API Key"
+ >
+ <SecretInput
+ containerClassName="text-gray-400 group-focus-within:border-primary-400/50! border border-mineshaft-500 bg-mineshaft-900 px-2.5 py-1.5"
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ />
+ </FormControl>
+ )}
+ />
+ <Controller
+ name="credentials.applicationKey"
+ control={control}
+ shouldUnregister
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ errorText={error?.message}
+ isError={Boolean(error?.message)}
+ label="Application Key"
+ >
+ <SecretInput
+ containerClassName="text-gray-400 group-focus-within:border-primary-400/50! border border-mineshaft-500 bg-mineshaft-900 px-2.5 py-1.5"
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ />
+ </FormControl>
+ )}
+ />
+ <div className="mt-8 flex items-center">
+ <Button
+ className="mr-4"
+ size="sm"
+ type="submit"
+ colorSchema="secondary"
+ isLoading={isSubmitting}
+ isDisabled={isSubmitting || !isDirty}
+ >
+ {isUpdate ? "Update Credentials" : "Connect to Datadog"}
+ </Button>
+ <ModalClose asChild>
+ <Button colorSchema="secondary" variant="plain">
+ Cancel
+ </Button>
+ </ModalClose>
+ </div>
+ </form>
+ </FormProvider>
+ );
+};