Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amplify hosting not detected #13230

Open
2 tasks done
CGarces opened this issue Sep 17, 2023 · 8 comments
Open
2 tasks done

Amplify hosting not detected #13230

CGarces opened this issue Sep 17, 2023 · 8 comments
Labels
bug Something isn't working hosting Issues tied to hosting category p3

Comments

@CGarces
Copy link

CGarces commented Sep 17, 2023

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

v18.17.1

Amplify CLI Version

12.4.0

What operating system are you using?

Windows 10

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

Amplify hosting MAYBE was added from console?

Describe the bug

I have changed my application from angular to plain JS

The build and deploy works fine and I can see the new files, but I can fetch the old files from the angular version.

I have executed

amplify publish -c
🛑 Add hosting to your project before publishing your project
Command: amplify hosting add

It's and old Amplify inhalation and I'm not sure how the hosting was added.

Hosting add not works

amplify hosting add
√ Select the plugin module to execute · Hosting with Amplify Console (Managed hosting with custom domains, Continuous deployment)
You have already connected branches to your Amplify Console app. Please visit the Amplify Console to manage your branches.

Expected behavior

Some way to sync hosting options with amplify pull

Reproduction steps

I can't reproduce the error.

Project Identifier

e2a6b48c5b48584b6f1162da36d4e8de

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@CGarces CGarces added the pending-triage Issue is pending triage label Sep 17, 2023
@ykethan
Copy link
Contributor

ykethan commented Sep 18, 2023

Hey @CGarces, thank you for reaching out. The issue occurs when the hosting category has been via the AWS console, running amplify pull does not pull the hosting config. Unfortunately this information is only captured when hosting is added to the project on amplify add hosting.
marking this as bug for DX improvements.

@ykethan ykethan added bug Something isn't working hosting Issues tied to hosting category and removed pending-triage Issue is pending triage labels Sep 18, 2023
@CGarces
Copy link
Author

CGarces commented Sep 18, 2023

I have deatached the branch, and added again from CLI.
but I can't execute amplify publish - c, only give the option of made a git push.
I still have the problem of old content served from cloud front.

@ykethan
Copy link
Contributor

ykethan commented Sep 19, 2023

Hey @CGarces, the Continuous deployment option relies on a version control system such as GitHub to commit your changes, where the Amplify hosting on AWS console picks up the commit and runs the build.
If you are looking to manually publish without a git provider we can utilize the Manual deployment option Amazon CloudFront and S3 to host your static website.

Please refer to the following documentation providing this information.
https://docs.amplify.aws/cli/hosting/hosting/#type-of-deployments
https://docs.amplify.aws/cli/hosting/hosting/#amazon-s3-and-amazon-cloudfront

Additionally, the amplify publish does not support a -c flag and is ignored by the command. Could you point me to the resource that provides this information?
command reference: https://docs.amplify.aws/cli/commands/hosting/

@josefaidt josefaidt added the p3 label Sep 19, 2023
@CGarces
Copy link
Author

CGarces commented Sep 22, 2023

Hi!

Cache Invalidation

If you select Amazon S3 & Amazon Cloudfront for hosting your Amplify project in the amplify add hosting flow, the frontend build artifacts will be uploaded to the S3 hosting bucket, and then if Amazon CloudFront is enabled along with it, the amplify publish command executed with the --invalidateCloudFront or -c flag will send an invalidation request to the Amazon CloudFront service to invalidate its cache.

I need to move to Amazon CloudFront and S3, due this problems and the cache miss, the managed cloudfront is useless to me.

@ykethan
Copy link
Contributor

ykethan commented Sep 22, 2023

@CGarces really appreciate pointing this out. Are there are here any issues you are observing with the managed CloudFront so that i can reach out to our folks in the hosting team for any information.

@CGarces
Copy link
Author

CGarces commented Sep 22, 2023

I have a open case with AWS 13848994171

Looks like cloudfront is using the old index.html and made a redirection (the old version was an standard Angular application with routing).

Also the bug aws-amplify/amplify-hosting#2563 is another reason to stop using hosted app.

The comment from aws-amplify/amplify-hosting#2563 (comment) provide a lot of information about what is probably going wrong with my deploy.

But In any case the main topic of the issue "Amplify hosting not detected" is solved, so I'll close the issue.

@CGarces CGarces closed this as completed Sep 22, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@ykethan
Copy link
Contributor

ykethan commented Sep 22, 2023

@CGarces I understand. I am going to keep the issue open as this would enable us in tracking the CLI improvements on the hosting flow.

@ykethan ykethan reopened this Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hosting Issues tied to hosting category p3
Projects
None yet
Development

No branches or pull requests

3 participants