[3] amplify 초기부터 구축하기

Soly; 독특하게·2021년 6월 28일
1

Lily의 인턴일지

목록 보기
5/6
post-thumbnail

- amplify add auth

  Do you want to use the default authentication and security configuration? Default configuration
  Warning: you will not be able to edit these selections. 
  How do you want users to be able to sign in? Username
  Do you want to configure advanced settings? No, I am done.
  Successfully added auth resource ~~~~ locally
→ amplify push 필수

- amplify update auth

    Please note that certain attributes may not be overwritten if you choose to use defaults settings.
    Using service: Cognito, provided by: awscloudformation
     What do you want to do? Create or update Cognito user pool groups
    ? Provide a name for your user pool group: superadmin
    ? Do you want to add another User Pool Group Yes
    ? Provide a name for your user pool group: admin
    ? Do you want to add another User Pool Group No
    ✔ Sort the user pool groups in order of preference · superadmin, admin
    Successfully updated auth resource fine72cc3688 locally

→ 참고 : https://github.com/aws-amplify/amplify-cli/issues/1259

- amplify add storage

    ? Please select from one of the below mentioned services: Content (Images, audio, video, etc.)
    ? Please provide a friendly name for your resource that will be used to label this category in the project: (default값 선택)
    ? Please provide bucket name: (default값 선택)
    ? Restrict access by? Auth/Guest Users
    ? Who should have access: Auth and guest users
    ? What kind of access do you want for Authenticated users? create/update, read, delete
    ? What kind of access do you want for Guest users? create/update, read, delete
    ? Do you want to add a Lambda Trigger for your S3 Bucket? No
    Auth configuration is required to allow unauthenticated users, but it is not configured properly.
    Successfully updated auth resource locally.
    Successfully added resource s3d02edf1d locally

→ 참고 : https://docs.amplify.aws/lib/storage/getting-started/q/platform/ios#prerequisites

- amplify add api

→ 참고 : https://amplify-analytics.workshop.aws/02-setup-web-application/03-add-graphql-api.html

→ 참고 : https://awskrug.github.io/amplify-photo-gallery-workshop/40_graphql/10_setting_up_appsync.html

- 스키마 수정 후 amplify push 에서 error )

@auth directive with 'userPools' provider found, but the project has no Cognito User Pools authentication provider configured.
이거나
@auth directive with 'apiKey' provider found, but the project has no API Key authentication provider configured.

→ 해결) authorization types API가 여러개여야 한다!

  • amplify update api
? Please select from one of the below mentioned services: GraphQL
? Select from the options below Update auth settings
? Choose the default authorization type for the API : API key
? Enter a description for the API key: (설명 적기)
? After how many days from now the API key should expire (1-365): 7
? Configure additional auth types? Yes
? Choose the additional authorization types you want to configure for the API Amazon Cognito User Pool, IAM
Cognito UserPool configuration
Use a Cognito user pool configured as a part of this project.
profile
협업을 즐겨하는 목표지향적인, Front-End 개발자입니다.

0개의 댓글