Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ test('authentication should contain valid AWS region choices', () => {
])
})

test('authentication should contain valid partnerEventSourceName choices', () => {
const partnerEventSourceField = testDestination.authentication?.fields?.partnerEventSourceName
expect(partnerEventSourceField).toBeDefined()
expect(partnerEventSourceField?.choices).toEqual([
{ label: 'segment.com', value: 'aws.partner/segment.com' },
{ label: 'segment.com.test', value: 'aws.partner/segment.com.test' }
])
})

test('createPartnerEventSource should default to false', () => {
const createPartnerEventSourceField = testDestination.authentication?.fields?.createPartnerEventSource
expect(createPartnerEventSourceField).toBeDefined()
Expand Down

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
import type { DestinationDefinition } from '@segment/actions-core'
import type { Settings } from './generated-types'
import { DEFAULT_REQUEST_TIMEOUT } from '@segment/actions-core'

import send from './send'

import sendV2 from './sendV2'

const destination: DestinationDefinition<Settings> = {
name: 'Amazon Eventbridge',
slug: 'actions-amazon-eventbridge',
mode: 'cloud',
description:
'Amazon EventBridge is a serverless event bus service that makes it easy to connect your applications with data from a variety of sources.',
description: 'Amazon EventBridge is a serverless event bus service that makes it easy to connect your applications with data from a variety of sources.',
authentication: {
scheme: 'custom',
fields: {
awsAccountId: {
accountId: {
type: 'string',
label: 'AWS Account ID',
description: `The AWS Account ID that the event bus belongs to.
This is used to generate the ARN for the event bus.`,
description: `The AWS Account ID that the event bus belongs to. This is used to generate the ARN for the event bus.`,
required: true
},
awsRegion: {
region: {
type: 'string',
label: 'AWS Region',
description: 'The AWS region that the event bus belongs to.',
disabledInputMethods: ['enrichment', 'function', 'variable'],
required: true,
choices: [
{ label: 'us-east-1', value: 'us-east-1' },
Expand All @@ -45,30 +39,6 @@ const destination: DestinationDefinition<Settings> = {
{ label: 'ca-central-1', value: 'ca-central-1' },
{ label: 'eu-central-1', value: 'eu-central-1' }
]
},
partnerEventSourceName: {
type: 'string',
label: 'Partner Event Source Name',
description: 'The name of the partner event source to use for the event bus.',
required: true,
default: 'segment.com',
choices: [
{ label: 'segment.com', value: 'aws.partner/segment.com' },
{ label: 'segment.com.test', value: 'aws.partner/segment.com.test' }
]
},
createPartnerEventSource: {
type: 'boolean',
label: 'Create Partner Event Source',
description: `If enabled, Segment will check whether Partner Source identified by Segment source ID
exists in EventBridge.
If Partner Source does not exist, Segment will create a new Partner Source.`,
default: false
}
},
testAuthentication: async (_request, { settings }) => {
if (!settings.awsAccountId || !settings.awsRegion) {
throw new Error('AWS Account ID and Region are required.')
}
}
},
Expand All @@ -78,8 +48,7 @@ const destination: DestinationDefinition<Settings> = {
}
},
actions: {
send,
sendV2
send
}
}

Expand Down
Loading
Loading