Skip to content

Commit

Permalink
Merge branch 'main' into remove-inventory-dependency-from-observabili…
Browse files Browse the repository at this point in the history
…ty-plugin
  • Loading branch information
kpatticha authored Sep 18, 2024
2 parents ff54d98 + aaa53f5 commit 660929c
Show file tree
Hide file tree
Showing 13 changed files with 548 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const FirehosePage = () => (
headlineCopy={i18n.translate(
'xpack.observability_onboarding.experimentalOnboardingFlow.customHeader.firehose.text',
{
defaultMessage: 'Setting up Amazon Data Firehose',
defaultMessage: 'Set up Amazon Data Firehose',
}
)}
captionCopy={i18n.translate(
Expand All @@ -29,6 +29,7 @@ export const FirehosePage = () => (
'This installation is tailored for setting up Firehose in your Observability project with minimal configuration.',
}
)}
isTechnicalPreview={true}
/>
}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import { i18n } from '@kbn/i18n';
import {
EuiFlexGroup,
EuiFlexItem,
EuiIcon,
EuiText,
useEuiTheme,
useGeneratedHtmlId,
} from '@elastic/eui';
import { css } from '@emotion/react';
import { HAS_DATA_FETCH_INTERVAL } from './utils';

export function AutoRefreshCallout() {
const { euiTheme } = useEuiTheme();
const messageId = useGeneratedHtmlId();

return (
<EuiFlexGroup>
<EuiFlexItem
role="status"
aria-labelledby={messageId}
grow={false}
css={css`
background-color: ${euiTheme.colors.lightestShade};
padding: ${euiTheme.size.m} ${euiTheme.size.base};
border-radius: ${euiTheme.border.radius.medium};
`}
>
<EuiFlexGroup gutterSize="s" alignItems="center">
<EuiIcon type="timeRefresh" size="m" />
<EuiText size="s">
<p id={messageId}>
{i18n.translate(
'xpack.observability_onboarding.firehosePanel.autorefreshCalloutLabel',
{
defaultMessage: 'Auto-refreshing every {intervalSeconds} s',
values: { intervalSeconds: Math.round(HAS_DATA_FETCH_INTERVAL / 1000) },
}
)}
</p>
</EuiText>
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* 2.0.
*/

import React from 'react';
import {
EuiAccordion,
EuiCodeBlock,
Expand All @@ -14,19 +13,20 @@ import {
EuiText,
useGeneratedHtmlId,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';
import {
FIREHOSE_CLOUDFORMATION_STACK_NAME,
FIREHOSE_LOGS_STREAM_NAME,
FIREHOSE_METRICS_STREAM_NAME,
} from '../../../../common/aws_firehose';
import { CopyToClipboardButton } from '../shared/copy_to_clipboard_button';
import { DownloadTemplateCallout } from './download_template_callout';
import { buildCreateStackCommand, buildStackStatusCommand } from './utils';

interface Props {
encodedApiKey: string;
onboardingId: string;
elasticsearchUrl: string;
templateUrl: string;
isCopyPrimaryAction: boolean;
Expand Down Expand Up @@ -57,7 +57,7 @@ export function CreateStackCommandSnippet({
<p>
<FormattedMessage
id="xpack.observability_onboarding.firehosePanel.createFirehoseStreamDescription"
defaultMessage="Run the command bellow in your terminal where you have {awsCLIInstallGuideLink} configured. The command will create a CloudFormation stack that includes a Firehose delivery, backup S3 bucket, CloudWatch subscription filter and metrics stream along with required IAM roles."
defaultMessage="Run the command bellow in your terminal where you have {awsCLIInstallGuideLink} configured. The command will create a CloudFormation stack from our template that includes a Firehose delivery, backup S3 bucket, CloudWatch subscription filter and metrics stream along with required IAM roles."
values={{
awsCLIInstallGuideLink: (
<EuiLink
Expand All @@ -75,6 +75,10 @@ export function CreateStackCommandSnippet({
}}
/>
</p>

<p>
<DownloadTemplateCallout />
</p>
</EuiText>

<EuiSpacer />
Expand All @@ -94,7 +98,15 @@ export function CreateStackCommandSnippet({

<EuiSpacer />

<EuiAccordion id={stackStatusAccordionId} buttonContent="Check stack status">
<EuiAccordion
id={stackStatusAccordionId}
buttonContent={i18n.translate(
'xpack.observability_onboarding.firehosePanel.stackStatusAccordionButtonLabel',
{
defaultMessage: 'Check status of the CloudFormation stack',
}
)}
>
<EuiSpacer size="xs" />
<EuiCodeBlock language="text" paddingSize="m" fontSize="m" isCopyable>
{stackStatusCommand}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { EuiButton, EuiSpacer, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';
import {
FIREHOSE_CLOUDFORMATION_STACK_NAME,
FIREHOSE_LOGS_STREAM_NAME,
FIREHOSE_METRICS_STREAM_NAME,
} from '../../../../common/aws_firehose';
import { DownloadTemplateCallout } from './download_template_callout';
import { buildCreateStackAWSConsoleURL } from './utils';

interface Props {
encodedApiKey: string;
elasticsearchUrl: string;
templateUrl: string;
isPrimaryAction: boolean;
}

export function CreateStackInAWSConsole({
encodedApiKey,
elasticsearchUrl,
templateUrl,
isPrimaryAction,
}: Props) {
const awsConsoleURL = buildCreateStackAWSConsoleURL({
templateUrl,
stackName: FIREHOSE_CLOUDFORMATION_STACK_NAME,
logsStreamName: FIREHOSE_LOGS_STREAM_NAME,
metricsStreamName: FIREHOSE_METRICS_STREAM_NAME,
elasticsearchUrl,
encodedApiKey,
});

return (
<>
<EuiText>
<p>
<FormattedMessage
id="xpack.observability_onboarding.firehosePanel.createFirehoseStreamInAWSConsoleDescription"
defaultMessage="Click the button below to create a CloudFormation stack from our template. The stack will include a Firehose delivery stream, backup S3 bucket, CloudWatch subscription filter, metrics stream, and necessary IAM roles. Keep this page open, and return once you've submitted the form in AWS Console"
/>
</p>
<p>
<DownloadTemplateCallout />
</p>
</EuiText>

<EuiSpacer size="m" />

<EuiButton
data-test-subj="observabilityOnboardingCreateStackInAWSConsoleButton"
href={awsConsoleURL}
target="_blank"
iconSide="right"
iconType="popout"
fill={isPrimaryAction}
>
{i18n.translate(
'xpack.observability_onboarding.createStackInAWSConsole.createFirehoseStreamInAWSConsoleButtonLabel',
{ defaultMessage: 'Create Firehose Stream in AWS' }
)}
</EuiButton>
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import { EuiLink } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { FIREHOSE_CLOUDFORMATION_TEMPLATE_URL } from '../../../../common/aws_firehose';

export function DownloadTemplateCallout() {
return (
<FormattedMessage
id="xpack.observability_onboarding.firehosePanel.downloadTemplateDescription"
defaultMessage="If needed, you can {downloadLink} to use it as part of an existing IaC setup."
values={{
downloadLink: (
<EuiLink
data-test-subj="observabilityOnboardingFirehosePanelDownloadCloudFormationTemplateLink"
href={FIREHOSE_CLOUDFORMATION_TEMPLATE_URL}
download={true}
>
{i18n.translate(
'xpack.observability_onboarding.firehosePanel.downloadCloudFormationTemplateButtonLabel',
{ defaultMessage: 'download and modify the CloudFormation template' }
)}
</EuiLink>
),
}}
/>
);
}
Loading

0 comments on commit 660929c

Please sign in to comment.