Skip to content

Member not found: 'IDENTITYPOOL' #6971

Description

@tiyberius

Description

I've searched existing open issues and couldn't find anything, so here we go:

One day, I suddenly started getting build errors like the following that would completely block me from compiling my app:

    lib/models/User.dart:386:49: Error: Member not found: 'IDENTITYPOOL'.
            provider: amplify_core.AuthRuleProvider.IDENTITYPOOL,

I'd been running relatively outdated versions of all flutter the amplify libraries, 2.6.0 for most. I figured an upgrade to 2.11.0 would fix this (spoiler alert: it did not). Looking at the error however, it makes sense because if we look at the following line in my User.dart models file

provider: amplify_core.AuthRuleProvider.IDENTITYPOOL,

and go to auth_rule.dart, we can see::

enum AuthRuleProvider { APIKEY, OIDC, IAM, USERPOOLS, FUNCTION }

only IAM is available. I'm on the latest version of amplify cli

$ amplify --version

⚠️  WARNING: AWS Amplify Gen 1 CLI is in maintenance mode and will reach end of life on May 1, 2027.
During maintenance mode, only critical bug fixes and security patches will be provided.
Migrate to Amplify Gen 2: https://docs.amplify.aws/react/start/migrate-to-gen2/

14.4.0

and a amplify codegen models did not fix it. I have to manually go into my model fils and substitute IDENTITYPOOLS to IAM, then the compiler is happy.

So yeah, I'm very confused and also surprised that no one else has run into this?

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

  1. Create an empty folder and place the following in a file called schema.graphql
type User @model @auth(rules: [
    { allow: private, provider: identityPool }
    { allow: owner }
    ]) {
    id: String! @index
}
  1. Create a pubspec.yaml with:
name: bug_repro
description: Amplify codegen IDENTITYPOOL bug reproduction

environment:
  sdk: '>=3.0.0 <4.0.0'

dependencies:
  flutter:
    sdk: flutter
  amplify_flutter: ^2.11.0
  1. Run a flutter pub get
  2. Create models directory mkdir models
  3. Run codegen command
$ amplify codegen models flutter --target flutter --model-schema schema.graphql --output-dir models

⚠️  WARNING: AWS Amplify Gen 1 CLI is in maintenance mode and will reach end of life on May 1, 2027.
During maintenance mode, only critical bug fixes and security patches will be provided.
Migrate to Amplify Gen 2: https://docs.amplify.aws/react/start/migrate-to-gen2/

Skipping PreCodegenModels lifecycle event, due to presence of ["target","model-schema"] in context options
Successfully generated models. Generated models can be found in /Users/tobias/tmp/amplify-flutter-id-pool-bug/models
Skipping PostCodegenModels lifecycle event, due to presence of ["target","model-schema"] in context options
  1. Inspect models/User.dart and it has the line:
        provider: amplify_core.AuthRuleProvider.IDENTITYPOOL,

which is a problem because if you go to the AuthRuleProvider definition, there's no IDENTITYPOOL enumeration value, only IAM

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.38.1

Amplify Flutter Version

2.11.0

Deployment Method

Amplify CLI (Gen 1)

Schema

type User @model @auth(rules: [
    { allow: private, provider: identityPool }
    { allow: owner }
    ]) {
    id: String! @index
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working; the issue has reproducible steps and has been reproduced

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions