Closed stefanhk31 closed 8 months ago
Butter API key (stored in secrets) should be a dependency of Butter CMS Client (but AWS secrets client should NOT be dependency of butter).
...or should API key not be necessary at all, because it is handled in API management???
Start this by setting up API gateway in AWS, finish with AWS client package in app.
Some resources:
Calling AWS from Dart:
https://docs.amplify.aws/flutter/start/project-setup/escape-hatch/
Will need to configure AWS creds in either env (not ideal) or in a config file. Config file will need to be accessible via GitHub actions:
https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions
First step to this is probably to figure out IAM creds for the app.
**Can I use anonymous auth (via Cognito) to grant access to hit a lambda that has access to ASM?
AWS client should get secret and asynchronously initialize butter client in Middleware provider.
Potentially can avoid Cognito pool w DF as only allowed AWS clue
Can I access env vars on dart frog in app center? Might not be feasible but something to consider.
IF deployed DF container can see env vars that I set via app center, we may not need an API gateway at all....
As of most recent testing, env vars are accessible via app runner.
Thinking APIM/Lambda that Flutter accesses thru client, then talks to secrets manager/Cloud front to handle API key and req routing to Butter.
Need to set up IAM role in AWS to allow access to secrets manager.
https://docs.aws.amazon.com/secretsmanager/latest/userguide/asm_access.html#endpoints