diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx index 1472a48faccfc..7fafe17113c84 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx @@ -18,7 +18,7 @@ import { EuiHorizontalRule, } from '@elastic/eui'; import type { NewPackagePolicy } from '@kbn/fleet-plugin/public'; -import { PackageInfo } from '@kbn/fleet-plugin/common'; +import { NewPackagePolicyInput, PackageInfo } from '@kbn/fleet-plugin/common'; import { FormattedMessage } from '@kbn/i18n-react'; import { css } from '@emotion/react'; import { i18n } from '@kbn/i18n'; @@ -34,6 +34,7 @@ import { NewPackagePolicyPostureInput, } from '../utils'; import { SetupFormat, useAwsCredentialsForm } from './hooks'; +import { AWS_ORGANIZATION_ACCOUNT } from '../policy_template_form'; import { AwsCredentialsType } from '../../../../common/types'; interface AWSSetupInfoContentProps { @@ -106,8 +107,10 @@ interface Props { const CloudFormationSetup = ({ hasCloudFormationTemplate, + input, }: { hasCloudFormationTemplate: boolean; + input: NewPackagePolicyInput; }) => { if (!hasCloudFormationTemplate) { return ( @@ -119,6 +122,9 @@ const CloudFormationSetup = ({ ); } + + const accountType = input.streams?.[0]?.vars?.['aws.account_type']?.value; + return ( <> @@ -127,12 +133,21 @@ const CloudFormationSetup = ({ list-style: auto; `} > -
  • - -
  • + {accountType === AWS_ORGANIZATION_ACCOUNT ? ( +
  • + +
  • + ) : ( +
  • + +
  • + )}
  • {setupFormat === 'cloud_formation' && ( - + )} {setupFormat === 'manual' && ( <> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_cloud_formation_modal.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_cloud_formation_modal.tsx index 7ed959e40efa0..0ca51d6f595fa 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_cloud_formation_modal.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_cloud_formation_modal.tsx @@ -58,7 +58,7 @@ export const PostInstallCloudFormationModal: React.FunctionComponent<{ - + {error && isError && ( <> diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/cloud_formation_instructions.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/cloud_formation_instructions.tsx index 83031548293f7..61ed68a059cab 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/cloud_formation_instructions.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/cloud_formation_instructions.tsx @@ -50,7 +50,9 @@ export const CloudFormationInstructions: React.FunctionComponent = ({ } )} > - + ); -export const CloudFormationGuide = () => { +export const CloudFormationGuide = ({ + awsAccountType, +}: { + awsAccountType?: CloudSecurityIntegrationAwsAccountType; +}) => { return (

    @@ -44,12 +50,21 @@ export const CloudFormationGuide = () => {

      -
    1. - -
    2. + {awsAccountType === 'organization-account' ? ( +
    3. + +
    4. + ) : ( +
    5. + +
    6. + )}