Giter Site home page Giter Site logo

aws-amplify / amplify-cli Goto Github PK

View Code? Open in Web Editor NEW
2.8K 137.0 812.0 275.76 MB

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.

License: Apache License 2.0

JavaScript 14.47% HTML 0.04% TypeScript 80.49% Python 0.15% Shell 0.92% CSS 0.07% Makefile 0.01% Lex 0.09% Yacc 0.11% Go 0.05% Java 0.05% Dockerfile 0.01% Dart 0.01% EJS 2.79% Swift 0.76% Ruby 0.01%
serverless web-development mobile-development aws fullstack cli authentication storage lambda-functions api

amplify-cli's Introduction

AWS Amplify

Discord Chat

Reporting Bugs/Feature Requests

Open Bugs Feature Requests Closed Issues

Tip

Preview: AWS Amplify's new code-first DX (Gen 2) for building backends

The next generation of Amplify's backend building experience with a TypeScript-first DX is now available in Preview. To learn more, please visit AWS Amplify (Gen 2).

To open a new issue related to Amplify's new backend building experience, please visit AWS Amplify Backend.

AWS Amplify CLI

The AWS Amplify CLI is a toolchain which includes a robust feature set for simplifying mobile and web application development. The CLI uses AWS CloudFormation and nested stacks to allow you to add or modify configurations locally before you push them for execution in your account.

Install the CLI

  • Requires Node.js® version 18 or later

Install and configure the Amplify CLI as follows:

$ npm install -g @aws-amplify/cli
$ amplify configure

Commands Summary

The Amplify CLI supports the commands shown in the following table.

Command Description
amplify configure Configures the AWS access credentials, AWS Region and sets up a new AWS User Profile
amplify init Initializes a new project, sets up deployment resources in the cloud and prepares your project for Amplify.
amplify configure project Updates configuration settings used to setup the project during the init step.
amplify add <category> Adds cloud features to your app.
amplify update <category> Updates existing cloud features in your app.
amplify push [--no-gql-override] Provisions cloud resources with the latest local developments. The 'no-gql-override' flag does not automatically compile your annotated GraphQL schema and will override your local AppSync resolvers and templates.
amplify pull Fetch upstream backend environment definition changes from the cloud and updates the local environment to match that definition.
amplify publish Runs amplify push, publishes a static assets to Amazon S3 and Amazon CloudFront (*hosting category is required).
amplify status [ <category>...] Displays the state of local resources that haven't been pushed to the cloud (Create/Update/Delete).
amplify status -v [ <category>...] Verbose mode - Shows the detailed verbose diff between local and deployed resources, including cloudformation-diff
amplify serve Runs amplify push, and then executes the project's start command to test run the client-side application.
amplify delete Deletes resources tied to the project.
amplify help | amplify <category> help Displays help for the core CLI.
amplify codegen add | generate Performs generation of strongly typed objects using a GraphQL schema.
amplify env add | list | remove | get | pull | import | checkout See the multienv docs.

Category specific commands:

Tutorials

Developing

To set up your local development environment, go to Local Environment Setup.

To test your category, do the following:

cd <your-test-front-end-project>
amplify-dev init
amplify-dev <your-category> <subcommand>

Before pushing code or sending a pull request, do the following:

  • At the command line, run yarn lint at the top-level directory. This invokes eslint to check for lint errors in all of our packages.
  • You can use yarn lint to find some of the lint errors. To attempt fix them, go to the package that has errors and run yarn lint-fix
  • If there are any remaining lint errors, resolve them manually. Linting your code is a best practice that ensures good code quality so it's important that you don't skip this step.

Contributing

We are thankful for any contributions from the community. Look at our Contribution Guidelines.

amplify-cli's People

Contributors

akshbhu avatar alharris-at avatar ammarkarachi avatar attilah avatar awsluja avatar cjihrig avatar danielleadams avatar dependabot[bot] avatar edwardfoyle avatar elorzafe avatar evcodes avatar goldbez avatar haverchuck avatar jhockett avatar johnpc avatar jordanranz avatar kateglee avatar kaustavghosh06 avatar lazpavel avatar mikeparisstuff avatar mlabieniec avatar nikhname avatar phani-srikar avatar sachscode avatar sdstolworthy avatar sobolk avatar sundersc avatar swaysway avatar unleashedmind avatar yuth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amplify-cli's Issues

Feature: Require to specify API Gateway's endpoint and actual api endpoint separately in Cognito(with AWS_IAM) in CloudFront + API Gateway(not edge optimized) situation

In case of authenticating by Cognito(with AWS_IAM) in CloudFront + API Gateway(not edge optimized), by the signature that created by Amplify cannot authenticate.
Because of the signature that created by Amplify made from Host and URL that were specified in endpoint.

In order to authenticate in CloudFront + API Gateway(not edge optimized), I must specifed the API Gateway's endpoint Host and URL for (Amplify's) signing parameter.
Examples of parameters are below.

  • API Endpoint Host: api.example.com
  • API Endpoint URL: /auth/api
  • API Gateway's endpoint Host: [random chars].execute-api.[region].amazonaws.com
  • API Gateway's endpoint Url: /Stage/auth/api
  • Amplifiy's endpoint: https://[API Endpoint Host]/[API Endpoint URL] <- https://api.example.com/auth/api
  • Host as signing parameter: [API Gateway's endpoint Host] <- [random chars].execute-api.[region].amazonaws.com
  • URL as signing parameter: [API Gateway's endpoint Url] <- /Stage/auth/api

Current version Amplify cannot specify API Endpoint and API Gateway's endpoint separately. So Authentication will be failed with following message.

message: "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."

Feature: Alternate signup method requires only email and sends temporary password

I would like to request a feature based off of AWS SDK JS:

https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentityServiceProvider.html#adminCreateUser-property

Basically, Cognito pool allows users to access certain things with unauth (unconfirmed) access. Ideally, this requires only signing up with an email (only email and no password), where they should receive an invitation email with a temporary password. This is considered an invitation and the user status is marked as FORCE_CHANGE_PASSWORD.

This works as expected if creating a user from within the admin console, but the default signup method for Amplify requires a password to be set. Can Amplify also allow the option to signup/invite user like the AdminCreateUser method?

Support for Flutter, Unity and Xamarin apps

This is a feature request. Please kindly support mobile apps developed using Flutter, Unity and Xamarin to use Amplify/Amplify CLI and AWS services. Specifically looking at using AppSync and Cognito in a Flutter project.

Amplify CLI doesn't support Federated Login

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

⠋ Initializing project in the cloud...An error occurred when creating the CloudFormation stack
✖ Root stack creation failed
init failed
{ InvalidClientTokenId: The security token included in the request is invalid.
    at Request.extractError (/Users/markw/.nvm/versions/node/v8.11.3/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/protocol/query.js:47:29)
...
  message: 'The security token included in the request is invalid.',
  code: 'InvalidClientTokenId',
  time: 2018-08-28T09:13:08.644Z,

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Steps to reproduce the issue:

  1. Log into a federated account and save your id/secret/token.
  2. 💥 🔥

What is the expected behavior?

Create a cloudformation stack.

Additional environment details

OSX 10.13.6 (17G65)

  • OS version (ie Windows 10 build X, macOS Sierra 10.12.6, etc.)
  • Output of amplify --version:
$ amplify --version
0.1.14
  • Did this work in previous versions?: Y/N

Deploy lambda to VPC.

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
There's no option to deploy a lambda into a VPC.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
When using the current function add functionality you are not promoted to place the function into a VPC.

What is the expected behavior?
Would be helpful to deploy to a VPC.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
0.1.14

IAM profile permissions

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Documentation around the permissions needed to run the cli

awsmobile push single function

Do you want to request a feature or report a bug?
Feature.
What is the current behavior?
awsmobile push command uploads all lambda functions. It actually does it all the time, whether or not things have changed.

What is the expected behavior?
Would be cool if you could specify the lambda function to push. Maybe:

awsmobile push cloud-api function-name

Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?
1.1.4

You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.
Not applicable.

'Amplify init' ignores AWS CLI specified named profile

Do you want to request a feature or report a bug? Bug

What is the current behavior?
I have the unified AWS CLI installed and configured with a 'default' and a 'burner' named profile. When specifying the name profile, the assets are provisioned using my 'default' profile credentials from a different account. My named profiles are setup here: ~/.aws/credentials on a MacBook Pro.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Reproduction:
$ amplify init
$ Do you want to use an AWS profile? Yes
$ Please choose the profile you want to use: burner
$ amplify push
Result: Resources provisioned in the wrong account

What is the expected behavior?
To provision AWS resources using the specified AWS named profile credentials.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
$ amplify --version
0.1.13

Projects do not appear in MobileHub

Do you want to request a feature or report a bug?
🐞

What is the current behavior?
Amplify projects created with the CLI do not appear in MobileHub

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

1. create-react-native sample-app
2. cd sample-app
3. amplify configure
4. amplify init
5. Check MobileHub in AWS Console

What is the expected behavior?

Project should appear in MobileHub console.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?

0.1.13

amplify init "type of app" doesn't actually allow selection Windows 10

Do you want to request a feature or report a bug? Bug

What is the current behavior?
When I do amplify init, it asks the first question about editor and I am able to select an editor. The next question about type of app I don't have a chance to answer. Note below that it looks like I picked javascript, but actually I just got my os prompt back

PS C:\Users\bradt\Documents\cs\react\my-amplify-app> amplify init
Note: It is recommended to run this command from the root of your app directory
? Choose your default editor: Visual Studio Code
? Choose the type of app that you're building (Use arrow keys)
  android
  ios
> javascript
PS C:\Users\bradt\Documents\cs\react\my-amplify-app>

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Run amplify init
  2. Select editor
  3. Notice no change to select type of app

What is the expected behavior?
Should be able to select app type

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?

Windows 10, latest version of Amplify CLI that gets installed (0.1.14)

Issue with amplify push and @searchable

Do you want to request a feature or report a bug? Bug

What is the current behavior? CFN Error (see bellow)

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

amplify add api with the schema bellow

What is the expected behavior? Successful CFN deployment

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?

Mac OS 10.13.6

amplify version
0.1.13

Getting this after adding @searchable to my schema.graphql file:

type Note @model @auth(rules: [{allow: owner}]) @searchable{
   id: ID!
   note: String!
}

Command output:

CREATE_FAILED      ElasticSearchStreamingLambdaIAMRole                      AWS::IAM::Role              Fri Aug 24 2018 12:09:06 GMT+1000 (AEST) 1 validation error detected: Value 'DynamoDBToElasticSearchFunctionIAMRole-3rcripkzmra7dgv7sguxtcbvpy' at 'roleName' failed to satisfy constraint: Member must have length less than or equal to64 (Service: AmazonIdentityManagement; Status Code: 400; Error Code: ValidationError; Request ID: ade4c087-a742-11e8-a308-3f93e4aa5764)
CREATE_FAILED      NoteTable                                                AWS::DynamoDB::Table        Fri Aug 24 2018 12:09:06 GMT+1000 (AEST) Resource creation cancelled
CREATE_FAILED      ElasticSearchAccessIAMRole                               AWS::IAM::Role              Fri Aug 24 2018 12:09:07 GMT+1000 (AEST) Resource creation cancelled
CREATE_FAILED      GraphQLAPIKey                                            AWS::AppSync::ApiKey        Fri Aug 24 2018 12:09:07 GMT+1000 (AEST) Resource creation cancelled
CREATE_FAILED      GraphQLSchema                                            AWS::AppSync::GraphQLSchema Fri Aug 24 2018 12:09:09 GMT+1000 (AEST) Resource creation cancelled
CREATE_FAILED      amplifynotes-20180824120309-apiamplifynotes-6TYPHPY4C6HP AWS::CloudFormation::Stack  Fri Aug 24 2018 12:09:10 GMT+1000 (AEST) The following resource(s) failed to create: [ElasticSearchStreamingLambdaIAMRole, ElasticSearchAccessIAMRole, GraphQLAPIKey, NoteTable, GraphQLSchema].
⠏ Updating resources in the cloud. This may take a few minutes...

CREATE_FAILED               apiamplifynotes             AWS::CloudFormation::Stack Fri Aug 24 2018 12:09:13 GMT+1000 (AEST) Embedded stack arn:aws:cloudformation:ap-southeast-2:244958302947:stack/amplifynotes-20180824120309-apiamplifynotes-6TYPHPY4C6HP/a43cac80-a742-11e8-b21f-503f2373503d was not successfully created: The following resource(s) failed to create: [ElasticSearchStreamingLambdaIAMRole, ElasticSearchAccessIAMRole, GraphQLAPIKey, NoteTable, GraphQLSchema].
UPDATE_ROLLBACK_IN_PROGRESS amplifynotes-20180824120309 AWS::CloudFormation::Stack Fri Aug 24 2018 12:09:13 GMT+1000 (AEST) The following resource(s) failed to create: [apiamplifynotes].
⠇ Updating resources in the cloud. This may take a few minutes...

Publish fails

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Running publish throws npm error

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
This is using an angularjs app.
ng build --prod or amplify publish

ERROR in node_modules/ionicons/dist/types/generated.d.ts(7,10): error TS2305: Module '"/Users/thejj/work/angular/projects/admin/node_modules/@stencil/core/dist/index"' has no exported member 'JSXElements'.
node_modules/@ionic/core/dist/types/utils/overlays.d.ts(9,82): error TS2344: Type 'keyof B' does not satisfy the constraint 'string'.
  Type 'string | number | symbol' is not assignable to type 'string'.
    Type 'number' is not assignable to type 'string'.

What is the expected behavior?
It should build successfully and publish to aws.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
0.1.14

Typo: GraphQL Transformer tutorial listBlog instead of listBlogs

Do you want to request a feature or report a bug?

What is the current behavior? bug

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Follow GraphQL Transform Tutorial and initialize a Blog post sample using Amplify CLI
  2. Create a graphql folder and create respective files to the sample queries
  3. When running amplify codegen generate you'll run into a ToolError from gluegun
    • ⠋ Generating.../graphql/Blog/queries/getAllBlogs.graphql: Cannot query field "listBlog" on type "Query". Did you mean "listBlogs" or "getBlog"?

There is a typo in the doc as the generated schema creates a query listBlogs and not listBlog.

What is the expected behavior?
Generate Api.ts correctly

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?

Amplify CLI: 0.1.14
OS: macOS Sierra

Issue installing via NPM

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

npm install -g @aws-amplify/cli

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/types@^7.0.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of '@babel/generator'
npm ERR! notarget

Steps to reproduce the issue:

npm install -g @aws-amplify/cli

What is the expected behavior?

A installation without errors

Additional environment details

Node version: v10.9.0
NPM version: 6.2.0

amplify api add (REST)

Do you want to request a feature or report a bug?
bug

What is the current behavior?
adds api model files to the ROOT/src/main/java

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Steps to reproduce the issue:
amplify api add

What is the expected behavior?
adds api model files to the ROOT/app/src/main/java

Additional environment details
env agnostic

  • OS version (ie Windows 10 build X, macOS Sierra 10.12.6, etc.) macOS Sierra
  • Output of amplify --version: 0.1.13
  • Did this work in previous versions?: N

Disabling cloud-api does not delete/remove the stack

Do you want to request a feature or report a bug?

BUG in version 1.1.4

What is the current behavior?

Deleting the cloud-api simply performs an UPDATE_STACK

What is the expected behavior?

Delete the stack.

With the comand:

? please confirm to disable: cloud-api Yes

Expected to delete all files, clean up everything...and run DELETE_STACK

The result was:

disabled: cloud-api
backend awsmobile project enabled features:
database, hosting, user-signin

MacBook-Pro-4:gorilla-tip-mobile-web jbarwick$ awsmobile push

checking the backend contents
generating backend project content
done
backend build artifacts are saved at:
/Users/jbarwick/Development/Gorilla Pit/gorilla-tip-mobile-web/awsmobilejs/.awsmobile/backend-build

preparing for backend project update: gorilla-tip-web
done

updating backend project: gorilla-tip-web
awsmobile api call successful
waiting for the cloud formation to complete
cloud-api update finished with status code: UPDATE_COMPLETE

Successfully updated the backend awsmobile project: gorilla-tip-web

The backend was NOT deleted.

npm install -g @aws-amplify/cli fails with errors

Do you want to request a feature or report a bug?
BUG

What is the current behavior?
When installing AWS Amplify CLI, it fails logging the following errors and warnings

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN deprecated [email protected]: 1.2.0 should have been a major version bump
npm ERR! path C:\Users\rafae\AppData\Roaming\npm\node_modules@aws-amplify\cli\node_modules\npm\node_modules\ansistyles
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\rafae\AppData\Roaming\npm\node_modules@aws-amplify\cli\node_modules\npm\node_modules\ansistyles' -> 'C:\Users\rafae\AppData\Roaming\npm\node_modules@aws-amplify\cli\node_modules\npm\node_modules.ansistyles.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\rafae\AppData\Roaming\npm-cache_logs\2018-08-27T10_51_24_414Z-debug.log

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
run the command > npm install -g @aws-amplify/cli

What is the expected behavior?
install the Amplify CLI with no errors

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
Trying to install the latest version available in npm, using Windows10

Running api function locally

Hi,

Good day.

Do you want to request a feature or report a bug?
feature

What is the current behavior?
You have to push push api changes to test them.

What is the expected behavior?
Would be cool if you could generate the required SAM template files to run an api function locally.

Regards.
JJ

Invoke lambda locally fails

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Calling invoke fails:

$ amplify function invoke TestFunction Get /items
Using service: Lambda, provided by: awscloudformation
? Provide the name of the script file that contains your handler function: index.js
? Provide the name of the handler function to invoke: handler
>> Local Npm module "grunt-aws-lambda" not found. Is it installed?
Warning: Task "lambda_invoke" not found. Use --force to continue.

Aborted due to warnings.

I've tried to install the missing package in both the function and the angular application itelf. Still does not work.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
I've been following the Angular guide to setup a basic application.

What is the expected behavior?
Execute the lambda function locally.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
0.1.13

Analytics.record not working

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Analytics.record not registering events in Pinpoint

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
I've reproduced twice. Here are the steps I took to reproduce on the web:

  1. create-react-app testing-analytics-app
  2. amplify init
  3. amplify add analytics
  4. Add Amplify configuration to the app
  5. Register event in the app:
onClick = () => {
    console.log("triggered click event")
    Analytics.record({
      name: 'button press from web'
    })
  }

What is the expected behavior?
Events show up in Pinpoint console

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
Amplify CLI: 0.1.13
OS: MacOS
Yes, this did work in previous versions

How to re-init existing project

I've already set up a project in github that uses Amplify cli to create an Auth service. However when I pull down the project on another computer, running init again seem to create a new project. With awsmobile, I could run awsmobile init my-project-id to set up the project on a new machine. How do I reuse the same setup [in this case, a specific Cognito service] when pulling down my project on another machine?

Another related question, if I already have an existing Cognito service that I created manually, how could I tell amplify-cli to use it for the auth service?

model transforms: support allow:authenticated in auth transform

Do you want to request a feature or report a bug?

FEATURE

What is the current behavior?

I cannot have a type that applies per mutation/query permissions to all authenticated users. If I specify any rules, they have to be owner or group-based.

What is the expected behavior?

I want to be able to write a schema where the owner can create/update/delete and any authenticated user can read. Example is a protected blog. Something like:

type Post @model
    @auth(rules: [
        { allow: owner },
        { allow: authenticated, queries: [ "get", "list" ], mutations: [] }
    ])
{
  // Fields here
}

Additional environment details

  • OS version: Mac OSX
  • Output of amplify --version: 0.1.13
  • Did this work in previous versions?: N

Adding a second 3rd party authentication providers in your identity pool

Do you want to request a feature or report a bug?
bug

What is the current behavior?
the second 3rd party authentication provider is not added to the identity pool

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

>amplify auth update

You have configured resources that might depend on this Cognito resource.  Updating this Cognito resource could have unintended side effects.

Using service: Cognito, provided by: awscloudformation
 The current configured provider is Amazon Cognito. 
 Do you want to use the default authentication and security configuration? No, I will set up my own configuration.
? Select the authentication/authorization services that you want to use: User Sign-Up, Sign-In, connected with AWS IAM controls (Enables per-user Storage features for images or other content, Analytics, and more)
? Allow unauthenticated logins? (Provides scoped down permissions that you can control via AWS IAM) Yes
? Do you want to enable 3rd party authentication providers in your identity pool? Yes
? Select the 3rd party authentication providers that you want to enable:  Facebook, Google
 
 You've opted to allow users to authenticate via Facebook.  If you haven't already, you'll need to go to https://developers.facebook.com and create an App ID. 
 Enter your Facebook App ID:  REDACTED
 
 You've opted to allow users to authenticate via Google.  If you haven't already, you'll need to go to https://developers.google.com/identity and create an App ID. 
 Enter your Google Web Client ID:  REDACTED
 
 You've opted to allow users to authenticate via Google within an Android project.  If you haven't already, you'll need to go to https://developers.google.com/identity and create an Android Client ID. 
 Enter your Google Android Client ID:  REDACTED
? Multifactor authentication (MFA) user login options: OFF
? Email based user registration/forgot password: Enabled (Requires per-user email entry at registration)
? Please specify an email verification subject: Your verification code
? Please specify an email verification message: Your verification code is {####}
? Do you want to override the default password policy for this User Pool? No
? Userpool users are created with a standard set of attributes defined by the OpenID Connect specification.  Mark the required attributes below: 
? Specify the app's refresh token expiration period (in days): 30
? Do you want to specify the user attributes this app can read and write? No

Successfully updated resource cognitoae977c65 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

>amplify push
| Category  | Resource name   | Operation | Provider plugin   |
| --------- | --------------- | --------- | ----------------- |
| Auth      | cognitoae977c65 | Update    | awscloudformation |
| Analytics | cli3            | No Change | awscloudformation |
? Are you sure you want to continue? true
⠧ Updating resources in the cloud. This may take a few minutes...

UPDATE_IN_PROGRESS cli3-20180824131246 AWS::CloudFormation::Stack Fri Aug 24 2018 16:28:15 GMT-0700 (PDT) User Initiated
UPDATE_IN_PROGRESS authcognitoae977c65 AWS::CloudFormation::Stack Fri Aug 24 2018 16:28:19 GMT-0700 (PDT)               
UPDATE_IN_PROGRESS analyticscli3       AWS::CloudFormation::Stack Fri Aug 24 2018 16:28:19 GMT-0700 (PDT)               
UPDATE_COMPLETE    analyticscli3       AWS::CloudFormation::Stack Fri Aug 24 2018 16:28:20 GMT-0700 (PDT)               
⠼ Updating resources in the cloud. This may take a few minutes...

UPDATE_IN_PROGRESS cli3-20180824131246-authcognitoae977c65-13XS5ZTY68NDM AWS::CloudFormation::Stack Fri Aug 24 2018 16:28:19 GMT-0700 (PDT) User Initiated
⠴ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS OpenIdLambdaRole AWS::IAM::Role Fri Aug 24 2018 16:28:26 GMT-0700 (PDT)                            
CREATE_IN_PROGRESS OpenIdLambdaRole AWS::IAM::Role Fri Aug 24 2018 16:28:26 GMT-0700 (PDT) Resource creation Initiated
⠴ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE    OpenIdLambdaRole      AWS::IAM::Role        Fri Aug 24 2018 16:28:37 GMT-0700 (PDT)                            
CREATE_IN_PROGRESS OpenIdLambda          AWS::Lambda::Function Fri Aug 24 2018 16:28:40 GMT-0700 (PDT)                            
CREATE_IN_PROGRESS OpenIdLambda          AWS::Lambda::Function Fri Aug 24 2018 16:28:40 GMT-0700 (PDT) Resource creation Initiated
CREATE_COMPLETE    OpenIdLambda          AWS::Lambda::Function Fri Aug 24 2018 16:28:41 GMT-0700 (PDT)                            
CREATE_IN_PROGRESS OpenIdLambdaIAMPolicy AWS::IAM::Policy      Fri Aug 24 2018 16:28:44 GMT-0700 (PDT)                            
CREATE_IN_PROGRESS OpenIdLambdaIAMPolicy AWS::IAM::Policy      Fri Aug 24 2018 16:28:45 GMT-0700 (PDT) Resource creation Initiated
⠼ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE    OpenIdLambdaIAMPolicy AWS::IAM::Policy Fri Aug 24 2018 16:28:49 GMT-0700 (PDT)                            
CREATE_IN_PROGRESS OpenIdLogPolicy       AWS::IAM::Policy Fri Aug 24 2018 16:28:52 GMT-0700 (PDT)                            
CREATE_IN_PROGRESS OpenIdLogPolicy       AWS::IAM::Policy Fri Aug 24 2018 16:28:53 GMT-0700 (PDT) Resource creation Initiated
⠸ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE    OpenIdLogPolicy    AWS::IAM::Policy      Fri Aug 24 2018 16:28:57 GMT-0700 (PDT) 
CREATE_IN_PROGRESS OpenIdLambdaInputs Custom::LambdaCallout Fri Aug 24 2018 16:29:00 GMT-0700 (PDT) 
⠼ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS OpenIdLambdaInputs Custom::LambdaCallout      Fri Aug 24 2018 16:29:06 GMT-0700 (PDT) Resource creation Initiated
CREATE_COMPLETE    OpenIdLambdaInputs Custom::LambdaCallout      Fri Aug 24 2018 16:29:06 GMT-0700 (PDT)                            
UPDATE_IN_PROGRESS IdentityPool       AWS::Cognito::IdentityPool Fri Aug 24 2018 16:29:10 GMT-0700 (PDT)                            
UPDATE_COMPLETE    IdentityPool       AWS::Cognito::IdentityPool Fri Aug 24 2018 16:29:12 GMT-0700 (PDT)                            
⠴ Updating resources in the cloud. This may take a few minutes...

UPDATE_COMPLETE_CLEANUP_IN_PROGRESS cli3-20180824131246-authcognitoae977c65-13XS5ZTY68NDM AWS::CloudFormation::Stack Fri Aug 24 2018 16:29:22 GMT-0700 (PDT) 
⠼ Updating resources in the cloud. This may take a few minutes...

UPDATE_COMPLETE                     authcognitoae977c65                                   AWS::CloudFormation::Stack Fri Aug 24 2018 16:29:38 GMT-0700 (PDT) 
UPDATE_COMPLETE_CLEANUP_IN_PROGRESS cli3-20180824131246                                   AWS::CloudFormation::Stack Fri Aug 24 2018 16:29:40 GMT-0700 (PDT) 
UPDATE_IN_PROGRESS                  analyticscli3                                         AWS::CloudFormation::Stack Fri Aug 24 2018 16:29:42 GMT-0700 (PDT) 
UPDATE_IN_PROGRESS                  authcognitoae977c65                                   AWS::CloudFormation::Stack Fri Aug 24 2018 16:29:42 GMT-0700 (PDT) 
UPDATE_COMPLETE                     analyticscli3                                         AWS::CloudFormation::Stack Fri Aug 24 2018 16:29:42 GMT-0700 (PDT) 
UPDATE_COMPLETE                     cli3-20180824131246-authcognitoae977c65-13XS5ZTY68NDM AWS::CloudFormation::Stack Fri Aug 24 2018 16:29:43 GMT-0700 (PDT) 
⠹ Updating resources in the cloud. This may take a few minutes...

UPDATE_COMPLETE authcognitoae977c65 AWS::CloudFormation::Stack Fri Aug 24 2018 16:29:52 GMT-0700 (PDT) 
UPDATE_COMPLETE cli3-20180824131246 AWS::CloudFormation::Stack Fri Aug 24 2018 16:29:53 GMT-0700 (PDT) 
⠴ Updating resources in the cloud. This may take a few minutes...

✔ All resources are updated in the cloud

What is the expected behavior?
Add the provider

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
mac sierra
npm -v
n5.6.0
node -v
v8.11.3

Cannot add auth - command not found

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Attempting to run
amplify auth add
returns a "Command not found" error, with the suggestion:
amplify auth <subcommands>
add [......]

Attempting to run
amplify add auth (inverting 'auth' and 'add') produces the same outcome

On the off chance, I also tried
amplify add authentication,
but this triggered the analytics flow. Analytics seems to be the default? (Running amplify add anything also triggered the analytics flow).

Taking a brief look at the code, it looks like Auth is structured very differently to the other modules. There is no "auth/add.js" file in the commands folder, but rather, the add command is listed in the index.js two levels up. (The index.js also looks substantially different to other commands). It seems like maybe it got missed in a code restructure?

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

See above.

What is the expected behavior?

Running amplify auth add should start the wizard process to create a cognito user store.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?

Amplify version: 0.1.14 (This is the first version I have used, but I assume this worked previously)
Node version: 8.11.4
NPM version: 5.6.0
OS: Windows 10 (Powershell)

Specify Lambda IAM role

Do you want to request a feature or report a bug?
Feature.

What is the current behavior?
A new IAM role is generated for each lambda function.

What is the expected behavior?
Allowed to pass the name of an IAM role to reuse in lambda functions.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
0.1.14

When performing 'awsmobile push' the process publishes the previous version, not the current.

Do you want to request a feature or report a bug?

BUG in Version 1.1.4

What is the current behavior?

when performing awsmobile 'push', the backend deploys the previous version. Not the newly generated version. (cloud-api)

What is the expected behavior?

Regardless of the state of the backend service (cloud-api), the awsmobile 'push' command should publish the current zipped version. Not the previous version.

Reproduce:

Step1) Go to your deployments S3 bucket. Delete all the files.
Step2) Go to the .awsmobile/build-info and delete all the zip files in there.
Step3) Open mobile-hub-project.yml...don't change anything...just note the upload file name.
Step4) Run awsmobile 'push'. It will zip up all of your backend api
Step5) Wait. Wait. Wait more...then note the ERROR statement. "cannot find artifiact upload/xxxxx"
Step6) notice that the upload/xxxxx was the name from the Step3 above
Step7) Open the mobile-hub-project.yml and note the upload name. You will note the name is the same as in the .awsmobile/build-info directory. Good!
Step8) Go to the .awsmobile/build-info folder and rename all the files to the OLD PREVIOUS version number.
Step9) Manually upload all files to S3 deployment uploads folder
Step10) type awsmobile 'push'...Voila! Worked!

This tells me that the CloudFormation UPDATE command is being executed BEFORE the new mobile-hub-project.yml is being processed and updated in the MobileHub console.

An example of this is:

MacBook-Pro-4:cloud-api jbarwick$ awsmobile push

checking the backend contents
   building cloud-api
      zipping contact
      zipping help
      zipping info
      zipping team
   done
   generating backend project content
   done
backend build artifacts are saved at:
/Users/jbarwick/Development/Gorilla Pit/gorilla-tip-web/awsmobilejs/.awsmobile/backend-build

preparing for backend project update: gorilla-tip-web
   uploading help-20180704215912.zip
   uploading info-20180704215912.zip
   uploading team-20180704215912.zip
   uploading contact-20180704215912.zip
   upload Successful  info-20180704215912.zip
   upload Successful  team-20180704215912.zip
   upload Successful  contact-20180704215912.zip
   upload Successful  help-20180704215912.zip
done

updating backend project: gorilla-tip-web
Failed to update project gorilla-tip-web
{ BadRequestException: Unable to find build artifact uploads/contact-20180704213422.zip in S3 bucket gorillatipweb-deployments-mobilehub-417008146 for API function contact
    at Object.extractError (/usr/local/lib/node_modules/awsmobile-cli/node_modules/aws-sdk/lib/protocol/json.js:48:27)
    at Request.extractError (/usr/local/lib/node_modules/awsmobile-cli/node_modules/aws-sdk/lib/protocol/rest_json.js:52:8)
    at Request.callListeners (/usr/local/lib/node_modules/awsmobile-cli/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/usr/local/lib/node_modules/awsmobile-cli/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/usr/local/lib/node_modules/awsmobile-cli/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/usr/local/lib/node_modules/awsmobile-cli/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/awsmobile-cli/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /usr/local/lib/node_modules/awsmobile-cli/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/usr/local/lib/node_modules/awsmobile-cli/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/usr/local/lib/node_modules/awsmobile-cli/node_modules/aws-sdk/lib/request.js:685:12)
  message: 'Unable to find build artifact uploads/contact-20180704213422.zip in S3 bucket gorillatipweb-deployments-mobilehub-417008146 for API function contact',
  code: 'BadRequestException',
  time: 2018-07-04T14:00:39.213Z,
  requestId: '90534b94-7086-4819-84e6-31033a7ac33b',
  statusCode: 400,
  retryable: false,
  retryDelay: 2.573201891959176 }

Auth configuration workflow misleadingly allows TOTP-only selection

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Auth enable flow always enables SMS MFA even when TOTP only is selected.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Enable auth
  2. Select TOTP only
  3. Amplify Push
  4. Check user pool - see that SMS is selected.

What is the expected behavior?
User should be able to select totp only

aws-exports.js is not created when running amplify init

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
amplify init is supposed to create an aws-exports.js file according to Getting started instructions

I don't see the file

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Open WSL Ubunutu (amplify init is currently broken in native Windows. See #34)
  2. Create a react app
  3. In react app directory, run amplify init answering all of the prompts
  4. Note that an aws-exports.js file is not created

What is the expected behavior?
aws-exports.js file created

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
Windows 10 with WSL
Amplify 0.1.14

Profiles example.

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
I can't find a detailed list of what IAM permissions to assign when using profiles. Currently I've just assigned full permissions to the resources as they failed during a publish.

Or does it just need a power user? Thanks.

Regards.
JJ

ModelConnectionTransformer does not create filter inputs on fields

Version: 0.1.13

Simple Schema:

type Post @model {
	id: ID!
	things: [Thing!] @connection
}

type Thing @model(queries: null, mutations: null) {
	id: ID!
}

Generates:

type Post {
  id: ID!
  things(filter: ModelThingFilterInput, sortDirection: ModelSortDirection, limit: Int, nextToken: String): ModelThingConnection
}

however, ModelThingFilterInput is not generated.

In this case due to @model declation on Thing, the listThings function is not created and generateFilterInputs is not called for Thing (i.e.: this bug is masked by the fact that the filter can be created for other fields). In ModelConnectionTransformer, I think there is a typo/bug:

should be:

this.generateFilterInputs(ctx, returnType)

amplify api gql-compile: Docs improvement suggestion

Right now, the docs on what the amplify api gql-compilecommand does are a little sparse.

From https://github.com/aws-amplify/amplify-cli/blob/master/packages/amplify-category-api/Readme.md

Compiles your GraphQL schema and generates a corresponding cloudformation template.

I'd love a bit more content here describing how updates to an existing and already-pushed schema behave. For example, if I add a new @model type to my schema, does it create a new datasource and resolvers just for that new type?

'amplify configure' not working on windows (cmd.exe)

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Running 'amplify configure' returns "Error: you are not working inside a valid amplify project"

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Create an empty folder
  2. Run 'amplify configure'
  3. See the above error

What is the expected behavior?
It should work properly on an empty folder. It should not require an amplify project.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
npm installed the latest version of the CLI as of 8/24/2018. Running on Windows 10.

ModelAuthTransformer assumes all queries and mutations are defined

Do you want to request a feature or report a bug?

bug

What is the current behavior?

TypeError: Cannot read property 'Properties' of undefined, at ModelAuthTransformer.protectUpdateOrDeleteMutation (xxxxxxx/amplify-cli/packages/graphql-auth-transformer/src/ModelAuthTransformer.ts:327:59)

Steps to reproduce the issue:

  1. create a model that only defines some mutations/queries
type Post
  @model(mutations: { create: "createPost" })
  @auth(rules: [{ allow: owner }]) {
}
  1. amplify api gql-compile

What is the expected behavior?

should not return an error. if a resolver does not exist, should not try to modify it. simply skip it.
following could be added/modified in the "protect" functions:

        const resolver = ctx.getResource(resolverResourceId)
        if (!rules || rules.length === 0 || !resolver) {
            return
        }

Additional environment details

  • OS version (ie Windows 10 build X, macOS Sierra 10.12.6, etc.) mac
  • Output of amplify --version: 0.1.13
  • Did this work in previous versions?: N

'amplify init' does not generate aws-exports.js

Do you want to request a feature or report a bug? Bug

What is the current behavior?
Following AWS Amplify Getting started guide for react-native, after step 4 which is amplify init, this command completes successfully without generating an aws-exports.js file in the source folder nor anywhere.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?
Expect aws-exports.js to be generated.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
Amplify CLI 0.1.14
Node v10.2.0

Previously worked with awsmobile init

Also, noticed that if I run amplify configure project while switching type of app [android, ios, javascript] then I do successfully get an aws-exports.js in my source folder. But the content is rather lacking.

Allow specifying strategy to implement @model id

Do you want to request a feature or report a bug?

Feature Request

What is the current behavior?

currently when using @model, resolver for create mutation sets id to $util.autoId().
There are situations where this is not wanted. e.g.: we may want to use the current user identity information as the ID (use case: build user setting store).

could the directive be updated to something like this:

directive @model(
    id: idStrategy
    queries: ModelQueryMap,
    mutations: ModelMutationMap,
    subscriptions: ModelSubscriptionMap
) on OBJECT
enum idStrategy {auto sub username cognitoIdentityId}
input ModelMutationMap { create: String, update: String, delete: String }
input ModelQueryMap { get: String, list: String }
input ModelSubscriptionMap {
    onCreate: [String]
    onUpdate: [String]
    onDelete: [String]
}

where:

auto: util.autoId()
sub: ctx.identity.sub
username: ctx.identity.username
cognitoIdentityId: ctx.identity.cognitoIdentityId

with auto as the default

Running lamda functions locally.

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Invoking a lambda function returns a 404.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
This is the output I get:

$ amplify function invoke TestingBackend GET /items
Using service: Lambda, provided by: awscloudformation
? Provide the name of the script file that contains your handler function: index.js
? Provide the name of the handler function to invoke: handler
Running "lambda_invoke:default" (lambda_invoke) task

EVENT: {"key1":"value1","key2":"value2","key3":"value3"}
App started
EADDRINUSE /tmp/server0.sock incrementing socketPathSuffix.
EADDRINUSE /tmp/server1.sock incrementing socketPathSuffix.
EADDRINUSE /tmp/server2.sock incrementing socketPathSuffix.

Success!  Message:
------------------
{"statusCode":404,"body":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot GET /</pre>\n</body>\n</html>\n","headers":{"x-powered-by":"Express","access-control-allow-origin":"*","access-control-allow-headers":"Origin, X-Requested-With, Content-Type, Accept","content-security-policy":"default-src 'self'","x-content-type-options":"nosniff","content-type":"text/html; charset=utf-8","content-length":"139","date":"Sun, 26 Aug 2018 10:55:57 GMT","connection":"close"},"isBase64Encoded":false}

Done.
Done running invoke function.

What is the expected behavior?
The response should not be a 404 but a 200 with api gateway event.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
0.1.14

This is basically a follow on of #10.

Error when running amplify codegen add

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Error is thrown:

? Enter the file name pattern of graphql queries, mutation and subscriptions graphql/**/*.graphql
? Choose the code generation language target typescript
? Enter the file name for the generated code API.ts
? Do you want to generate code Yes
✔ Downloaded the schema
✔ code generated successfully and saved in file API.ts
⠧ Downloading the introspection schemavvv -----[ DEBUG ]----- vvv
{ NotFoundException: GraphQL API clpp5lckabgz7pg3vgkfmen5r4 not found.
    at Object.extractError (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/protocol/json.js:48:27)
    at Request.extractError (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/protocol/rest_json.js:52:8)
    at Request.callListeners (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:685:12)
  message: 'GraphQL API clpp5lckabgz7pg3vgkfmen5r4 not found.',
  code: 'NotFoundException',
  time: 2018-08-27T21:25:44.399Z,
  requestId: 'c18e25cd-aa3f-11e8-a748-97f03f6dd468',
  statusCode: 404,
  retryable: false,
  retryDelay: 80.31176542355047 }
^^^ -----[ DEBUG ]----- ^^^
2018-08-27T21:25:44.410Z - error: uncaughtException: Argument "data" passed to write(path, data, [options]) must be a string or a buffer or an object or an array. Received undefined date=Mon Aug 27 2018 14:25:44 GMT-0700 (PDT), pid=65821, uid=1070061038, gid=1896053708, cwd=/Users/dabit/temp/delete/NewAmplifyRNApp, execPath=/Users/dabit/.nvm/versions/node/v9.4.0/bin/node, version=v9.4.0, argv=[/Users/dabit/.nvm/versions/node/v9.4.0/bin/node, /Users/dabit/.nvm/versions/node/v9.4.0/bin/amplify, codegen, add], rss=129445888, heapTotal=102473728, heapUsed=66811272, external=937194, loadavg=[2.8505859375, 2.796875, 3.25048828125], uptime=340092, trace=[column=11, file=/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/fs-jetpack/lib/utils/validate.js, function=Object.validateArgument [as argument], line=109, method=validateArgument [as argument], native=false, column=12, file=/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/fs-jetpack/lib/write.js, function=Object.validateInput, line=11, method=validateInput, native=false, column=13, file=/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/fs-jetpack/lib/jetpack.js, function=Object.write, line=225, method=write, native=false, column=11, file=/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen/src/utils/downloadIntrospectionSchema.js, function=downloadIntrospectionSchema, line=16, method=null, native=false, column=null, file=null, function=null, line=null, method=null, native=false, column=7, file=internal/process/next_tick.js, function=process._tickCallback, line=160, method=_tickCallback, native=false], stack=[Error: Argument "data" passed to write(path, data, [options]) must be a string or a buffer or an object or an array. Received undefined,     at Object.validateArgument [as argument] (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/fs-jetpack/lib/utils/validate.js:109:11),     at Object.validateInput (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/fs-jetpack/lib/write.js:11:12),     at Object.write (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/fs-jetpack/lib/jetpack.js:225:13),     at downloadIntrospectionSchema (/Users/dabit/.nvm/versions/node/v9.4.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen/src/utils/downloadIntrospectionSchema.js:16:11),     at <anonymous>,     at process._tickCallback (internal/process/next_tick.js:160:7)]

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Steps to reproduce the issue:

  1. Create Amplify project
  2. Add GraphQL API using Amplify CLI
  3. Create the following queries & mutations:
// graphql/mutations/createPerson.graphql
mutation createPerson($name: String!, $age: Int, $description: String) {
  createPerson(input: {
    name: $name
    age: $age
    description: $description
  }) {
    id
    name
    age
    description
  }
}

// graphql/queries/listPeople.graphql
query listPeople {
  listPersons {
    items {
      id
      name
      description
    }
  }
}
  1. Run amplify codegen add

What is the expected behavior?
Typed API.ts is created with no error

What is actual behavior?
Typed API.ts file gets created with the following (but above error is thrown):

/* tslint:disable */
//  This file was automatically generated and should not be edited.

export type createPersonMutationVariables = {
  name: string,
  age?: number | null,
  description?: string | null,
};

export type createPersonMutation = {
  createPerson:  {
    __typename: "Person",
    id: string,
    name: string,
    age: number | null,
    description: string | null,
  } | null,
};

export type listPeopleQuery = {
  listPersons:  {
    __typename: "ModelPersonConnection",
    items:  Array< {
      __typename: "Person",
      id: string,
      name: string,
      description: string | null,
    } | null > | null,
  } | null,
};

Additional environment details

  • OS version (ie Windows 10 build X, macOS Sierra 10.12.6, etc.)
    Mac OS Sierra 10.12.6
  • Output of amplify --version:
    0.1.14
  • Did this work in previous versions?: Y/N
    Not sure

amplify delete does not remove S3 deployment bucket

Do you want to request a feature or report a bug?

A bug.

What is the current behavior?

Issuing "amplify delete" command does not remove the S3 deployment bucket.

What is the expected behavior?

If the removal of the S3 deployment bucket can not be done due to limitation of S3 and/or CloudFormation, it would be useful for "amplify delete" to list out those resources not removed by the command.

  • Output of amplify --version:

0.1.14

Support for multiple buckets?

In the documentation examples:

Amplify.configure(
    Auth: {
        identityPoolId: 'XX-XXXX-X:XXXXXXXX-XXXX-1234-abcd-1234567890ab', //REQUIRED - Amazon Cognito Identity Pool ID
        region: 'XX-XXXX-X', // REQUIRED - Amazon Cognito Region
        userPoolId: 'XX-XXXX-X_abcd1234', //OPTIONAL - Amazon Cognito User Pool ID
        userPoolWebClientId: 'XX-XXXX-X_abcd1234', //OPTIONAL - Amazon Cognito Web Client ID
    },
    Storage: {
        bucket: '', //REQUIRED -  Amazon S3 bucket
        region: 'XX-XXXX-X', //OPTIONAL -  Amazon service region
    });

What if the web app needs to interact with more than one bucket? It would be nice to have a system where we could specify several and interact with them via their names.

    Storage: {
      bucketOne: {
        bucket: '', //REQUIRED -  Amazon S3 bucket
        region: 'XX-XXXX-X', //OPTIONAL -  Amazon service region
      },
      bucketTwo: { ... }
    });

Cloudformation Parameter Limit AppSync

Amplify CLI version: 0.1.13
OS: macOS 10.13.6

Any non-trivial AppSync application will have may have more than 60 parameters added to the nested api stack, which is beyond the limits of CloudFormation and causing amplify push to fail.

Cannot Attach to Backend

When I pull from GitHub to a new machine I get errors when doing commands such as:
awsmobile pull
awsmobile console
Where I receive:
backend awsmobile project unknown

Attempting to do:
awsmobile init
Gives an Invalid Signature error

Any ideas?

Need To Choose AWS Region

This is my first time with Amplify and first time setting up Cognito. I have Cognito setup but wanted to add Amplify to my Angular app. I went through the setup process but CloudFormation was created in the wrong region and I couldn't find a way to change this.

Do you want to request a feature or report a bug?

Bug?

What is the current behavior?

Setup in the docs for Getting Started and Angular assumed that my setup is in us-west-2 but I'm using us-west-1. Cognito is in us-west-2 because it is not available yet in Norcal but will be moved there when possible. The setup process created a mess. Not sure aws-amplify is usable without the CloudFormation setup. If there is a way to pass up using CloudFormation that isn't obvious in the setup.

What is the expected behavior?

Let users choose their region and it may not be the same for Cognito and S3. Let us choose existing buckets. Or modify the docs and setup process to make CF optional.

Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?

I know nothing of previous versions. Installed 1.0.6 plus angular 1.0.3. Browser / OS doesn't matter.

How to clone project with amplify? With Appsync?

This seems very undocumented and I am a bit confused. I am trying to get another developer going on this project. This is what I have done so far:

  1. I push code to git relying on default generated .gitignore
  2. Other developer pulls git repo.
  3. Other developer runs awsmobile init mobilehubid

That completes rather successfully except that.

  1. It does NOT configure Appsync. The aws-exports.js generated is devoid of appsync settings. The appsync-info.json is also devoid of information it just says:
{
    "freshLocalEnableDisableFlag": "enable"
}
  1. It generates an extra folder I don't understand. In my project I have just "awsmobilejs". But when running awsmobile init mobilebudid on the freshly cloned project it generates a folder called "~awsmobilejs-2018-08-07-14-12-57" What is the purpose of this extra folder? Is that correct?

What is the proper method to clone a repo to a new machine and have awsmobile cli set up? How do I get appsync set up in that project as well? What is the extra folder with ~ and the date for?

Thank you.

CLI doesn't display options when prompted

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
When I enter amplify configure the prompt implies that I should see options to select from, but they're not displayed.
screenshot from 2018-08-23 20-25-52

When I enter amplify init I'm given at least one option, but when I select something I'm no longer given options. When I hit enter a second time, I'm given an error.
screenshot from 2018-08-23 20-26-18
screenshot from 2018-08-23 20-26-36
screenshot from 2018-08-23 20-30-21

The full error is here:

readline.js:1032
            throw err;
            ^

TypeError: Cannot read property 'value' of undefined
    at Prompt.getCurrentValue (/home/ryan/.config/yarn/global/node_modules/inquirer/lib/prompts/list.js:126:51)
    at tryCatcher (/home/ryan/.config/yarn/global/node_modules/rx-lite/rx.lite.js:67:31)
    at InnerObserver.next (/home/ryan/.config/yarn/global/node_modules/rx-lite/rx.lite.js:4495:43)
    at InnerObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/ryan/.config/yarn/global/node_modules/rx-lite/rx.lite.js:1602:31)
    at InnerObserver.tryCatcher (/home/ryan/.config/yarn/global/node_modules/rx-lite/rx.lite.js:67:31)
    at AutoDetachObserverPrototype.next (/home/ryan/.config/yarn/global/node_modules/rx-lite/rx.lite.js:6495:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/ryan/.config/yarn/global/node_modules/rx-lite/rx.lite.js:1602:31)
    at TakeObserver.next (/home/ryan/.config/yarn/global/node_modules/rx-lite/rx.lite.js:4681:17)
    at TakeObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/ryan/.config/yarn/global/node_modules/rx-lite/rx.lite.js:1602:31)
    at TakeObserver.tryCatcher (/home/ryan/.config/yarn/global/node_modules/rx-lite/rx.lite.js:67:31)

What is the expected behavior?
That it should display options.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?

Amplify CLI: 0.1.13
OS: Linux Mint 19
Terminal: zsh (tried it on bash, behaves the same way)
Installed with Yarn

amplify notifications add fails

Do you want to request a feature or report a bug?

  • bug

What is the current behavior?

  • cannot add apns notifications

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?

  • I should be able to add apns notifications

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?

Latest version of cli.

commands used:
amplify notifications add

Logs:

➜  NotesAppWithPushNotifications git:(master) ✗ amplify notifications add
? Choose the push notification channel to enable. APNS
Successfully created Pinpoint app: NotesPushNotif
? Choose authentication method used for APNs Certificate
? The certificate file path (.p12):  Certificate.p12
? The certificate password (if any):
MAC verified OK
update channel error
2018-08-25T00:04:58.136Z - error: uncaughtException: Missing credentials

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.