amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

Set Amplify Auth triggers via override.ts

Open henobi opened this issue 3 years ago • 8 comments

Before opening, please confirm:

  • [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • [X] I have searched for duplicate or closed issues.
  • [X] I have read the guide for submitting bug reports.
  • [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

No response

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

No response

Amplify CLI Version

7.6.5

What operating system are you using?

Mac

Amplify Categories

auth

Amplify Commands

push

Describe the bug

Hello,

before the amplify cli auth upgrade and the introduction of the override.ts file, we configured our Lamba Config Parameters in the parameters.json file via

  "functionPostConfirmationArn": {
    "Fn::GetAtt": ["functionPostConfirmation", "Outputs.Arn"]
  }

But now this is not possible anymore and we are stuck doing deployments.

So now we need to implement the same in our override.ts file to be able to run deployments again.

 resources.userPool.lambdaConfig = {
     ...resources.userPool.lambdaConfig,
     postConfirmation: {
       "Fn::GetAtt": ["functionPostConfirmation", "Outputs.Arn"]
     },
  };

We are not using the cognito triggeres configured by amplify because of #9382 .

We are really having trouble at the moment and we would appreciate quick help.

Thank you

Kind regards Hendrik

Expected behavior

Reproduction steps

GraphQL schema(s)

# Put schemas below this line


Log output

# Put your logs below this line


Additional information

No response

henobi avatar Dec 27 '21 20:12 henobi

@henobi postConfirmation field requires an string type not an object type, you can directly assign it the arn of your function to the field

ammarkarachi avatar Dec 27 '21 22:12 ammarkarachi

Hi Ammar, thank you for your reply.

Yes in a single stage environment this would be a perfect solution but we are using a multi-stage environment with dev, staging and prod. So in our case the function arn is dependent on the environment and we must inject it in a dynamic way.

Do you have an idea how we can achieve that? Thank you very much in advance!

Best, Hendrik

Ammar @.***> schrieb am Mo. 27. Dez. 2021 um 23:31:

@henobi https://github.com/henobi postConfirmation field requires an string type not an object type, you can directly assign it the arn of your function to the field

— Reply to this email directly, view it on GitHub https://github.com/aws-amplify/amplify-cli/issues/9383#issuecomment-1001784756, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHEA7Y7HEKFKVDD2VSFBADUTDSLFANCNFSM5K26FLNA . You are receiving this because you were mentioned.Message ID: @.***>

henobi avatar Dec 28 '21 00:12 henobi

Hi @ammarkarachi, We really would appreciate your help on this. Thx and best regards! Jannick

jviets avatar Dec 29 '21 08:12 jviets

It looks like we don't expose the env info anywhere I will mark this as a feature request to be worked on by the team.

ammarkarachi avatar Jan 03 '22 21:01 ammarkarachi

I also require the ability to configure triggers in the override.ts, we would need the env info for the other functions in the amplify project.

IvanCaceres avatar Feb 02 '22 17:02 IvanCaceres

Seconded! This would be very helpful :)

SaileshKumar avatar Mar 28 '22 18:03 SaileshKumar

is there any news on this?

slaat avatar Aug 01 '22 16:08 slaat

related https://github.com/aws-amplify/amplify-cli/issues/9063

josefaidt avatar Aug 01 '22 19:08 josefaidt