diff --git a/lib/web/integrations.go b/lib/web/integrations.go index 89a550b91b515..2bc3af9ea2e04 100644 --- a/lib/web/integrations.go +++ b/lib/web/integrations.go @@ -133,7 +133,7 @@ func (h *Handler) integrationsDelete(w http.ResponseWriter, r *http.Request, p h return nil, trace.Wrap(err) } - return nil, nil + return OK(), nil } // integrationsGet returns an Integration based on its name diff --git a/web/packages/design/src/SVGIcon/AWS.tsx b/web/packages/design/src/SVGIcon/AWS.tsx new file mode 100644 index 0000000000000..4a175a96bc682 --- /dev/null +++ b/web/packages/design/src/SVGIcon/AWS.tsx @@ -0,0 +1,48 @@ +/* +Copyright 2023 Gravitational, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import React from 'react'; + +import type { SVGIconProps } from './common'; + +export function AWSIcon({ size = 24, fill = 'white' }: SVGIconProps) { + return ( + + + + + + ); +} diff --git a/web/packages/design/src/SVGIcon/Lock.tsx b/web/packages/design/src/SVGIcon/Lock.tsx new file mode 100644 index 0000000000000..6ea5a00789c7c --- /dev/null +++ b/web/packages/design/src/SVGIcon/Lock.tsx @@ -0,0 +1,30 @@ +/* +Copyright 2023 Gravitational, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import React from 'react'; + +import type { SVGIconProps } from './common'; + +export function LockIcon({ size = 13, fill = 'white' }: SVGIconProps) { + return ( + + + + ); +} diff --git a/web/packages/design/src/SVGIcon/index.ts b/web/packages/design/src/SVGIcon/index.ts index c5dfded9b3a7a..f648d0d1ffc46 100644 --- a/web/packages/design/src/SVGIcon/index.ts +++ b/web/packages/design/src/SVGIcon/index.ts @@ -20,6 +20,8 @@ export { AddIcon } from './Add'; export { ApplicationsIcon } from './Applications'; export { AuditLogIcon } from './AuditLog'; export { AuthConnectorsIcon } from './AuthConnectors'; +export { AWSIcon } from './AWS'; +export { LockIcon } from './Lock'; export { ChevronRightIcon } from './ChevronRight'; export { DatabasesIcon } from './Databases'; export { DesktopsIcon } from './Desktops'; diff --git a/web/packages/teleport/src/Discover/Database/ConnectAwsAccount/ConnectAwsAccount.tsx b/web/packages/teleport/src/Discover/Database/ConnectAwsAccount/ConnectAwsAccount.tsx new file mode 100644 index 0000000000000..1964a2e464482 --- /dev/null +++ b/web/packages/teleport/src/Discover/Database/ConnectAwsAccount/ConnectAwsAccount.tsx @@ -0,0 +1,217 @@ +/** + * Copyright 2023 Gravitational, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React, { useEffect, useState } from 'react'; +import { Link } from 'react-router-dom'; +import { + Box, + ButtonLink, + Text, + ButtonPrimary, + Indicator, + Alert, + Flex, +} from 'design'; +import theme from 'design/theme'; +import FieldSelect from 'shared/components/FieldSelect'; +import useAttempt from 'shared/hooks/useAttemptNext'; +import { Option } from 'shared/components/Select'; +import Validation, { Validator } from 'shared/components/Validation'; +import { requiredField } from 'shared/components/Validation/rules'; +import TextEditor from 'shared/components/TextEditor'; + +import cfg from 'teleport/config'; +import { + IntegrationKind, + integrationService, +} from 'teleport/services/integrations'; +import { integrationRWE } from 'teleport/Discover/yamlTemplates'; +import useTeleport from 'teleport/useTeleport'; + +import { ActionButtons, HeaderSubtitle, HeaderWithBackBtn } from '../../Shared'; + +import { DbMeta, useDiscover } from '../../useDiscover'; + +export function ConnectAwsAccount() { + const { storeUser } = useTeleport(); + const { prevStep, nextStep, agentMeta, updateAgentMeta, eventState } = + useDiscover(); + + // TODO(lisa): also need to check for verb `use` which is pending + // work. + const access = storeUser.getIntegrationsAccess(); + const hasAccess = access.create && access.list; + const { attempt, run } = useAttempt(hasAccess ? 'processing' : ''); + + const [awsIntegrations, setAwsIntegrations] = useState([]); + const [selectedAwsIntegration, setSelectedAwsIntegration] = + useState