Amplify pull --sandboxId <UUID> results in "Failed to pull sandbox app" - amazon-web-services

I'm following this tutorial for setting up AWS Amplify and can't seem to generate the data models from Amplify Studio with the "Amplify pull --sandboxId <UUID>" command with my ID. This results in the "Failed to pull sandbox app" error message. I have no clue what the reason for this is, if anyone has any insight I would greatly appreciate it.
I ran "amplify env pull" with no issues as well as just "amplify pull". No idea what could be causing this new issue, I can't find the solution anywhere.

Figured out the issue, it happens if you run "amplify init" before running this command.

Related

Created a pipeline using AWS copilot, original push worked but when I make changes to code and push them to github they don't show up

would appreciate any help with this:
I've followed the guide for AWS copilot here: https://aws.github.io/copilot-cli/docs/getting-started/first-app-tutorial/ and then the guide for creating a pipeline and connecting it to github here: https://aws.github.io/copilot-cli/docs/concepts/pipelines/. That all appears to have worked and I can view the react app I'm working on at the url indicated in aws.
My problem is that when I make changes to my code and then push it to the tracked github branch, the changes don't appear when viewing the app at the url. However, when I make the push to github, the pipeline does register that a change has occured. It indicates that a change has been made and goes through the flow of creating a new build. But whatever I try, the changes don't seem to actually show up.
I assume that I'm missing something simple here, and that for some reason, docker is building the app based on the original code. But I can't figure out why that would be. Maybe something is weird with my DockerFile?
My docker file looks like this:
FROM node:16.14
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY package-lock.json ./
RUN npm i
COPY . ./
CMD ["npm", "run", "server"]
My understanding of how this should work, is that I push up new code to github, that is sent to the aws pipeline and a new image is generated based on that code, which is then used to create a container that is hosted on ECS. But clearly I am missing something.
copilot deploy does work. I'm unsure if
the problem is that my pipeline is successfully building (as it does not throw an error in the console) and then just not hosting it at the same url as copilot deploy. Or
the pipeline is hitting an error that just doesn't show up in the pipeline console. Digging into the logs I find this:
echo "Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error." 1>&2;
Which seems to point towards the second option. Any suggestions on how resolve whatever it going on in the container if that is the problem?
The error suggests that I check build logs but these are the build logs. Are there more granular build logs I can examine?
When running containers in ECS, unless your container is already crashing because of an error, it often won't pick up code changes from your new image unless you force a new deployment. You can do this from the command line using the AWS CLI with the following:
aws ecs update-service --cluster <cluster_name> --service <service_name> --force-new-deployment --profile <aws_profile_name>
Note that the profile is optional if you're using your default aws cli configuration profile.

Serverless and AWS deploy issue

I have to update a website on aws using serverless deploy.
This website were not created by me, it's the first time I work with serverless and AWS solutions.
I have the source code, deploy files, etc, from the last person in charge.
I run a before-deploy.js script to create all local files, check them to see if the updates went ok. Everything's fine.
But anytime I try to deploy using the simple command "serverless deploy", it fails printing this error :
CREATE_FAILED: MainStaticSite (AWS::S3::Bucket)
“mywebsite.com” already exists
I don’t really understand this error, as I know the website already exists but I just want to update it.
I tried more specific commands like :
serverless deploy -v --stage production --region eu-west-1
But this one only shows this output :
Framework Core: 3.10.1
Plugin: 6.2.0
SDK: 4.3.2
PS
And doesn't updates the website.
I changed the keys on AWS, maybe it's because of this ?
Looks like he doesn’t want to overwrite the existing files, but no idea why.
If someone has an answer or a lead.
Thank you :)

Calling vision (from google.cloud) Results in 'crash' in Log

Have been working on a GCP project involving OCR. Have attempted to follow the tutorial here, but the first function crashes when I try to upload a file to the trigger bucket. Moreover, cloud shell will not allow me to set the env variable GCP_PROJECT; it returns
ERROR: (gcloud.functions.deploy) ResponseError: status=[400], code=[Bad Request], message=[The request has errors
Problems:
environment_variables:
environment variable name GCP_PROJECT is reserved by the system: it cannot be set by users
]
Any suggestions?
I am not 100% sure, but after some work, I am guessing that the answer is that the .json file with the service account being used in the function had to be exported as GOOGLE_APPLICATION_CREDENTIALS in the gcloud SDK when deploying the function.
I got the same error when following this tutorial.
Changing
--set-env-vars "^:^GCP_PROJECT=my_proj:TRANSLATE_TOPIC
to
--project my_proj --set-env-vars "^:^TRANSLATE_TOPIC fixed it.
I have the same error.
I just follow their own tutorial and there is nothing special or customized.
Actually I got errors in every step of the tutorial and search the internet to fix it.
However I stuck on this one.

Error when deploying to codedeploy in AWS ec2

error : /scripts/execute-deploy.sh Script at specified location:
/scripts/execute-deploy.sh failed with error Errno::ENOENT with
message No such file or directory -
/opt/codedeploy-agent/deployment-root/0e164065-68f3-4cac-b540-6b70eaea7b0d/d-RSJV81S50/deployment-archive/scripts/execute-deploy.sh
Project on Github
I am trying to upload projects to an AWS ec2 instance, build them, and deploy them.
Right now, you can see the structure in the picture below.
I checked that the .zip file is saved without error in s3.
An error like this occurs when its building in codedeploy:
I tried googling. I tried to create a codedeploy application. I tried searching. Nothing has worked so far.
It says it could not locate the file, but there is actually a file in the directory.
This is my appspec.yml:
I really want to find a solution. Any help will be appreciated. I've been trying to solve it by myself for 4 days now.
Have you tried to manually execute your deployment in CodeDeploy applications via AWS Console ?

AWS code deploy error before install

I am getting following error while deploying using code deploy agent
/opt/codedeploy-agent/deployment-root/6d3f114b-72a9-4d1a-9d65-1227b6839916/d-FWIG1AI1M/deployment-archive/appspec.yml
The problem is the appspec.yml gets created in folder inside the current deployment id.
Please advise as what is wrong?
Thanks
Do you have the error log? The place where appspec file is used looks good to me, according to http://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file.html