diff --git a/backend/src/integrations/apps.ts b/backend/src/integrations/apps.ts index dc947f6f1..cd6cb263f 100644 --- a/backend/src/integrations/apps.ts +++ b/backend/src/integrations/apps.ts @@ -608,6 +608,12 @@ const getAppsLaravelForge = async ({ * @returns {String} apps.name - name of Fly.io apps */ const getAppsFlyio = async ({ accessToken }: { accessToken: string }) => { + interface FlyioApp { + id: string; + name: string; + hostname: string; + } + const query = ` query($role: String) { apps(type: "container", first: 400, role: $role) { @@ -620,7 +626,7 @@ const getAppsFlyio = async ({ accessToken }: { accessToken: string }) => { } `; - const res = ( + const res: FlyioApp[] = ( await standardRequest.post( INTEGRATION_FLYIO_API_URL, { @@ -639,8 +645,9 @@ const getAppsFlyio = async ({ accessToken }: { accessToken: string }) => { ) ).data.data.apps.nodes; - const apps = res.map((a: any) => ({ + const apps = res.map((a: FlyioApp) => ({ name: a.name, + appId: a.id })); return apps; diff --git a/backend/src/integrations/sync.ts b/backend/src/integrations/sync.ts index a25a93c80..cb45a9d95 100644 --- a/backend/src/integrations/sync.ts +++ b/backend/src/integrations/sync.ts @@ -783,12 +783,12 @@ const syncSecretsAWSParameterStore = async ({ }; /** - * Sync/push [secrets] to AWS secret manager + * Sync/push [secrets] to AWS Secrets Manager * @param {Object} obj * @param {IIntegration} obj.integration - integration details * @param {Object} obj.secrets - secrets to push to integration (object where keys are secret keys and values are secret values) - * @param {String} obj.accessId - access id for AWS secret manager integration - * @param {String} obj.accessToken - access token for AWS secret manager integration + * @param {String} obj.accessId - access id for AWS Secrets Manager integration + * @param {String} obj.accessToken - access token for AWS Secrets Manager integration */ const syncSecretsAWSSecretManager = async ({ integration, diff --git a/backend/src/models/integration/integration.ts b/backend/src/models/integration/integration.ts index 7a7775bac..9bc378f28 100644 --- a/backend/src/models/integration/integration.ts +++ b/backend/src/models/integration/integration.ts @@ -187,7 +187,8 @@ const integrationSchema = new Schema( default: "/", }, metadata: { - type: Schema.Types.Mixed + type: Schema.Types.Mixed, + default: {} } }, { diff --git a/backend/src/variables/integration.ts b/backend/src/variables/integration.ts index fe04b6401..e8bf78b19 100644 --- a/backend/src/variables/integration.ts +++ b/backend/src/variables/integration.ts @@ -192,7 +192,7 @@ export const getIntegrationOptions = async () => { docsLink: "", }, { - name: "AWS Secret Manager", + name: "AWS Secrets Manager", slug: "aws-secret-manager", image: "Amazon Web Services.png", isAvailable: true, diff --git a/docs/changelog/overview.mdx b/docs/changelog/overview.mdx index 4961ef274..bdf820ad2 100644 --- a/docs/changelog/overview.mdx +++ b/docs/changelog/overview.mdx @@ -76,7 +76,7 @@ The changelog below reflects new product developments and updates on a monthly b - Added secret backups support for the CLI; it now fetches and caches secrets locally to be used in the event of future failed fetch. - Added support for comparing secret values across environments on each secret. - Added native AWS Parameter Store integration. -- Added native AWS Secret Manager integration. +- Added native AWS Secrets Manager integration. - Added native GitLab integration. - Added native CircleCI integration. - Added native Travis CI integration. diff --git a/docs/integrations/cloud/aws-secret-manager.mdx b/docs/integrations/cloud/aws-secret-manager.mdx index a798ae820..4df054077 100644 --- a/docs/integrations/cloud/aws-secret-manager.mdx +++ b/docs/integrations/cloud/aws-secret-manager.mdx @@ -1,6 +1,6 @@ --- -title: "AWS Secret Manager" -description: "How to sync secrets from Infisical to AWS Secret Manager" +title: "AWS Secrets Manager" +description: "How to sync secrets from Infisical to AWS Secrets Manager" --- Prerequisites: @@ -8,15 +8,15 @@ Prerequisites: - Set up and add envars to [Infisical Cloud](https://app.infisical.com) - Set up AWS and have/create an IAM user -## Grant the IAM user permissions to access AWS Secret Manager +## Grant the IAM user permissions to access AWS Secrets Manager -Navigate to your IAM user permissions and add a permission policy to grant access to AWS Secret Manager. +Navigate to your IAM user permissions and add a permission policy to grant access to AWS Secrets Manager. ![integration IAM 1](../../images/integrations-aws-iam-1.png) ![integration IAM 2](../../images/integrations-aws-secret-manager-iam-2.png) ![integrations IAM 3](../../images/integrations-aws-secret-manager-iam-3.png) -For better security, here's a custom policy containing the minimum permissions required by Infisical to sync secrets to AWS Secret Manager for the IAM user that you can use: +For better security, here's a custom policy containing the minimum permissions required by Infisical to sync secrets to AWS Secrets Manager for the IAM user that you can use: ```json { @@ -40,7 +40,7 @@ For better security, here's a custom policy containing the minimum permissions r ![integrations](../../images/integrations.png) -## Authorize Infisical for AWS Secret Manager +## Authorize Infisical for AWS Secrets Manager Obtain a AWS access key ID and secret access key for your IAM user in IAM > Users > User > Security credentials > Access keys @@ -48,7 +48,7 @@ Obtain a AWS access key ID and secret access key for your IAM user in IAM > User ![access key 2](../../images/integrations-aws-access-key-2.png) ![access key 3](../../images/integrations-aws-access-key-3.png) -Press on the AWS Secret Manager tile and input your AWS access key ID and secret access key from the previous step. +Press on the AWS Secrets Manager tile and input your AWS access key ID and secret access key from the previous step. ![integration auth](../../images/integrations-aws-secret-manager-auth.png) @@ -61,12 +61,12 @@ Press on the AWS Secret Manager tile and input your AWS access key ID and secret ## Start integration -Select which Infisical environment secrets you want to sync to which AWS Secret Manager region and under which secret name. Then, press create integration to start syncing secrets to AWS Secret Manager. +Select which Infisical environment secrets you want to sync to which AWS Secrets Manager region and under which secret name. Then, press create integration to start syncing secrets to AWS Secrets Manager. ![integration create](../../images/integrations-aws-secret-manager-create.png) - Infisical currently syncs environment variables to AWS Secret Manager as + Infisical currently syncs environment variables to AWS Secrets Manager as key-value pairs under one secret. We're actively exploring ways to help users group environment variable key-pairs under multiple secrets for greater control. diff --git a/docs/integrations/overview.mdx b/docs/integrations/overview.mdx index a464aa9cb..fc05d817c 100644 --- a/docs/integrations/overview.mdx +++ b/docs/integrations/overview.mdx @@ -29,7 +29,7 @@ Missing an integration? [Throw in a request](https://github.com/Infisical/infisi | [Checkly](/integrations/cloud/checkly) | Cloud | Available | | [HashiCorp Vault](/integrations/cloud/hashicorp-vault) | Cloud | Available | | [AWS Parameter Store](/integrations/cloud/aws-parameter-store) | Cloud | Available | -| [AWS Secret Manager](/integrations/cloud/aws-secret-manager) | Cloud | Available | +| [AWS Secrets Manager](/integrations/cloud/aws-secret-manager) | Cloud | Available | | [Azure Key Vault](/integrations/cloud/azure-key-vault) | Cloud | Available | | [GCP Secret Manager](/integrations/cloud/gcp-secret-manager) | Cloud | Available | | [Windmill](/integrations/cloud/windmill) | Cloud | Available | diff --git a/frontend/public/data/frequentConstants.ts b/frontend/public/data/frequentConstants.ts index 11adf2e7a..7425cb994 100644 --- a/frontend/public/data/frequentConstants.ts +++ b/frontend/public/data/frequentConstants.ts @@ -5,7 +5,7 @@ interface Mapping { const integrationSlugNameMapping: Mapping = { "azure-key-vault": "Azure Key Vault", "aws-parameter-store": "AWS Parameter Store", - "aws-secret-manager": "AWS Secret Manager", + "aws-secret-manager": "AWS Secrets Manager", "heroku": "Heroku", "vercel": "Vercel", "netlify": "Netlify", diff --git a/frontend/src/layouts/AppLayout/AppLayout.tsx b/frontend/src/layouts/AppLayout/AppLayout.tsx index 47f7570d8..8aa7d01b7 100644 --- a/frontend/src/layouts/AppLayout/AppLayout.tsx +++ b/frontend/src/layouts/AppLayout/AppLayout.tsx @@ -445,7 +445,7 @@ export const AppLayout = ({ children }: LayoutProps) => { @@ -468,7 +468,7 @@ export const AppLayout = ({ children }: LayoutProps) => { {t("nav.menu.integrations")} diff --git a/frontend/src/pages/integrations/aws-parameter-store/authorize.tsx b/frontend/src/pages/integrations/aws-parameter-store/authorize.tsx index 80952191c..14e8e97a0 100644 --- a/frontend/src/pages/integrations/aws-parameter-store/authorize.tsx +++ b/frontend/src/pages/integrations/aws-parameter-store/authorize.tsx @@ -1,5 +1,10 @@ import { useState } from "react"; +import Head from "next/head"; +import Image from "next/image"; +import Link from "next/link"; import { useRouter } from "next/router"; +import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useSaveIntegrationAccessToken @@ -56,12 +61,41 @@ export default function AWSParameterStoreAuthorizeIntegrationPage() { return (
- - AWS Parameter Store Integration + + Authorize AWS Parameter Integration + + + + +
+
+ AWS logo +
+ AWS Parameter Store Integration + +
+
+ + Docs + +
+
+ +
+ +
+
+
Pro Tips
+ After creating an integration, your secrets will start syncing immediately. This might cause an unexpected override of current secrets in AWS Parameter Store with secrets from Infisical. +
) : ( -
+
+ + Set Up AWS Parameter Store Integration + + + {isintegrationAuthLoading ? infisical loading indicator :
+ +

+ Something went wrong. Please contact + support@infisical.com + if the issue persists. +

+
} +
); } diff --git a/frontend/src/pages/integrations/aws-secret-manager/authorize.tsx b/frontend/src/pages/integrations/aws-secret-manager/authorize.tsx index f150a5a28..f69d46f71 100644 --- a/frontend/src/pages/integrations/aws-secret-manager/authorize.tsx +++ b/frontend/src/pages/integrations/aws-secret-manager/authorize.tsx @@ -1,5 +1,10 @@ import { useState } from "react"; +import Head from "next/head"; +import Image from "next/image"; +import Link from "next/link"; import { useRouter } from "next/router"; +import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useSaveIntegrationAccessToken } from "@app/hooks/api"; @@ -54,12 +59,41 @@ export default function AWSSecretManagerCreateIntegrationPage() { return (
- - AWS Secret Manager Integration + + Authorize AWS Secrets Manager Integration + + + + +
+
+ AWS logo +
+ AWS Secrets Manager Integration + + +
+ + Docs + +
+
+ +
+
setAccessKey(e.target.value)} /> @@ -67,6 +101,7 @@ export default function AWSSecretManagerCreateIntegrationPage() { label="Secret Access Key" errorText={accessSecretKeyErrorText} isError={accessSecretKeyErrorText !== "" ?? false} + className="px-6" >
diff --git a/frontend/src/pages/integrations/aws-secret-manager/create.tsx b/frontend/src/pages/integrations/aws-secret-manager/create.tsx index 99b89b0fb..3c5b20511 100644 --- a/frontend/src/pages/integrations/aws-secret-manager/create.tsx +++ b/frontend/src/pages/integrations/aws-secret-manager/create.tsx @@ -1,5 +1,10 @@ import { useEffect, useState } from "react"; +import Head from "next/head"; +import Image from "next/image"; +import Link from "next/link"; import { useRouter } from "next/router"; +import { faArrowUpRightFromSquare, faBookOpen, faBugs, faCircleInfo } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import queryString from "query-string"; import { @@ -57,7 +62,7 @@ export default function AWSSecretManagerCreateIntegrationPage() { const { integrationAuthId } = queryString.parse(router.asPath.split("?")[1]); const { data: workspace } = useGetWorkspaceById(localStorage.getItem("projectData.id") ?? ""); - const { data: integrationAuth } = useGetIntegrationAuthById((integrationAuthId as string) ?? ""); + const { data: integrationAuth, isLoading: isintegrationAuthLoading } = useGetIntegrationAuthById((integrationAuthId as string) ?? ""); const [selectedSourceEnvironment, setSelectedSourceEnvironment] = useState(""); const [secretPath, setSecretPath] = useState("/"); @@ -112,10 +117,38 @@ export default function AWSSecretManagerCreateIntegrationPage() { }; return integrationAuth && workspace && selectedSourceEnvironment ? ( -
- - AWS Secret Manager Integration - +
+ + Set Up AWS Secrets Manager Integration + + + + +
+
+ AWS logo +
+ AWS Secrets Manager Integration + + +
+ + Docs + +
+
+ +
+
+ - + setSecretPath(evt.target.value)} placeholder="Provide a path, default is /" /> - + Create Integration
+
+
+
Pro Tips
+ After creating an integration, your secrets will start syncing immediately. This might cause an unexpected override of current secrets in AWS Secrets Manager with secrets from Infisical. +
) : ( -
+
+ + Set Up AWS Secrets Manager Integration + + + {isintegrationAuthLoading ? infisical loading indicator :
+ +

+ Something went wrong. Please contact + support@infisical.com + if the issue persists. +

+
} +
); } diff --git a/frontend/src/pages/integrations/checkly/authorize.tsx b/frontend/src/pages/integrations/checkly/authorize.tsx index a84c9fe28..c3938641b 100644 --- a/frontend/src/pages/integrations/checkly/authorize.tsx +++ b/frontend/src/pages/integrations/checkly/authorize.tsx @@ -1,5 +1,10 @@ import { useState } from "react"; +import Head from "next/head"; +import Image from "next/image"; +import Link from "next/link"; import { useRouter } from "next/router"; +import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useSaveIntegrationAccessToken @@ -41,8 +46,36 @@ export default function ChecklyCreateIntegrationPage() { return (
+ + Authorize Checkly Integration + + - Checkly Integration + +
+
+ Checkly logo +
+ Checkly Integration + + +
+ + Docs + +
+
+ +
+
+
+
+
Pro Tips
+ After creating an integration, your secrets will start syncing immediately. This might cause an unexpected override of current secrets in Checkly with secrets from Infisical. + If you have multiple Checkly integrations and are using suffixes for at least one of them, you will have to add suffixes for all the active Checkly integrations – otherwise you might run into rare unexpected behavior. +
) : ( -
+
+ + Set Up Checkly Integration + + + {isIntegrationAuthAppsLoading ? infisical loading indicator :
+ +

+ Something went wrong. Please contact + support@infisical.com + if the issue persists. +

+
} +
); } diff --git a/frontend/src/pages/integrations/circleci/authorize.tsx b/frontend/src/pages/integrations/circleci/authorize.tsx index 592056bbe..f276362f7 100644 --- a/frontend/src/pages/integrations/circleci/authorize.tsx +++ b/frontend/src/pages/integrations/circleci/authorize.tsx @@ -1,5 +1,10 @@ import { useState } from "react"; +import Head from "next/head"; +import Image from "next/image"; +import Link from "next/link"; import { useRouter } from "next/router"; +import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useSaveIntegrationAccessToken @@ -41,19 +46,49 @@ export default function CircleCICreateIntegrationPage() { return (
- - CircleCI Integration + + Authorize CircleCI Integration + + + + +
+
+ CircleCI logo +
+ CircleCI Integration + + +
+ + Docs + +
+
+ +
+
setApiKey(e.target.value)} /> + +
); } -FlyioCreateIntegrationPage.requireAuth = true; +FlyioAuthorizeIntegrationPage.requireAuth = true; diff --git a/frontend/src/pages/integrations/flyio/create.tsx b/frontend/src/pages/integrations/flyio/create.tsx index 8a49d4c06..be1a577de 100644 --- a/frontend/src/pages/integrations/flyio/create.tsx +++ b/frontend/src/pages/integrations/flyio/create.tsx @@ -1,5 +1,10 @@ import { useEffect, useState } from "react"; +import Head from "next/head"; +import Image from "next/image"; +import Link from "next/link"; import { useRouter } from "next/router"; +import { faArrowUpRightFromSquare, faBookOpen, faBugs, faCircleInfo } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import queryString from "query-string"; import { @@ -23,13 +28,14 @@ import { useGetWorkspaceById } from "../../../hooks/api/workspace"; export default function FlyioCreateIntegrationPage() { const router = useRouter(); + const { mutateAsync } = useCreateIntegration(); const { integrationAuthId } = queryString.parse(router.asPath.split("?")[1]); const { data: workspace } = useGetWorkspaceById(localStorage.getItem("projectData.id") ?? ""); - const { data: integrationAuth } = useGetIntegrationAuthById((integrationAuthId as string) ?? ""); - const { data: integrationAuthApps } = useGetIntegrationAuthApps({ + const { data: integrationAuth, isLoading: isIntegrationAuthLoading } = useGetIntegrationAuthById((integrationAuthId as string) ?? ""); + const { data: integrationAuthApps, isLoading: isIntegrationAuthAppsLoading } = useGetIntegrationAuthApps({ integrationAuthId: (integrationAuthId as string) ?? "" }); @@ -84,10 +90,38 @@ export default function FlyioCreateIntegrationPage() { selectedSourceEnvironment && integrationAuthApps && targetApp ? ( -
- - Fly.io Integration - +
+ + Set Up Fly.io Integration + + + + +
+
+ Fly.io logo +
+ Fly.io Integration + + +
+ + Docs + +
+
+ +
+
+ - + setSecretPath(evt.target.value)} placeholder="Provide a path, default is /" /> - +