Closed9

Amplify で AppSync の環境を作る[Android]

tkttkt
# amplify add api
? Please select from one of the below mentioned services: GraphQL
? Provide API name: androidinit
? Choose the default authorization type for the API API key
? Enter a description for the API key: fortest
? After how many days from now the API key should expire (1-365): 7
? Do you want to configure advanced settings for the GraphQL API Yes, I want to make some additional changes.
? Configure additional auth types? (y/N) 
root@f24deda587f3:/usr/src/androidinit# amplify add api
? Please select from one of the below mentioned services: GraphQL
? Provide API name: androidinit
? Choose the default authorization type for the API API key
? Enter a description for the API key: fortest
? After how many days from now the API key should expire (1-365): 7
? Do you want to configure advanced settings for the GraphQL API No, I am done.
? Do you have an annotated GraphQL schema? No
? Choose a schema template: Single object with fields (e.g., “Todo” with ID, name, description)

The following types do not have '@auth' enabled. Consider using @auth with @model
         - Todo
Learn more about @auth here: https://docs.amplify.aws/cli/graphql-transformer/directives#auth


GraphQL schema compiled successfully.

Edit your schema at /usr/src/androidinit/amplify/backend/api/androidinit/schema.graphql or place .graphql files in a directory at /usr/src/androidinit/amplify/backend/api/androidinit/schema
? Do you want to edit the schema now? No
Successfully added resource androidinit locally

Some next steps:
"amplify push" will build all your local backend resources and provision it in the cloud
"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud

いけそう

tkttkt
# amplify push
✔ Successfully pulled backend environment dev from the cloud.

Current Environment: dev

| Category | Resource name | Operation | Provider plugin   |
| -------- | ------------- | --------- | ----------------- |
| Api      | androidinit   | Create    | awscloudformation |
? Are you sure you want to continue? Yes

The following types do not have '@auth' enabled. Consider using @auth with @model
         - Todo
Learn more about @auth here: https://docs.amplify.aws/cli/graphql-transformer/directives#auth


GraphQL schema compiled successfully.

Edit your schema at /usr/src/androidinit/amplify/backend/api/androidinit/schema.graphql or place .graphql files in a directory at /usr/src/androidinit/amplify/backend/api/androidinit/schema
? Do you want to generate code for your newly created GraphQL API Yes
? Enter the file name pattern of graphql queries, mutations and subscriptions app/src/main/graphql/**/*.graphql
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions Yes
? Enter maximum statement depth [increase from default if your schema is deeply nested] 2
⠙ Updating resources in the cloud. This may take a few minutes...

UPDATE_IN_PROGRESS amplify-androidinit-dev-203547 AWS::CloudFormation::Stack Mon Dec 14 2020 20:54:35 GMT+0000 (Coordinated Universal Time) User Initiated
⠙ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS apiandroidinit   AWS::CloudFormation::Stack Mon Dec 14 2020 20:54:42 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
UPDATE_IN_PROGRESS UnauthRole       AWS::IAM::Role             Mon Dec 14 2020 20:54:41 GMT+0000 (Coordinated Universal Time)                            
UPDATE_IN_PROGRESS AuthRole         AWS::IAM::Role             Mon Dec 14 2020 20:54:41 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS apiandroidinit   AWS::CloudFormation::Stack Mon Dec 14 2020 20:54:41 GMT+0000 (Coordinated Universal Time)                            
UPDATE_IN_PROGRESS DeploymentBucket AWS::S3::Bucket            Mon Dec 14 2020 20:54:40 GMT+0000 (Coordinated Universal Time)                            
⠸ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS amplify-androidinit-dev-203547-apiandroidinit-3I5KGRMP54V7 AWS::CloudFormation::Stack Mon Dec 14 2020 20:54:42 GMT+0000 (Coordinated Universal Time) User Initiated
⠸ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS GraphQLAPI AWS::AppSync::GraphQLApi Mon Dec 14 2020 20:54:47 GMT+0000 (Coordinated Universal Time) 
⠧ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS GraphQLAPI AWS::AppSync::GraphQLApi Mon Dec 14 2020 20:54:50 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
⠸ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS GraphQLSchema AWS::AppSync::GraphQLSchema Mon Dec 14 2020 20:54:55 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
CREATE_COMPLETE    GraphQLAPIKey AWS::AppSync::ApiKey        Mon Dec 14 2020 20:54:55 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS GraphQLAPIKey AWS::AppSync::ApiKey        Mon Dec 14 2020 20:54:55 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
CREATE_IN_PROGRESS GraphQLSchema AWS::AppSync::GraphQLSchema Mon Dec 14 2020 20:54:53 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS GraphQLAPIKey AWS::AppSync::ApiKey        Mon Dec 14 2020 20:54:53 GMT+0000 (Coordinated Universal Time)                            
CREATE_COMPLETE    GraphQLAPI    AWS::AppSync::GraphQLApi    Mon Dec 14 2020 20:54:51 GMT+0000 (Coordinated Universal Time)                            
⠴ Updating resources in the cloud. This may take a few minutes...

UPDATE_COMPLETE AuthRole AWS::IAM::Role Mon Dec 14 2020 20:55:00 GMT+0000 (Coordinated Universal Time) 
⠸ Updating resources in the cloud. This may take a few minutes...

UPDATE_COMPLETE UnauthRole       AWS::IAM::Role  Mon Dec 14 2020 20:55:01 GMT+0000 (Coordinated Universal Time) 
UPDATE_COMPLETE DeploymentBucket AWS::S3::Bucket Mon Dec 14 2020 20:55:01 GMT+0000 (Coordinated Universal Time) 
⠏ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS Todo          AWS::CloudFormation::Stack  Mon Dec 14 2020 20:55:59 GMT+0000 (Coordinated Universal Time) 
CREATE_COMPLETE    GraphQLSchema AWS::AppSync::GraphQLSchema Mon Dec 14 2020 20:55:57 GMT+0000 (Coordinated Universal Time) 
⠏ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS Todo AWS::CloudFormation::Stack Mon Dec 14 2020 20:56:01 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
⠹ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS amplify-androidinit-dev-203547-apiandroidinit-3I5KGRMP54V7-Todo-2E3BFGC6ITYD AWS::CloudFormation::Stack Mon Dec 14 2020 20:56:01 GMT+0000 (Coordinated Universal Time) User Initiated
⠸ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS TodoIAMRole AWS::IAM::Role       Mon Dec 14 2020 20:56:10 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
CREATE_IN_PROGRESS TodoTable   AWS::DynamoDB::Table Mon Dec 14 2020 20:56:09 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
CREATE_IN_PROGRESS TodoTable   AWS::DynamoDB::Table Mon Dec 14 2020 20:56:09 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS TodoIAMRole AWS::IAM::Role       Mon Dec 14 2020 20:56:08 GMT+0000 (Coordinated Universal Time)                            
⠇ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE TodoIAMRole AWS::IAM::Role Mon Dec 14 2020 20:56:31 GMT+0000 (Coordinated Universal Time) 
⠴ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS TodoDataSource AWS::AppSync::DataSource Mon Dec 14 2020 20:56:34 GMT+0000 (Coordinated Universal Time) 
⠇ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS TodoDataSource AWS::AppSync::DataSource Mon Dec 14 2020 20:56:36 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
⠧ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS UpdateTodoResolver AWS::AppSync::Resolver   Mon Dec 14 2020 20:56:41 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
CREATE_COMPLETE    DeleteTodoResolver AWS::AppSync::Resolver   Mon Dec 14 2020 20:56:40 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS DeleteTodoResolver AWS::AppSync::Resolver   Mon Dec 14 2020 20:56:40 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
CREATE_COMPLETE    TodoTable          AWS::DynamoDB::Table     Mon Dec 14 2020 20:56:40 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS ListTodoResolver   AWS::AppSync::Resolver   Mon Dec 14 2020 20:56:39 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS CreateTodoResolver AWS::AppSync::Resolver   Mon Dec 14 2020 20:56:39 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS GetTodoResolver    AWS::AppSync::Resolver   Mon Dec 14 2020 20:56:39 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS UpdateTodoResolver AWS::AppSync::Resolver   Mon Dec 14 2020 20:56:38 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS DeleteTodoResolver AWS::AppSync::Resolver   Mon Dec 14 2020 20:56:38 GMT+0000 (Coordinated Universal Time)                            
CREATE_COMPLETE    TodoDataSource     AWS::AppSync::DataSource Mon Dec 14 2020 20:56:36 GMT+0000 (Coordinated Universal Time)                            
⠋ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE UpdateTodoResolver AWS::AppSync::Resolver Mon Dec 14 2020 20:56:41 GMT+0000 (Coordinated Universal Time) 
⠧ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE    GetTodoResolver    AWS::AppSync::Resolver Mon Dec 14 2020 20:56:44 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS GetTodoResolver    AWS::AppSync::Resolver Mon Dec 14 2020 20:56:44 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
CREATE_COMPLETE    CreateTodoResolver AWS::AppSync::Resolver Mon Dec 14 2020 20:56:43 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS CreateTodoResolver AWS::AppSync::Resolver Mon Dec 14 2020 20:56:43 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
CREATE_COMPLETE    ListTodoResolver   AWS::AppSync::Resolver Mon Dec 14 2020 20:56:42 GMT+0000 (Coordinated Universal Time)                            
CREATE_IN_PROGRESS ListTodoResolver   AWS::AppSync::Resolver Mon Dec 14 2020 20:56:41 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
⠴ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE Todo AWS::CloudFormation::Stack Mon Dec 14 2020 20:56:49 GMT+0000 (Coordinated Universal Time) 
⠴ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS CustomResourcesjson AWS::CloudFormation::Stack Mon Dec 14 2020 20:56:53 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
CREATE_IN_PROGRESS CustomResourcesjson AWS::CloudFormation::Stack Mon Dec 14 2020 20:56:51 GMT+0000 (Coordinated Universal Time)                            
⠧ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS amplify-androidinit-dev-203547-apiandroidinit-3I5KGRMP54V7-CustomResourcesjson-UT95KXOOJYKN AWS::CloudFormation::Stack Mon Dec 14 2020 20:56:53 GMT+0000 (Coordinated Universal Time) User Initiated
⠇ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE amplify-androidinit-dev-203547-apiandroidinit-3I5KGRMP54V7-CustomResourcesjson-UT95KXOOJYKN AWS::CloudFormation::Stack Mon Dec 14 2020 20:56:57 GMT+0000 (Coordinated Universal Time) 
⠦ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE CustomResourcesjson AWS::CloudFormation::Stack Mon Dec 14 2020 20:57:03 GMT+0000 (Coordinated Universal Time) 
⠇ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE amplify-androidinit-dev-203547-apiandroidinit-3I5KGRMP54V7 AWS::CloudFormation::Stack Mon Dec 14 2020 20:57:07 GMT+0000 (Coordinated Universal Time) 
⠧ Updating resources in the cloud. This may take a few minutes...

UPDATE_COMPLETE                     amplify-androidinit-dev-203547 AWS::CloudFormation::Stack Mon Dec 14 2020 20:57:25 GMT+0000 (Coordinated Universal Time) 
UPDATE_COMPLETE_CLEANUP_IN_PROGRESS amplify-androidinit-dev-203547 AWS::CloudFormation::Stack Mon Dec 14 2020 20:57:24 GMT+0000 (Coordinated Universal Time) 
CREATE_COMPLETE                     apiandroidinit                 AWS::CloudFormation::Stack Mon Dec 14 2020 20:57:21 GMT+0000 (Coordinated Universal Time) 
✔ Generated GraphQL operations successfully and saved at app/src/main/graphql/com/amazonaws/amplify/generated/graphql
✔ All resources are updated in the cloud

GraphQL endpoint: https://5r6kittrfbfuxmmjedgt33k6mm.appsync-api.ap-northeast-1.amazonaws.com/graphql
GraphQL API KEY: xxxxxxxxxxxxxxxxxxxxxxx

色々できた

このスクラップは2020/12/15にクローズされました