- Go through every single resource in your state.
- Make a call to the cloud provider to check the resource.
- If the configs are different, it’ll update the state to reflect the change.
- If the resource doesn’t exist anymore, it’ll remove it from the state.
The
sst refresh does not make changes to the resources in the cloud provider.sst deploy. If the stage was deployed using sst dev, use the --dev flag.
This is useful for cases where you want to ensure that your local state is in sync with your cloud provider. Learn more about how state works.
Options
--dev
Refresh the dev version of this stage.
sst dev, use this flag to refresh the dev state.
--target
Only run it for the given component.
--exclude
Exclude the specified component from the operation.
Examples
Refresh all resources
Refresh the entire app state:Refresh dev stage
If you deployed withsst dev:
Refresh a specific component
Refresh only one component:Refresh everything except a component
Exclude a component from refresh:Refresh production
Refresh your production stage:When to use refresh
You should runsst refresh when:
- You’ve made manual changes to resources in your cloud provider console
- Someone else has modified resources outside of SST
- Your state might be out of sync with reality
- You want to detect drift between your state and actual infrastructure
How it differs from deploy
Unlikesst deploy, the refresh command:
- Does not create, update, or delete resources
- Only updates your local state to match reality
- Detects drift between state and actual infrastructure
Related
sst deploy- Deploy your applicationsst unlock- Clear locks on app state- State documentation - Learn more about SST state