Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of service auth/unauth roles created by Cognito Console while integrating-File storage using Amplify Studio Console. #13345

Closed
Jyoti-dmi opened this issue Oct 18, 2023 · 3 comments
Assignees
Labels
auth Issues tied to the auth category of the CLI bug Something isn't working import Issues related to importing resources into an Amplify project p1 storage Issues tied to the storage category

Comments

@Jyoti-dmi
Copy link

Describe the feature you'd like to request

To be able to use the service role : arn:aws:iam:::role/service-role/my-role create by the Cognito with Amplify Studio Console to integrate-File storage(i.e. using Create a new S3 bucket).

Describe your use case and how the feature would improve your experience.

When creating the roles using Congito Console, the Cognito console will prepend service-role/ to whatever IAM role name you specify.

For example:
Screenshot 2023-10-18 at 3 34 56 PM

The role arn will be created as: arn:aws:iam::<account-id>:role/service-role/testrole

However, when adding the storage using Amplify Studio Console, it is throwing an error message as mentioned below even if the role name is fine:

The specified value for roleName is invalid. It must contain only alphanumeric characters and/or the following: +=,.@_-

Reproduction steps:

  1. Create a Cognito Identity Pool with defaults specified for Authenticated and Unauthenticated roles using the Cognito console. This will append role arn with service-role/
  2. Go to Amplify Studio Console and after configuring the Cognito authentication, try adding storage(i.e. using Create a new S3 bucket)--> Create Bucket.
  3. Receive exception: The specified value for roleName is invalid. It must contain only alphanumeric characters and/or the following: +=,.@_-
    For example:
Screenshot 2023-10-18 at 3 51 01 PM

When I am using another auth/unauth roles(which is in format: arn:aws:iam::<account-id>:role/my-role-name ), then it is getting integrated successfully.

I see here: #12817 that Amplify CLI supports service roles now. Would it be possible to add the same for Amplify Studio Console as well?

Describe alternatives you've considered

When I am using another auth/unauth roles(which is in format: arn:aws:iam::<account-id>:role/my-role-name ), then it is getting integrated successfully.

Additional context

No response

@Jyoti-dmi Jyoti-dmi added the pending-triage Issue is pending triage label Oct 18, 2023
@ykethan
Copy link
Member

ykethan commented Oct 18, 2023

Hey @Jyoti-dmi, thank you for reaching out. I was able to reproduce this issue. Marking as bug.
Transferring the issue to Amplify CLI repository as I was able to reproduce this using the CLI.

Reproduction steps:

  1. create a user pool and identity pool with auth and unauth roles on the AWS Cognito console.
  2. amplify import auth
  3. amplify push
  4. amplify add storage
  5. amplify push

Observe errors on S3 policies as the template refers to the authRole.

@ykethan ykethan transferred this issue from aws-amplify/amplify-studio Oct 18, 2023
@ykethan ykethan added bug Something isn't working auth Issues tied to the auth category of the CLI storage Issues tied to the storage category import Issues related to importing resources into an Amplify project and removed pending-triage Issue is pending triage labels Oct 18, 2023
@josefaidt josefaidt added the p1 label Oct 18, 2023
@rtpascual
Copy link
Contributor

The fix was released with Amplify CLI v12.8.0

Copy link

github-actions bot commented Dec 4, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues tied to the auth category of the CLI bug Something isn't working import Issues related to importing resources into an Amplify project p1 storage Issues tied to the storage category
Projects
None yet
Development

No branches or pull requests

4 participants