aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.83k stars 823 forks source link

aws-exports.js values not generated when using override.ts #13887

Open pr0g opened 3 months ago

pr0g commented 3 months ago

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

v16.20.2

Amplify CLI Version

12.12.6

What operating system are you using?

macOS

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

N/A

Describe the bug

When setting OAuth values in amplify/backend/auth/<app>/override.ts, for example:

...
resources.userPoolClient.allowedOAuthFlows = ["code"];
resources.userPoolClient.allowedOAuthScopes = ["openid", "email", "profile"];
...

These values are not added to the aws-exports.js file.

If the values are added to cli-inputs.json, for example:

"oAuthMetadata": "{\"AllowedOAuthFlows\":[\"code\"],\"AllowedOAuthScopes\":[\"email\",\"openid\",\"profile\"],

The values do appear in aws-exports.js:

"oauth": {
        ...
        "scope": [
            "email",
            "openid",
            "profile"
        ],
        "responseType": "code"
        ...
    },

My understanding is these should be equivalent and override.ts is the more modern way of adding these settings.

Expected behavior

aws-exports.js contains OAuth values when set from override.ts file

Reproduction steps

  1. Use amplify/backend/auth/<app>/override.ts to add OAuth properties a. e.g.
    resources.userPoolClient.allowedOAuthFlows = ["code"];
    resources.userPoolClient.allowedOAuthScopes = ["openid", "email", "profile"];
  2. Perform an amplify push
  3. Notice aws-exports.js does not update

Project Identifier

No response

Log output

No response

Additional information

I may be misunderstanding this, and if using override.ts, there's another way of acccessing the values that are set, instead of using aws-exports.js, but I'm not sure what this process is if it exists.

Thanks!

Before submitting, please confirm:

ykethan commented 3 months ago

Marking as feature request for improvements.