You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.
Have an existing API in API Gateway. Mine is created with CloudFormation, using C# Lambdas for integration.
In awsmobile features, user-signin and hosting are enabled, but notably cloud-api is NOT enabled. (I disabled analytics because it kept clogging the console with errors).
Reproducing
Using the MobileHub console in the CloudLogic service, use the Import existing API feature to import your existing API.
Following the instructions in the MobileHub Integrate wizard, execute the awsmobile pull command.
View the aws-exports.js file and confirm that the aws_cloud_logic value is set to enable and the aws_cloud_logic_custom field contains a list of information about your imported API:
let apiName = 'Some API';
let path = '/stuff';
let myInit = {
headers: {}
}
API.get(apiName, path, myInit).then(response => { console.log(response.body); });
5a. Now that you are done coding, execute awsmobile run.
6a. See the following error:
BadRequestException: Your AWS CloudFormation stack is busy being updated. Please retry your request in a few minutes. Current stack state is DELETE_IN_PROGRESS.
7a. Return to the MobileHub/Cloud Logic console, refresh, and confirm that Your API(s) have been deleted. The CloudFormation stack that integrated with your imported API is now gone.
8a. View aws-exports.js and note the aws_cloud_logic* attributes are gone.
Fork 2: Try to be smarter than the instructions
4b. Instead of just coding and then running, let's try running awsmobile cloud-api enable locally first.
5b. Confirm the aws_cloud_logic* variables are unchanged in the aws-exports.js file.
6b. Code as in Fork 1, if necessary, although your code should still be there.
7b. Now execute awsmobile run.
8b. Note the zipping sampleLambda step under building cloud-api.
9b. Note various CloudFormation states pass by on the status check line.
10b. Eventually, the application starts.
11b. Return to the MobileHub/Cloud Logic console, refresh, and confirm that your imported API is now deleted. The sampleCloudAPI provided by awsmobile cloud-api enable should be present.
12b. View aws-exports.js and note the aws_cloud_logic* attributes are gone.
Conclusion
It appears that no matter what I do, it is not possible to execute an awsmobile run with an imported API in Cloud Logic. It is also worth noting that in both cases, the code (similar to what is shown) generates the following error: API no configured
Edit: Environment
I am using a MacOS High Sierra workstation with current Homebrew packages for node/npm etc.
The text was updated successfully, but these errors were encountered:
Hi @domZippilli this issue should be fix on 1.0.7 version. I try to reproduce the same you did and the cli is checking before run (or push) the latest change and showing warning message in case you want to overwrite you project configuration.
When you import an api on your mobilehub project you need to wait for the message "Your API(s) have been deployed." before calling awsmobile pull
Prerequisites
awsmobile features
,user-signin
andhosting
are enabled, but notablycloud-api
is NOT enabled. (I disabled analytics because it kept clogging the console with errors).Reproducing
awsmobile pull
command.aws-exports.js
file and confirm that theaws_cloud_logic
value is set toenable
and theaws_cloud_logic_custom
field contains a list of information about your imported API:Fork 1: Follow the instructions
4a. The Integrate wizard next guides you here: https://docs.aws.amazon.com/aws-mobile/latest/developerguide/web-access-apis.html#connect-to-your-backend which, reading from the anchor, suggests you are ready to start coding. So, add some code, if desired.
5a. Now that you are done coding, execute
awsmobile run
.6a. See the following error:
7a. Return to the MobileHub/Cloud Logic console, refresh, and confirm that
Your API(s) have been deleted.
The CloudFormation stack that integrated with your imported API is now gone.8a. View
aws-exports.js
and note theaws_cloud_logic*
attributes are gone.Fork 2: Try to be smarter than the instructions
4b. Instead of just coding and then running, let's try running
awsmobile cloud-api enable
locally first.5b. Confirm the
aws_cloud_logic*
variables are unchanged in theaws-exports.js
file.6b. Code as in Fork 1, if necessary, although your code should still be there.
7b. Now execute
awsmobile run
.8b. Note the
zipping sampleLambda
step underbuilding cloud-api
.9b. Note various CloudFormation states pass by on the
status check
line.10b. Eventually, the application starts.
11b. Return to the MobileHub/Cloud Logic console, refresh, and confirm that your imported API is now deleted. The
sampleCloudAPI
provided byawsmobile cloud-api enable
should be present.12b. View
aws-exports.js
and note theaws_cloud_logic*
attributes are gone.Conclusion
It appears that no matter what I do, it is not possible to execute an
awsmobile run
with an imported API in Cloud Logic. It is also worth noting that in both cases, the code (similar to what is shown) generates the following error:API no configured
Edit: Environment
I am using a MacOS High Sierra workstation with current Homebrew packages for node/npm etc.
The text was updated successfully, but these errors were encountered: