Amplify Toolbox
    Preparing search index...

    Amazon Connect Customer Profiles backend for the identifyUser contract, packaged as an AWS CDK construct. Provisions:

    • AmplifyProfile object type: searchable principalId (PROFILE + UNIQUE) identity key + person / targeting attribute schema.
    • DynamoDB Devices table: authoritative device store (PK deviceId, GSI on principalId, native TTL) with strongly-consistent single-owner semantics.
    • identify-user Lambda with least-privilege profile:* on this domain only.
    • HTTP API with SigV4 (IAM / execute-api) authorization on all write routes.
    • push-delivery Lambda (Connect Journey Custom-action target) + a minimal AWS End User Messaging (Pinpoint) application for SendMessages.

    It operates in one of two modes, chosen by whether domainName is provided:

    • CREATE-FROM-SCRATCH (default, domainName omitted): the construct also provisions a brand-new Amazon Connect instance (AWS::Connect::Instance, CONNECT_MANAGED, inbound/outbound enabled) AND a brand-new Customer Profiles domain (AWS::CustomerProfiles::Domain) with generated, stable names, then registers the AmplifyProfile object type INTO that new domain. The object type depends on the created domain so it provisions after it and is torn down before it. A caller needs zero pre-existing Connect setup.
    • ATTACH (domainName provided): the construct registers the AmplifyProfile object type INTO the existing domainName (additive) — such as the domain Amazon Connect auto-creates when Customer Profiles is enabled on an instance — WITHOUT creating an instance or a domain, and without touching the domain's other integrations (CTR, Outbound Campaigns) or its Identity Resolution setting.

    In either mode, identify works against the domain standalone. Outbound Campaigns association — so journeys can target these profiles — is AUTOMATIC in create-from-scratch mode (a Lambda-backed custom resource associates the new domain with the new instance's Outbound Campaigns v2 at deploy time). In attach mode, associating the pre-existing domain is the user's responsibility and is left untouched.

    This construct is framework-agnostic (aws-cdk-lib + constructs only). The defineNotifications factory wraps it for Amplify Gen2 backends, wiring the SigV4-authorized routes to the app's Identity Pool roles and surfacing the endpoint via backend outputs.

    Hierarchy

    • Construct
      • AmplifyNotifications

    Implements

    Index

    Constructors

    Properties

    apiEndpoint: string

    Base invoke URL. Clients call POST {apiEndpoint}/{route}.

    connectInstanceArn?: string

    ARN of the Amazon Connect instance created in create-from-scratch mode. undefined in attach mode.

    connectInstanceId?: string

    Id of the Amazon Connect instance created in create-from-scratch mode. undefined in attach mode.

    createsResources: boolean

    true when this construct created the Customer Profiles domain + Connect instance (create-from-scratch mode); false when it attached to an existing domain named by domainName.

    domainName: string

    The Customer Profiles domain name the object types are registered into.

    identifyUserPath: string = '/identify-user'

    The identify-user route path appended to apiEndpoint.

    node: Node

    The tree node.

    pushFunctionArn: string

    ARN of the push-delivery Lambda, to wire as a Connect Journey Custom-action (Invoke Lambda) target.

    registerDevicePath: string = '/register-device'

    The register-device route path appended to apiEndpoint.

    removeDevicePath: string = '/remove-device'

    The remove-device route path appended to apiEndpoint.

    CDK resources for lower-level access.

    routeInvokeArns: string[]

    The execute-api:Invoke ARNs of the three SigV4 write routes, to grant to the app's Cognito Identity Pool authenticated AND unauthenticated roles (a guest is an unauthenticated identityId on the same endpoints). Each is scoped to POST on that route path of this API's default stage.

    stack: Stack

    The stack this construct belongs to.

    Methods

    • Returns a string representation of this construct.

      Returns string

    • Applies one or more mixins to this construct.

      Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

      Parameters

      • ...mixins: IMixin[]

        The mixins to apply

      Returns IConstruct

      This construct for chaining

    • Checks if x is a construct.

      Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

      Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

      Parameters

      • x: any

        Any object

      Returns x is Construct

      true if x is an object created from a class which extends Construct.