diff --git a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx index 26cbbd77acc18..27924caf2d1b9 100644 --- a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx @@ -47,6 +47,7 @@ import { import cfg from 'teleport/config'; import { FinishDialog } from './FinishDialog'; +import { ConfigureAwsOidcSummary } from './ConfigureAwsOidcSummary'; export function AwsOidc() { const [integrationName, setIntegrationName] = useState(''); @@ -163,12 +164,9 @@ export function AwsOidc() { lines={[ { text: - `teleport.dev/cluster: ` + - clusterId + - `\n` + - `teleport.dev/origin: integration_awsoidc\n` + - `teleport.dev/integration: ` + - integrationName, + `teleport.dev/cluster: ${clusterId}\n` + + `teleport.dev/integration: ${integrationName}\n` + + `teleport.dev/origin: integration_awsoidc`, }, ]} /> @@ -219,7 +217,13 @@ export function AwsOidc() { {scriptUrl && ( <> - Step 2 + + Step 2 + + Open{' '} . + */ + +import React from 'react'; +import styled from 'styled-components'; +import { Flex, Box, H3, Text, Mark } from 'design'; +import TextEditor from 'shared/components/TextEditor'; +import { ToolTipInfo } from 'shared/components/ToolTip'; + +import useStickyClusterId from 'teleport/useStickyClusterId'; + +export function ConfigureAwsOidcSummary({ + roleName, + integrationName, +}: { + roleName: string; + integrationName: string; +}) { + const { clusterId } = useStickyClusterId(); + + const json = `{ + "name": ${roleName}, + "description": "Used by Teleport to provide access to AWS resources.", + "trust_policy": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": "sts:AssumeRoleWithWebIdentity", + "Principal": { + "Federated": "":oidc-provider/${roleName}", + }, + "Condition": { + "StringEquals": { + "${clusterId}:aud": "discover.teleport", + } + } + } + ] + }, + "tags": { + "teleport.dev/cluster": "${clusterId}", + "teleport.dev/integration": "${integrationName}", + "teleport.dev/origin": "integration_awsoidc" + } +}`; + + return ( + +

Running the command in AWS CloudShell does the following:

+ 1. Configures an AWS IAM OIDC Identity Provider (IdP) + + 2. Configures an IAM role named {roleName} to trust the + IdP: + + + + + + +
+ ); +} + +const EditorWrapper = styled(Flex)` + height: 300px; + margin-top: ${p => p.theme.space[3]}px; + width: 450px; +`;