Configure a Service
A service component connects source code to a build artifact and a deployment target. Most settings are shared by the service, while capacity and runtime behavior can vary by environment.
Source and Build
- Open Infrastructure > Configurations and create or edit a configuration.
- Add a Service component and choose its target.
- Select the Git connection, account, repository, and default branch. Public repository URLs can be used where the source setup allows them.
- Choose a framework or Docker build.
- Enter application build and pre-deployment commands when required.
The application build command runs while StationOps prepares the artifact. Use a pre-deployment command for work that must happen before a release becomes active, such as a schema migration.
php artisan migrate --force
Make Migrations Safe to Repeat
Deployment commands can be retried. Database migrations and other pre-deployment work should be idempotent and backward compatible with the currently running release.
Runtime Settings
Review the controls shown for the selected target. They can include:
- CPU and memory.
- Container or function port.
- Health-check path and timing.
- Minimum, desired, and maximum capacity.
- CPU- or memory-based automatic scaling.
- CPU architecture and function runtime.
- Sidecars and shared EFS volume mounts.
Set production capacity deliberately. Development defaults are rarely appropriate for a public workload.
Environment-Specific Configuration
Open each environment tab and check its runtime, scaling, networking, and removal settings. A configuration can deploy the same service shape with different capacity in development and production.
For frontend builds that need environment-specific values, use file-based environment configuration and, when necessary, create an image per environment. StationOps supplies the environment name as STATION_OPS_ENV during the build.
Connect Components
Use component access controls to grant only the permissions the service needs, such as read access to a bucket or read/write access to a queue. Then use derived environment-variable values for generated resource names, URLs, hosts, ports, and credentials.
Networking and Protection
Depending on the target, configure domains, path routing, allowed IPs, health checks, and AWS WAF rules. Public access should be a deliberate decision rather than a default.
Before Saving
- Confirm the repository and branch.
- Confirm commands run from the expected working directory.
- Check every environment tab.
- Validate resource access and secrets.
- Review the target's package type and runtime.
- Save the component, then review the full infrastructure diff.