Skip to content

Commit

Permalink
Address design review: remove ec2 instance eice flow
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlisa committed May 30, 2024
1 parent adcf41f commit e424e7c
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 22 deletions.
17 changes: 3 additions & 14 deletions web/packages/teleport/src/Discover/SelectResource/resources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,11 @@ export const SERVERS: ResourceSpec[] = [
platform: Platform.macOS,
},
{
name: 'EC2 Instance',
name: 'EC2 Auto Enrollment',
kind: ResourceKind.Server,
keywords:
baseServerKeywords + 'ec2 instance connect endpoint aws amazon eice',
icon: 'Aws',
event: DiscoverEventResource.Ec2Instance,
nodeMeta: {
location: ServerLocation.Aws,
discoveryConfigMethod: DiscoverDiscoveryConfigMethod.AwsEc2Eice,
},
},
{
name: 'EC2 Auto Discover with SSM',
kind: ResourceKind.Server,
keywords:
baseServerKeywords + 'ec2 instance aws amazon simple systems manager ssm',
baseServerKeywords +
'ec2 instance aws amazon simple systems manager ssm auto enrollment',
icon: 'Aws',
event: DiscoverEventResource.Ec2Instance,
nodeMeta: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { SelfHostedAutoDiscoverDirections } from 'teleport/Discover/Shared/AutoD
import { DEFAULT_DISCOVERY_GROUP_NON_CLOUD } from 'teleport/services/discovery';

import { ActionButtons, Header } from '../../Shared';
import { SingleEc2InstanceInstallation } from '../Shared';

export function ConfigureDiscoveryService() {
const { nextStep, agentMeta, updateAgentMeta } = useDiscover();
Expand Down Expand Up @@ -53,6 +54,7 @@ export function ConfigureDiscoveryService() {
The Teleport Discovery Service can connect to Amazon EC2 and
automatically discover and enroll EC2 instances.
</Text>
<SingleEc2InstanceInstallation />
<SelfHostedAutoDiscoverDirections
showSubHeader={false}
clusterPublicUrl={storeUser.state.cluster.publicURL}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import { Text, Flex, ButtonPrimary, Box } from 'design';
import * as Icons from 'design/Icon';
import Dialog, { DialogContent } from 'design/DialogConfirmation';

import cfg from 'teleport/config';

export function DiscoveryConfigCreatedDialog({
toNextStep,
}: {
Expand All @@ -40,12 +38,6 @@ export function DiscoveryConfigCreatedDialog({
<Icons.Check size="small" ml={1} mr={2} color="success.main" />
<Box>
<Text>Discovery configuration successfully created.</Text>
{cfg.isCloud && (
<Text mt={2}>
It can take up to 30 minutes for the instances to be discovered
and listed in Teleport.
</Text>
)}
</Box>
</Flex>
<ButtonPrimary width="100%" onClick={() => toNextStep()}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ import useStickyClusterId from 'teleport/useStickyClusterId';

import { ActionButtons, Header, Mark, StyledBox } from '../../Shared';

import { SingleEc2InstanceInstallation } from '../Shared';

import { DiscoveryConfigCreatedDialog } from './DiscoveryConfigCreatedDialog';

const IAM_POLICY_NAME = 'EC2DiscoverWithSSM';
Expand Down Expand Up @@ -155,6 +157,7 @@ export function DiscoveryConfigSsm() {
automatically discover and register instances. <SharedText />
</Text>
)}
{cfg.isCloud && <SingleEc2InstanceInstallation />}
{attempt.status === 'error' && (
<Danger mt={3}>{attempt.statusText}</Danger>
)}
Expand Down
49 changes: 49 additions & 0 deletions web/packages/teleport/src/Discover/Server/Shared.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Teleport
* Copyright (C) 2024 Gravitational, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { Link as InternalLink } from 'react-router-dom';
import { OutlineInfo } from 'design/Alert/Alert';
import { Box } from 'design';

import cfg from 'teleport/config';

import { InfoIcon } from '../Shared/InfoIcon';
import { Mark } from '../Shared';

export const SingleEc2InstanceInstallation = () => (
<OutlineInfo mt={3} linkColor="buttons.link.default">
<Box>
<InfoIcon />
</Box>
<Box>
Auto discovery will enroll all EC2 instances found in a region. If you
want to enroll a <Mark>single</Mark> EC2 instance instead, consider
following the{' '}
<InternalLink
to={{
pathname: cfg.routes.discover,
state: { searchKeywords: 'linux' },
}}
>
Teleport service installation
</InternalLink>{' '}
flow instead.
</Box>
</OutlineInfo>
);
29 changes: 29 additions & 0 deletions web/packages/teleport/src/Discover/Shared/InfoIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Teleport
* Copyright (C) 2024 Gravitational, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import styled from 'styled-components';
import { Info } from 'design/Icon';

export const InfoIcon = styled(Info)`
background-color: ${p => p.theme.colors.link};
border-radius: 100px;
height: 32px;
width: 32px;
color: ${p => p.theme.colors.text.primaryInverse};
margin-right: ${p => p.theme.space[2]}px;
`;

0 comments on commit e424e7c

Please sign in to comment.