aws-amplify / aws-amplify/amplify-cli

--invalidateCloudFront option of amplify publish ignored without warning when CloudFront not added to hosting

Open
#10,483 0 comments 0 reactions 0 assignees View on GitHub
bug p3 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Is this feature request related to a new or existing Amplify category?

hosting

### Is this related to another service?

_No response_

### Describe the feature you'd like to request

When running `amplify publish --invalidateCloudFront` while hosting is enabled but CloudFront isn't added to the hosting configuration, the -[-invalidateCloudFront](https://docs.amplify.aws/cli/hosting/hosting/#cache-invalidation) option is ignored without warning the user it was ignored.

It could be useful to warn the user that the option could not be applied as CloudFront is not added to hosting.

(In my specific case, I do have a CloudFront distribution whose origin is the s3 bucket to which amplify publishes my app, however it was not added through the amplify cli, thus amplify ignores it.)

### Describe the solution you'd like

A warning, telling CloudFront isn't enabled in this amplify project, so the option --invalidateCloudFront was ignored.

This could be a very useful heads up to the user to ease their life (and not walk away from a tool that tends to look like a Rube Goldberg machine at times).

### Describe alternatives you've considered

None. KISS.

### Additional context

_No response_

### Is this something that you'd be interested in working on?

- [ ] 👋 I may be able to implement this feature request

### Would this feature include a breaking change?

- [ ] ⚠️ This feature might incur a breaking change

Contributor guide

Open the contributing guide

Research direction

Start with the Amplify CLI publish command and its hosting configuration handling, then trace how --invalidateCloudFront is processed when CloudFront is absent. Done means the command warns that invalidation was ignored when CloudFront is not enabled, while preserving the existing behavior when it is configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cli, cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.