import { defineBackend } from '@aws-amplify/backend';
import { defineNotifications } from '@aws-amplify/backend-notifications';
import { auth } from './auth/resource';
import { secret } from '@aws-amplify/backend';
defineBackend({
auth,
// Zero-config: creates a Connect instance + Customer Profiles domain:
notifications: defineNotifications(),
// ...or attach to an existing domain and enable push channels:
// notifications: defineNotifications({
// domainName: 'amazon-connect-amplify',
// apns: {
// tokenKey: secret('APNS_SIGNING_KEY'),
// tokenKeyId: 'ABC123DEFG',
// teamId: 'DEF456GHIJ',
// bundleId: 'com.example.app',
// },
// fcm: { serviceJson: secret('FCM_SERVICE_ACCOUNT_JSON') },
// }),
});
Include an Amazon Connect Customer Profiles-backed notifications resource in your Amplify backend. It registers the AmplifyProfile object type, a DynamoDB device store, a least-privilege write Lambda behind a SigV4-authorized HTTP API, and the push-delivery Lambda (invoked by a Connect Journey Custom-action) with a minimal AWS End User Messaging application. The invoke endpoint / region are surfaced under
notifications.amazon_connectinamplify_outputs.json.By DEFAULT (no
domainName) it CREATES FROM SCRATCH: a brand-new Amazon Connect instance AND a brand-new Customer Profiles domain (generated, stable names) are provisioned and the object types are registered into that new domain — zero pre-existing Connect setup required, and Connect is fully hidden from the caller.Provide
domainNameto ATTACH to an EXISTING Customer Profiles domain — e.g. the domain Amazon Connect auto-creates for your instance — registering the object types into it (additive), without creating an instance or a domain.Optionally provide
apnsand/orfcmto enable the corresponding push channel on the created End User Messaging (Pinpoint) application. The sensitive key material (APNs.p8, FCM service-account JSON) is supplied via Amplifysecret()and resolved at deploy time; non-secret identifiers are plain props. Omit them to leave the channels not configured (unchanged behavior).