/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import { EuiCallOut, EuiFieldText, EuiFormRow, EuiLink, EuiSpacer, EuiText, } from '@elastic/eui'; import React, { useContext } from 'react'; import { DOCUMENTATION_LINK } from '../../../utils/constants'; import { MainContext } from '../../Main/Main'; import { CreateChannelContext } from '../CreateChannel'; import { validateArn } from '../utils/validationHelper'; interface SNSSettingsProps { topicArn: string; setTopicArn: (topicArn: string) => void; roleArn: string; setRoleArn: (roleArn: string) => void; } export function SNSSettings(props: SNSSettingsProps) { const context = useContext(CreateChannelContext)!; const mainStateContext = useContext(MainContext)!; return ( <> 0} > props.setTopicArn(e.target.value)} isInvalid={context.inputErrors.topicArn.length > 0} onBlur={() => { context.setInputErrors({ ...context.inputErrors, topicArn: validateArn(props.topicArn), }); }} /> {mainStateContext.tooltipSupport ? ( <> IAM role ARN - optional } > <> IAM role ARN can only be used for clusters running on AWS network. props.setRoleArn(e.target.value)} />
If your cluster is not running on AWS, you must configure aws credentials on your OpenSearch cluster.{' '} Learn more
) : ( 0} > props.setRoleArn(e.target.value)} isInvalid={context.inputErrors.roleArn.length > 0} onBlur={() => { context.setInputErrors({ ...context.inputErrors, roleArn: validateArn(props.roleArn), }); }} /> )} ); }