aws-amplify / docs

AWS Amplify Framework Documentation
https://docs.amplify.aws
Apache License 2.0
483 stars 1.05k forks source link

document extending auth/unauth roles in Gen 2 docs #6941

Closed ykethan closed 1 month ago

ykethan commented 8 months ago

Is your feature request related to a problem? Please describe. docs currently does not show document how to modify or add policies to auth and unauth roles.

Describe the solution you'd like

import { Policy, PolicyStatement } from "aws-cdk-lib/aws-iam";
const backend = defineBackend({
  auth,
});

const myPolicy = new Policy(backend.auth, "AuthenticatedUserIamRolePolicy",{})
backend.auth.resources.authenticatedUserIamRole.attachInlinePolicy(myPolicy);
myyk commented 1 month ago

Can you update your policies like that? I'm lost trying to find out how to update authenticated users policies or lambda policies.

ykethan commented 1 month ago

@myyk refer to these examples: https://docs.amplify.aws/react/build-a-backend/functions/grant-access-to-other-resources/#using-cdk https://docs.amplify.aws/react/build-a-backend/add-aws-services/analytics/set-up-analytics/#set-up-analytics-backend

myyk commented 1 month ago

Oh that looks like what I was looking for, thank you!

ykethan commented 1 month ago

Closing this as the examples are documented docs.amplify.aws/react/build-a-backend/functions/grant-access-to-other-resources#using-cdk docs.amplify.aws/react/build-a-backend/add-aws-services/analytics/set-up-analytics#set-up-analytics-backend