Migrate from AWS to Azion
Move an AWS project to Azion: deploy it, recreate Lambda, CloudFront, and WAF rules, move S3, DynamoDB, and RDS data, then switch DNS.
A project on AWS spreads across CloudFront distributions, Lambda functions, API Gateway routes, S3 buckets, DynamoDB tables, RDS databases, WAF rules, Route 53 zones, and CloudWatch. Over time, each one gains its own cache behaviors, dependencies, access policies, capacity settings, health checks, and alarms. Moving the project means recreating each of these on Azion, then confirming that the project answers correctly before DNS changes.
On Azion, an application and its rules take over delivery, routing, and cache, and Connectors reach the origins. Functions runs the Lambda code. KV Store, Object Storage, and SQL Database hold the data. Firewall filters traffic, a workload serves the domain, and Edge DNS answers for the zone. Real-Time Metrics, Real-Time Events, and Data Stream show what happens to each request.
Each stage of this guide moves one layer, in the order a migration runs: inventory, deployment, code and rules, data, security, monitoring, and DNS. Lambda code moves with focused changes: the handler shape, the runtime language, and how the code opens storage and calls a model. When near-zero downtime is not a requirement, migrate in phases with maintenance windows. Writes stop during each step, so the data needs no parallel synchronization.
The prerequisites and the procedures on this page switch with the interface you select:
Prerequisites
- An Azion account. To open one, sign up in Azion Console. For more information, refer to Create an account.
- The AWS account, with access to its distributions, functions, data stores, and hosted zones.
- Access to the DNS records or the registrar of each domain you move.
curlanddig, to check responses and DNS answers.
- Access to Azion Console. To sign in, refer to Access Azion Console.
Inventory the AWS account
Do not start with the most complex application in the portfolio. Pick a project that matters enough to test the whole path and is small enough to move quickly. A good first project has a CloudFront distribution, a few Lambda functions, an S3 bucket, and perhaps a DynamoDB table. Use it to document the process and the patterns your team reuses. Then move more cache behaviors, functions, data, observability, and security rules, in the same order. Keep the first deployment small, and prove that it builds and runs on Azion before you move domains, storage, or databases.
Before you create anything on Azion, list what the project uses:
- SAM templates, CDK apps, and CloudFormation stacks, with their build and deploy commands.
- Environment variables and secrets, from the Lambda configuration, AWS Secrets Manager, Systems Manager Parameter Store, Elastic Beanstalk environment properties, CodePipeline and CodeBuild settings, and the source code.
- Lambda functions, their runtimes, triggers, and event sources.
- API Gateway APIs, their routes, authorizers, stages, and usage plans.
- Step Functions state machines and EventBridge rules.
- CloudFront distributions: origins, cache behaviors, cache and origin request policies, response headers policies, CloudFront Functions, and Lambda@Edge triggers.
- Load balancers and their target groups.
- Image transformations and Bedrock calls.
- S3 buckets, DynamoDB tables, RDS and Aurora databases, and ElastiCache clusters.
- Route 53 hosted zones, records, routing policies, DNSSEC, and ACM certificates.
- WAF web ACLs, managed rule groups, IP sets, rate-based rules, Bot Control, Shield settings, and GuardDuty, Inspector, and Security Hub findings.
- CloudWatch dashboards, alarms, log groups, metric filters, X-Ray traces, Firehose streams, and RUM monitors.
Each item in the list maps to a stage of this guide. The table in Map each AWS product to Azion names the destination of each one.
Map each AWS product to Azion
Every AWS product in the inventory has a destination on Azion. Find the product in the first column, then move it with the stage that names its destination. A dash (-) in the last column means that Azion has no direct equivalent.
| AWS product | What it covers | Destination on Azion |
|---|---|---|
| Amazon CloudFront | Delivery of static and dynamic content, APIs, applications, and video | Applications, served by a workload, with Connectors for the origins |
| CloudFront distributions | Domains, origins, cache behavior, certificates, and security of one delivery | Applications, Connectors, and Workloads |
| CloudFront alternate domain names | Custom domains of a distribution | The Domains of a workload |
| CloudFront cache behaviors | Per-path cache policy, origin request policy, methods, and function associations | Rules Engine for Applications |
| CloudFront cache policies | Cache keys, TTLs, headers, cookies, query strings, and compression | Cache settings |
| CloudFront origin request policies | The request values forwarded to the origin | Rules Engine for Applications and Connectors |
| CloudFront response headers policies | Security headers and CORS headers on responses | Rules Engine for Applications |
| CloudFront Origin Shield | A central cache layer in front of the origin | Tiered Cache, a feature of Cache |
| CloudFront invalidation | Removal of content from cache before it expires | Real-Time Purge |
| CloudFront Functions | Lightweight JavaScript for redirects, rewrites, headers, and cache keys | Functions |
| Lambda@Edge | Node.js or Python functions on CloudFront events | Functions |
| Lambda@Edge for security logic | Request validation, authentication, and blocking | Functions for Firewall |
| CloudFront device detection | Device type passed to the origin | Device Groups |
| AWS Elemental MediaLive | Real-time encoding of live video | Live Ingest, a module of Connectors |
| AWS Elemental MediaPackage | Packaging and origination of live streams for HLS and DASH | Live Ingest and Applications |
| CloudFront for live streaming | Live video delivery with AWS Media Services | Applications and Live Ingest |
| AWS Lambda | Serverless compute for event-driven code | Functions |
| Amazon API Gateway | REST, HTTP, and WebSocket APIs with backend integrations | Applications and Functions |
| API Gateway validation and throttling | Request controls, throttling, and validation | Rules Engine for Applications and Firewall |
| AWS Amplify Hosting | Git-based CI/CD and hosting for static and server-rendered apps | Applications, served by a workload, and the Azion CLI |
| AWS App Runner | Managed web applications from source code or container images | Applications and Orchestrator |
| Amazon Bedrock | Foundation models and generative AI development | AI Inference |
| Bedrock model inference | Text, image, and embedding model calls | AI Inference |
| Bedrock fine-tuning | Customization of foundation models | LoRA Fine-Tune |
| Bedrock custom model import | Import of customized foundation models | AI Inference and LoRA Fine-Tune. AI Inference runs a catalog of open-source models and imports none |
| SageMaker AI real-time inference | Managed real-time inference endpoints | AI Inference |
| Amazon S3 | Object storage for assets, backups, archives, and websites | Object Storage |
| S3 static website hosting | Static websites served from a bucket | Object Storage and Applications, through a storage connector |
| S3 Object Lambda | Objects transformed by Lambda on the way out | Object Storage and Functions |
| S3 Object Lambda for images | Resizing, watermarking, and redaction of retrieved content | Image Processor and Functions |
| Amazon Aurora DSQL | Serverless distributed SQL for transactions | SQL Database |
| Amazon DynamoDB | Serverless key-value and document database | KV Store, or SQL Database for queries |
| DynamoDB global tables | Multi-Region replication of NoSQL data | KV Store |
| AWS WAF | Web application firewall for applications and APIs | Web Application Firewall, a module of Firewall |
| AWS Managed Rules for AWS WAF | Managed rule groups for common vulnerabilities | WAF rule sets |
| AWS WAF custom rules | Custom match conditions and actions | Rules Engine for Firewall |
| AWS WAF Bot Control | Managed bot detection and mitigation | Bot Manager and Bot Manager Lite |
| AWS WAF rate-based rules | Rate limits keyed on IP, headers, URI, or method | Firewall and Functions |
| AWS WAF IP sets | Reusable IP and CIDR lists for allow or block rules | Network lists |
| AWS Shield Standard | Standard DDoS protection | DDoS Protection |
| AWS Shield Advanced | DDoS protection with more visibility and mitigation options | DDoS Protection |
| Shield Advanced automatic mitigation | WAF protections created during application-layer attacks | DDoS Protection and Web Application Firewall |
| AWS Network Firewall | Managed network firewall for a VPC | Firewall and Network Shield |
| Elastic Load Balancing | Traffic distributed across targets and zones | Load Balancer, a module of Connectors |
| Application Load Balancer | Layer 7 HTTP and HTTPS load balancing | Load Balancer |
| Network Load Balancer | Layer 4 TCP, UDP, and TLS load balancing | Load Balancer, for HTTP and HTTPS origins only |
| AWS Global Accelerator | Global anycast IP addresses and routing over the AWS network | Applications and Load Balancer |
| CloudFront origin access control | S3 origins reachable only through CloudFront | Connectors and Origin Shield, a module of Connectors, with Origin IP ACL and HMAC |
| CloudFront signed URLs and cookies | Access to private content | Rules Engine for Applications, Functions, and the Secure Token integration on a firewall |
| CloudFront geographic restrictions | Access allowed or blocked by country | Rules Engine for Applications and Network Shield |
| Amazon Route 53 | Authoritative DNS, registration, routing policies, and health checks | Edge DNS |
| AWS Certificate Manager | TLS certificates: provisioning, import, deployment, and renewal | Certificate Manager |
| AWS Private CA | Private certificate authorities | Certificate Manager, which holds Trusted CA certificates |
| AWS Private CA for client authentication | Certificate-based client authentication | mTLS |
| AWS IoT Greengrass | Managed components and local processing on edge devices | Orchestrator |
| AWS IoT Greengrass deployments | Components and configurations sent to devices | Orchestrator |
| Amazon ECS Anywhere | On-premises servers registered in ECS clusters | Orchestrator |
| AWS Outposts | AWS infrastructure on customer premises | Orchestrator |
| AWS Systems Manager hybrid activations | Management of non-EC2 machines | Orchestrator |
| Amazon CloudWatch metrics | Metrics collected, queried, charted, and alarmed on | Real-Time Metrics |
| Amazon CloudWatch Logs | Logs collected, monitored, and queried | Real-Time Events and Data Stream |
| CloudWatch Logs Insights | Interactive log queries | Real-Time Events |
| Amazon Data Firehose | Streaming data delivered to S3, Redshift, OpenSearch, and HTTP | Data Stream |
| CloudWatch RUM | Real user monitoring for browser and mobile apps | Edge Pulse |
| AWS X-Ray | Distributed tracing across services | Data Stream and Functions |
| AWS Step Functions | Workflow orchestration with state machines | Functions. Azion has no workflow service |
| Amazon EventBridge | Event routing with rules and targets | - |
| Amazon ElastiCache | In-memory caching with Redis or Memcached | Cache and KV Store |
| Amazon RDS and Aurora | Managed relational databases | SQL Database |
| Amazon GuardDuty | Threat detection | Firewall and network lists |
| Amazon Inspector | Vulnerability scanning | - |
| AWS Security Hub | Centralized security findings | Real-Time Events and Data Stream |
| AWS Marketplace | Third-party software, data, and services | Marketplace |
| AWS Management Console | Web interface to AWS services | Azion Console |
| AWS APIs | Programmatic access to AWS services | Azion API |
| CloudWatch APIs | Programmatic access to metrics, logs, and alarms | GraphQL API |
| AWS CLI | Command-line management of AWS services | Azion CLI |
| AWS SDK for JavaScript | JavaScript libraries for AWS services | Azion Lib |
| AWS CloudFormation | Infrastructure as code for AWS resources | Terraform Provider |
| AWS Cloud Development Kit | Infrastructure defined in code and synthesized to CloudFormation | Terraform Provider and Azion API |
| Terraform AWS Provider | Terraform management of AWS resources | Terraform Provider |
| Lambda runtime environment | The runtime layer of Lambda functions | Azion Runtime |
| CloudFront edge runtime | The runtime of CloudFront Functions and Lambda@Edge | Azion Runtime |
Azion holds a SOC 2 Type 2 report and a SOC 3 report, and is a PCI DSS 4.0.1 Level 1 Service Provider. For the attestations, refer to SOC 2 and SOC 3 and PCI DSS certification.
Deploy the project on Azion
On Azion, a project becomes an application, and a workload serves that application on a domain. AWS keeps the build and infrastructure in template.yaml for SAM or cdk.json for CDK. Azion keeps them in azion.config.js, which can also be azion.config.mjs or azion.config.cjs, depending on the preset.
| Task | AWS | Azion CLI |
|---|---|---|
| Install | pip install awscli | curl -fsSL https://cli.azion.app/install.sh | bash, or brew install azion |
| Sign in | aws configure | azion login |
| Run locally | sam local start-api | azion dev, which serves on http://localhost:3333 |
| Deploy | sam deploy --guided or cdk deploy | azion link, then azion deploy |
| View logs | aws logs tail /aws/lambda/my-function | azion logs cells for function console logs, or azion logs http for HTTP event logs |
| Roll back | Stack rollback | azion rollback, which serves the static files of an earlier deploy again |
| Aspect | AWS SAM or CDK | Azion |
|---|---|---|
| Infrastructure as code | YAML or TypeScript templates | A JavaScript configuration file |
| Local testing | SAM local emulator | azion dev |
| Deployment | CloudFormation stacks | Resources created directly by azion deploy |
| Frameworks | Configured by hand | 19 frameworks and 5 generic presets |
azion logs cells and azion logs http return the logs of the last 5 minutes, and --tail keeps printing new ones. azion rollback takes the --connector-id of the storage connector that delivers the site. For the flags, refer to azion logs and azion rollback.
Azion Console imports a repository with one of six presets, and the Azion CLI asks for the preset in a picker. Neither detects the framework for you.
The API creates the application, its rules, and the workload one resource at a time. To build that chain, refer to Applications quickstart.
The deployment answers on a workload domain that Azion assigns under map.azionedge.net. Before you move any production domain, send a request to the root path, with that domain in place of <your-workload-domain>:
The response carries the status, the headers, and the body the project returns for /. Send the same request to each critical route. A build that passes can still behave differently at run time, so compare the responses with the ones AWS returns.
If the build fails on Azion, compare the preset with the framework of the project, and check build.preset, build.entry, and build.bundler in azion.config.js. The build block has no command field.
Move environment variables
Environment variables hold API keys, database credentials, authentication secrets, service endpoints, feature flags, and per-environment settings. A variable that does not reach Azion breaks the project at run time, even when the deployment succeeds.
On AWS, a Lambda function reads a variable from process.env, and secrets often live in AWS Secrets Manager or Parameter Store. On Azion, variables belong to the account, up to 100 of them, and a function reads them with Azion.env.get(). Each variable has a key, a value, and a flag that marks it as a secret.
| Aspect | AWS | Azion |
|---|---|---|
| Access | process.env.VARIABLE | Azion.env.get('VARIABLE'), or process.env.VARIABLE |
| Secrets | AWS Secrets Manager and Systems Manager Parameter Store | Variables with the secret flag on |
| Size | Set per function | 32 KB for all the variables of one function |
To create the variables in Azion Console, open the Variables page of the Account menu, and create each variable with its key and its value. Turn a variable that holds a credential into a secret.
Then change the code that reads the variables. A value fetched from Secrets Manager becomes a variable read:
Code that reads process.env.API_KEY keeps working on a deployed function, because Azion Runtime supports process.env for Node.js compatibility. Under azion dev, a function reads the project .env file instead of the account variables, or the whole shell environment when there is no .env file. A key that does not exist returns undefined, not an error. If a function reads a variable as undefined, confirm that the variable exists on the account.
Move Lambda functions to Functions
Lambda functions often carry the most critical logic of a project: authentication, personalization, API orchestration, and integrations with third-party services. On Azion, this code runs in Functions. A function holds the JavaScript code, a function instance runs it on an application, and a rule decides which requests reach it.
| Aspect | AWS Lambda | Azion Functions |
|---|---|---|
| Handler | exports.handler = async (event) => {} | export default { async fetch(request, env, ctx) {} } |
| Runtimes | Node.js, Python, Java, Go, .NET, and Ruby | JavaScript, in V8 isolates |
| Memory | 128 MB - 10,240 MB | 512 MB per isolate, on every plan |
| Timeout | 1 sec - 15 min | 2 s of CPU time and 5 minutes of wall-clock time per invocation |
| Cold start | Common, especially in a VPC | None |
| Triggers | SQS, SNS, Kinesis, DynamoDB, and API Gateway | HTTP requests that a rule of an application or a firewall matches |
A Lambda function written in Java, Python, or another runtime has to be rewritten in JavaScript. Framework builds can also produce WebAssembly. A function makes at most 50 outbound fetch() calls in one invocation. For every limit, refer to Functions limits.
| Scenario | AWS Lambda cold start | Azion Functions cold start |
|---|---|---|
| Node.js, no VPC | 100-300ms | None |
| Node.js, with VPC | 500ms-2s | None |
| Java or Spring | 1-5s | None |
| Python | 100-500ms | None |
The handler receives a standard Request and returns a Response. Read the body, the query string, and the path from the request instead of from the event:
env is an empty object on a deployed function, and ctx carries args and waitUntil. The Lambda context and the API Gateway request context move to request.metadata:
request_id holds the same value as the x-azion-request-id response header. geoip_city and geoip_region hold codes. Under azion dev, request.metadata is undefined, so test code that reads it on a deployed function. For every field, refer to Metadata.
Map CloudFront triggers to rule phases
An application processes each request in two phases. The Request Phase handles what the user sent, and the Response Phase handles what the application sends back. Lambda@Edge triggers map to those phases:
| CloudFront trigger | Azion equivalent |
|---|---|
| Viewer request | A Request Phase rule, which can run a function |
| Origin request | A Request Phase rule. No phase runs between the cache and the origin |
| Origin response | A Response Phase rule with header, cookie, or redirect behaviors |
| Viewer response | A Response Phase rule with header, cookie, or redirect behaviors |
A JavaScript function runs in the Request Phase. For the Response Phase, the Console function instance form states Only Lua functions can be used in the Response phase. Move response logic to Response Phase behaviors, such as Add Request Header, which adds a response header in that phase.
Code that reads KV, SQL, or a model also changes its calls. The stages on KV Store, SQL Database, and AI Inference show the new calls. For the runtime APIs, refer to Web APIs.
Route API Gateway paths to functions
API Gateway routes each method and path to a backend, with authorizers, throttling, and stages around it. On Azion, a rule of the application matches the method and the path, and its Run Function behavior runs a function instance. Run Function requires Application Accelerator and Functions on the application.
| Aspect | AWS API Gateway | Azion |
|---|---|---|
| API types | REST APIs and HTTP APIs | Functions, reached through Rules Engine rules |
| Routes | Resource paths and methods | Criteria on ${uri} and ${request_method} |
| Authorizers | Lambda, Cognito, and JWT authorizers | A function on a firewall, which runs before the application |
| Stages | Stage variables and deployments | - |
| Throttling | Usage plans and rate limiting | Set Rate Limit on a firewall rule |
| Custom domains | Domain mappings | The Domains of a workload |
A function becomes reachable in three steps: create the function, create an instance of it on the application, and create the rule.
To create the function with the Azion CLI, save the code to index.js, then run:
Create the instance on the application, with the function ID:
Then create the rule from a JSON file with azion create rules-engine --application-id <application-id> --phase request --file rule.json. The file carries the body of the API panel. For the full procedure, refer to Functions quickstart.
New rules can take a few minutes to propagate. On an unexpected response, wait and retry before diagnosing.
To route each method and path to its own function, create one function and one instance per route, as the previous procedure shows. Then give each route its own rule. A rule that matches a method joins ${request_method} to the path criterion with and:
Send each object to the request rules of the application, as the API panel shows. These two rules replace the API Gateway routes GET /users/{id} and POST /users. Add a rule of the same shape for PUT /users/{id} and DELETE /users/{id}. To declare the same functions, instances, and rules as code, refer to azion.config.js.
Move an authorizer to a firewall function
A Lambda authorizer returns an IAM policy that allows or denies the call:
On Azion, a function on a firewall decides before the application runs. Every function on a firewall must end with a finishing outcome: event.continue() lets the request proceed, and event.deny() answers 403 Forbidden. This function lets through only requests that carry the expected bearer token:
Put the verification your authorizer performs, such as a JWT check, in place of the comparison. A request without a valid token receives 403. To answer 401 instead, call event.respondWith(new Response('Unauthorized', { status: 401 })).
The function needs the firewall execution environment: execution_environment in the API, or --execution-environment in the Azion CLI. A firewall with the Functions module runs it through an instance and a rule with Run Function. For the steps, refer to Functions for Firewall and Functions instances.
Replace Step Functions and EventBridge
Azion has no workflow orchestration service and no event bus. A Step Functions workflow becomes code that calls each step in sequence inside one function. An EventBridge rule becomes a function route that the producer of the event calls over HTTP.
| Aspect | AWS Step Functions | Azion Functions |
|---|---|---|
| Workflow definition | Amazon States Language | JavaScript |
| State | Built-in state machine | Your code. Persistent state goes to KV Store or SQL Database |
| Error handling | Retry, catch, and fallback | try and catch |
| Visualization | Workflow Studio | The code |
| Bounds | Set by the state machine | 50 outbound calls, 2 s of CPU time, and 5 minutes of wall-clock time per invocation |
| Aspect | Amazon EventBridge | Azion |
|---|---|---|
| Event routing | Rules and targets | A rule of the application that runs a function on the event path |
| Event patterns | Pattern matching | Conditions in the function code |
| Targets | 100+ AWS services | HTTP endpoints that the function calls with fetch() |
This Step Functions definition validates an order, charges it, and fulfills it, with a failure branch:
The same flow runs as one function. Each step is a function call, and the catch block takes the failure branch:
A workflow that waits for hours, or that must survive a failed invocation, does not fit in one invocation. Keep its state in KV Store or SQL Database, and let each call advance one step.
An EventBridge rule matches events by source, type, and content:
On Azion, the producer posts the events to a function route, and the function applies the pattern:
The function answers OK after it handles every event in the batch. Data Stream cannot replace the bus: it sends only Azion’s own logs, from Activity History, Applications, Functions, and WAF Events.
Recreate CloudFront distributions
A CloudFront distribution holds the origins, the cache behaviors, the certificate, and the domains in one resource. On Azion, a connector holds each origin, an application holds the rules and the cache, and a workload holds the domains and the certificate.
| Aspect | AWS CloudFront | Azion |
|---|---|---|
| Configuration | XML or JSON in CloudFormation | Azion Console, the API, the Azion CLI, or azion.config.js |
| Origins | S3, ALB, and custom origins | Connectors of type http, storage for an Object Storage bucket, or live_ingest |
| Behaviors | Cache behaviors per path | Rules with criteria, and Set Connector to pick the origin |
| Certificates | ACM, in us-east-1 only | Certificate Manager, on the workload |
| Edge functions | Lambda@Edge, on 4 triggers | Functions, on Request Phase rules |
| Response headers policies | Security and CORS headers | Response Phase rules with Add Request Header |
A new application has Cache and Functions on, and Application Accelerator and Image Processor off. A rule with Set Connector sends the requests it matches to a connector. When several matching rules carry Set Connector, only the last one runs, so keep a per-path rule after the catch-all rule.
To create the connector with the Azion CLI, save the body of the API panel as connector.json, then run:
Create the Set Connector rule from a file with azion create rules-engine, as the Connectors quickstart shows.
A connector change reaches Azion’s infrastructure in several minutes, with no new deployment. To serve a bucket prefix with a one-day cache and send /api/ to a function with no cache, the distribution takes these resources:
- A connector of type
storagewith the bucket and the prefix, such asassets/. The build refuses astorageconnector withoutprefix. - A cache setting with a browser TTL of 3,600 seconds, a cache TTL of 86,400 seconds, stale cache on, Tiered Cache off, and no variation by cookie or query string.
- A request rule on
${uri}starts with/with Set Connector and Set Cache Policy. - A request rule on
${uri}starts with/api/with Bypass Cache and Run Function.
bypass_cache and run_function require Application Accelerator. Bypass Cache leaves the browser cache and Tiered Cache unchanged. To declare these resources as code, refer to azion.config.js.
To add the security headers or the CORS headers of a response headers policy, create a Response Phase rule with add_response_header. Its value takes the form Name: value, such as Access-Control-Allow-Origin: https://example.com or Access-Control-Allow-Methods: GET, POST. The rule adds nothing to a 404 that Azion generates with no origin.
CloudFront origin access control keeps an S3 origin private. On Azion, Origin Shield on an http connector does the same with Origin IP ACL and HMAC. HMAC signs each request with aws4_hmac_sha256, a region, a service, and a key pair. For a bucket in your Azion account, use a storage connector instead.
Recreate cache settings
On Azion, a cache setting holds how long a response stays in cache and what makes two requests share one cached copy. A rule with Set Cache Policy applies the setting to the requests it matches. The rule selects a setting, and the setting holds the TTL and the cache key.
| Aspect | AWS CloudFront | Azion |
|---|---|---|
| Cache levels | Regional caches and the caches of each CloudFront site | Cache, Tiered Cache, and browser cache |
| Cache key | Cache policy and origin request policy | Cache vary by controls of the cache setting, which require Application Accelerator |
| TTL | Default 24h, max 1 year | Max Age of each cache setting, from 0 to 31,536,000 seconds |
| Purge | Path-based invalidations | URL, cache key, and wildcard |
| Stale content | Origin Shield and stale-while-revalidate | Stale cache, which serves an expired copy when revalidation fails |
Map each CloudFront managed cache policy to a setting or a behavior:
| CloudFront cache policy | Azion equivalent |
|---|---|
| CachingOptimized | A cache setting with Override cache behavior and a high Max Age |
| CachingDisabled | The Bypass Cache behavior in a Request Phase rule |
| Elemental-MediaPackage | Enforce HLS cache, which Azion adds when you select a Live Ingest source: 5 seconds for .m3u8 playlists and 60 seconds for .ts chunks |
| A custom policy | A cache setting and a rule with Set Cache Policy |
Max Age defaults to 60 seconds. A value below 60 requires Application Accelerator, and a cache setting with Tiered Cache on needs at least 3 seconds and Override cache behavior. Stale cache honors the stale-while-revalidate the origin sends, or keeps a 300-second window under Override cache behavior. It is on by default in Azion Console and off in the API and the CLI.
The CLI flags cannot set the cache TTL, the cache behavior, or Tiered Cache. Send the full cache setting body from a file with --file, as the Cache quickstart shows.
To vary the cache by query string, cookie, or device, use the Cache vary by controls of the cache setting: Cache vary by Query String, Cache vary by Cookies, and Cache vary by Devices. They require Application Accelerator on the application. In azion.config.js, a cache setting that varies only by the version and lang parameters carries cacheByQueryString: { option: 'allowlist', list: ['version', 'lang'] }. The options are ignore, all, allowlist, and denylist. For the controls, refer to Cache variation.
A CloudFront invalidation names a distribution and paths:
On Azion, purge is a top-level endpoint, not nested under an application. A wildcard purge takes one expression, so each path pattern is its own request:
Send a second request with https://example.com/css/*. A URL purge, at /v4/workspace/purge/url, takes up to 50 items. Only a cache key purge, at /v4/workspace/purge/cachekey, reaches Tiered Cache with "layer": "tiered_cache". A URL or wildcard purge with that layer fails with 30001. A purge takes time to propagate, and it appears in the purge history when it is complete. To check a purged object, request it with curl -I and read the response headers. For the purge types, refer to Real-Time Purge.
Balance traffic across origins
On Azion, Load Balancer is a module of a connector, not a separate resource. One connector of type http holds every origin as an address, up to 15 addresses with Load Balancer on, and one address without it. A rule with Set Connector sends the requests of the application to the connector.
| Aspect | AWS ALB and NLB | Azion Load Balancer |
|---|---|---|
| Balancing methods | Round-robin, least connections, and IP hash | Round Robin, Least Connections, and IP Hash, which are round_robin, least_conn, and ip_hash in the API. No method steers by location |
| Health checks | HTTP, HTTPS, and TCP | None. Failover is passive: Max Retries and the timeouts handle a failed connection |
| Failover | Target group failover | Several Primary addresses with weights, and Backup addresses that receive traffic only when every primary fails |
| Session affinity | Cookie and IP hash | IP Hash only, which maps each client IP address to one address |
| Targets | EC2 instances, Lambda functions, and IP addresses | Addresses of one connector |
| Protocol | Layer 4 for NLB, layer 7 for ALB | HTTP and HTTPS origins, on connectors of type http |
An ALB target group becomes one connector. Its health check path, interval, and healthy and unhealthy thresholds have no equivalent field.
Each address has a Weight from 1 to 100, which sets its share of the traffic. IP Hash refuses Backup addresses, with 28005 in the API. Max Retries takes 0 to 20, Connection Timeout 1 to 300 seconds, and Read/Write Timeout 1 to 600 seconds. These fields exist only with Load Balancer on. When you turn it on in Azion Console, the form fills in Round Robin, 3, 30, and 60. The API defaults are 0, 60, and 120.
The update command needs the full connector body. Put it in a JSON file and send it with --file, as the Load Balancer quickstart shows.
A connector without Load Balancer has no configurable timeout. If an origin times out, check the address and its ports, and turn on Load Balancer to set the timeouts. For the connector fields, refer to Connector settings.
Serve optimized images
On AWS, image transformations usually need Lambda@Edge or a custom origin. Image Processor resizes, crops, converts, and filters images on request, with no code. It stores nothing: it reads the source image from the origin of the application, which can be an Object Storage bucket behind a connector.
| Aspect | AWS CloudFront and Lambda@Edge | Azion Image Processor |
|---|---|---|
| Storage | An S3 origin | The origin of the application, such as Object Storage |
| Transformations | Custom Lambda@Edge code | Resize, format, quality, crop, rotate, fill, and watermark |
| URL format | A custom implementation | /image.png?ims=<OPTIONS> |
| Formats | A custom implementation | WebP, AVIF, JPEG, GIF, and PNG |
| Signed URLs | CloudFront signed URLs | Through the Secure Token integration on a firewall |
Image Processor works in two steps: turn on the module on the application, then create a rule with the Optimize Images behavior. A request that no such rule matches is delivered unprocessed.
To turn on Image Processor with the Azion CLI, follow the CLI panel of the Image Processor quickstart.
Image Processor reads the transformation from the ims query parameter:
| Syntax | Result | Example |
|---|---|---|
?ims=WxH | Resizes to the width and height, cropping to fit when both are set | ?ims=400x300 |
?ims=Wx | Resizes to the width, with the height in proportion | ?ims=400x |
?ims=xH | Resizes to the height, with the width in proportion | ?ims=x300 |
?ims=fit-in/WxH | Fits the image inside the dimensions, never enlarging it | ?ims=fit-in/400x300 |
?ims=fit-in/WxH/filters:fill(Color) | Fits the image and fills the rest of the canvas with a color | ?ims=fit-in/400x300/filters:fill(white) |
Image Processor converts to WebP when the Accept header of the client allows it. AVIF needs ?ims=filters:format(avif) and a client that accepts image/avif. To cache one copy for each ims value, turn on Application Accelerator and vary the cache by query string. For every parameter, refer to URL parameters.
Move Bedrock to AI Inference
AI Inference runs a catalog of open-source models: large language models, vision language models, an embedding model, and a reranker. A model is not an object you create, and Azion hosts no inference endpoint for it. A function calls a model by its ID with Azion.AI.run(), and needs no credential.
| Aspect | Amazon Bedrock | Azion AI Inference |
|---|---|---|
| Models | Managed foundation models, such as Claude, Llama, Titan, and Stable Diffusion | A catalog of open-source models. To adapt a model, use LoRA fine-tuning |
| Interface | Bedrock Runtime API | Azion.AI.run() inside a function |
| Model types | Text, image, and embedding models | LLMs, vision language models, an embedding model, and a reranker |
| Billing | Per token or per image | Compute Time and Requests |
A Bedrock call names a model and sends a provider-specific body:
On Azion, the function passes the model ID and a chat body:
answer holds the text of the reply. Fields such as max_tokens and temperature shape the output. Under azion dev, Azion.AI is undefined, so test the call on a deployed function. For the request fields, refer to Model invocation and the AI runtime API.
For an OpenAI-compatible /v1/chat/completions endpoint, deploy the AI Inference Starter Kit template. It creates an application and a function that serve that endpoint. To deploy it, access Azion Console > Create, select the template, and select Deploy. The Azion CLI has no template flag.
Move DynamoDB key-value data to KV Store
DynamoDB serves key-value and document data. Key lookups, sessions, feature flags, and configuration move to KV Store. Queries with filters, secondary indexes, aggregations, and joins move to SQL Database, in the stage Move DynamoDB queries and RDS databases to SQL Database.
| Aspect | Amazon DynamoDB | Azion KV Store | Azion SQL Database |
|---|---|---|---|
| Data model | Key-value and document | Key-value | Relational, in SQLite’s dialect |
| Queries | Key lookups, queries, and scans | Key lookups | Full SQL |
| Replication | Global tables across Regions | Azion’s distributed infrastructure | One main instance and read replicas |
| Consistency | Eventual or strong | Eventual. A write is visible everywhere within 60 seconds | ACID |
| Indexes | GSI and LSI | None | SQL indexes |
| Capacity | On-demand or provisioned | Serverless | Serverless |
| DynamoDB use | Destination on Azion |
|---|---|
| Primary key lookups | KV Store |
| Simple key-value operations | KV Store |
| Session storage | KV Store |
| Feature flags and configuration | KV Store |
| Queries with filters | SQL Database |
| Secondary index queries | SQL Database |
| Aggregations and joins | SQL Database |
| Relational data | SQL Database |
DynamoDB global tables resolve conflicts with last writer wins and charge for each replicated write. KV Store has no Region to choose: a write applies where it arrives, and other parts of the infrastructure converge within 60 seconds.
A function opens a namespace with Azion.KV.open(), a runtime global that needs no import line:
put serializes an object to JSON, and get with 'json' parses it back. Azion.KV.open() is the only entry point, and it is asynchronous. The namespace must exist first, or open() throws NotFound. get() returns null for a missing key, the same as for an expired one.
KV Store has no bulk import, and no API, CLI command, or Console screen reads or writes keys. To move the data:
-
Export the table from AWS:
Shell -
Transform each item into a key and a value.
-
Create the namespace with a
POSTrequest tohttps://api.azion.com/v4/workspace/kv/namespaces, with{"name": "my-namespace"}. The name takes 3 to 63 characters, is case-sensitive, and is permanent: a namespace cannot be renamed or deleted. For the fields and the errors, refer to Namespaces. -
Write the keys from a deployed function with
kv.put().
The function writes a key at most once per second. A value takes up to 25 MB, a key up to 512 bytes, and the metadata up to 1,024 bytes. Map each DynamoDB TTL to the expiration option, in Unix seconds, or to expirationTtl, in seconds with a minimum of 60. A write becomes visible everywhere within 60 seconds, or within the cacheTtl of the read. Before the import, review the key prefixes, the value formats, and the code that handles a missing key. For the client, refer to KV Store runtime API.
Replace ElastiCache
ElastiCache keeps data in memory, behind Redis or Memcached. On Azion, HTTP responses stay in Cache, and the values a function reads and writes move to KV Store.
| Aspect | Amazon ElastiCache | Azion Cache | Azion KV Store |
|---|---|---|---|
| Type | In-memory cache | HTTP cache | Distributed key-value store |
| Engines | Redis and Memcached | HTTP responses | Azion.KV, from inside a function |
| Persistence | Optional, with Redis AOF or RDB | Expires with Max Age | Persists until the key expires or is deleted |
| Data structures | Strings, hashes, lists, sets, and sorted sets | HTTP responses | One value per key: a string, an object, an ArrayBuffer, or a stream |
| Replication | Cluster mode and replication groups | Tiered Cache | Azion’s distributed infrastructure |
| Access | TCP connection | HTTP request and response | Runtime API |
put refuses a Map, a Set, a WeakMap, a WeakSet, a RegExp, and a SharedArrayBuffer with INVALID_VALUE_TYPE. Convert them to arrays first.
| ElastiCache use | Destination on Azion |
|---|---|
| HTTP response caching | Cache |
| Session storage | KV Store |
| Rate-limit counters | KV Store |
| Feature flags | KV Store |
| Database query caching | Cache and Functions |
| Pub/Sub messaging | - |
| Leaderboards and sorted sets | SQL Database |
| Complex data structures | SQL Database |
Redis commands become KV Store calls:
delete resolves whether or not the key existed. For HTTP caching, refer to Recreate cache settings and to Cache settings.
Move S3 buckets to Object Storage
Object Storage holds images, documents, static assets, media, uploads, and generated files. It speaks the S3 protocol, so S3 tools and SDKs reach it with a new endpoint, a region, and a key pair.
| Aspect | Amazon S3 | Azion Object Storage |
|---|---|---|
| Endpoint | https://s3.amazonaws.com/bucket | https://s3.us-east-005.azionstorage.net |
| Region | Multiple regions | us-east-005 |
| Data transfer | Charged per GB | No data-transfer charge on Object Storage. Delivery to users goes through a workload, billed as Workloads data transfer |
| Storage classes | Standard, Intelligent-Tiering, and Glacier | - |
| Buckets per account | 100 by default | 100 |
The key pair comes from an Object Storage credential. The secret_key comes back only in the create response, so store it then. To migrate, the credential needs at least listBuckets, listFiles, and writeFiles, plus listAllBucketNames to list the buckets. deleteFiles requires writeFiles.
To create the credential in Azion Console, use Create Credential in Object Storage. Select the capabilities List Files, Read Files, Write Files, List All Bucket Names, and List Buckets, then save the keys it shows.
A Node.js migration script reaches Object Storage with the AWS SDK. Only the region, the endpoint, and the keys change:
Create the destination bucket before you copy, in Azion Console, the API, or the CLI. S3 tools cannot create or remove a bucket on Azion: s3cmd mb and s3cmd rb are refused with 403 AccessDenied. A bucket name takes 6 to 63 characters, is unique across all accounts, and cannot start with azion.
To copy the data with s3cmd:
-
Run
s3cmd --configure -c ~/.s3cfg-azion, and enter these values:- Access Key and Secret Key: the key pair of the credential.
- Default Region:
us-east-005. - S3 Endpoint:
s3.us-east-005.azionstorage.net. - DNS-style bucket+hostname template:
%(bucket).s3.us-east-005.azionstorage.net. - Use HTTPS protocol:
true.
-
Configure a second file,
~/.s3cfg-aws, with the keys of the AWS account. One s3cmd configuration holds one endpoint. -
Download the S3 objects:
-
Upload them to Azion:
The objects are in the Azion bucket. To check, list them with s3cmd -c ~/.s3cfg-azion ls s3://azion-bucket/. s3cmd ls with no bucket lists every bucket, which needs listAllBucketNames. s3cmd put file.png s3://my-bucket/ uploads an object, and s3cmd get s3://my-bucket/file.png downloads one.
The AWS CLI reaches Azion through a profile and --endpoint-url. One command reaches one endpoint, so the copy also goes through a local folder:
In aws configure, enter the Azion access key, the secret key, and us-east-005 as the region. The last command uploads the folder to the Azion bucket.
rclone holds one remote for each provider, so it copies from S3 to Azion in one command. Create the remotes with rclone config:
aws-s3: storages3, providerAWS, andenv_authset totrue.azion: storages3, providerOther, endpointhttps://s3.us-east-005.azionstorage.net, andaclset toprivate.
Then sync:
--progress prints the transfer as it runs. Azion Console refuses a single upload over 300 MB. The API and S3 tools are not bound by that limit. Before the move, map the buckets, the object prefixes, the public and private assets, the access patterns, and the signed URL logic. Bucket access to workloads is read_only, read_write, or restricted, and a credential works independently of it. For the S3 operations, refer to S3 compatibility and Use S3-compatible tools.
Serve a bucket through an application
Public delivery goes through a connector and an application, not through the S3 endpoint. A connector of type storage reads a bucket of your account, narrowed to a prefix.
To create the connector with the Azion CLI, save the body of the API panel as connector.json, and run azion create connector --type storage --file connector.json. For the other fields, refer to Connector settings.
For the buckets and their objects, refer to Create and modify a bucket, Upload and download objects, Use a bucket as origin, and the Storage library.
Move DynamoDB queries and RDS databases to SQL Database
SQL Database uses the SQLite dialect and is fully ACID-compliant. One main instance takes every write, and read replicas answer reads. SQL Database is in Preview on every plan.
| Aspect | Amazon RDS and Aurora | Azion SQL Database |
|---|---|---|
| Engines | MySQL, PostgreSQL, MariaDB, Oracle, and SQL Server | SQLite’s dialect |
| Architecture | Primary and read replicas | One main instance and read replicas |
| Connection | Connection string and connection pooling | Database.open() from the Azion.Sql global, with no pool to manage |
| Writes from code | Through the connection | Through the API. A runtime connection is read-only |
| Transactions | ACID | ACID |
| Scaling | Vertical scaling and read replicas | Distributed architecture |
| Vector search | Engine-specific | Supported, with vector columns, libsql_vector_idx, and vector_top_k. Refer to Vector search |
A function reads the database through a read-only replica connection. Azion.Sql is a global, and the azion:sql import fails the build. A query parameter must be a number: a JavaScript string is refused with TypeError: unknown variant `String` . Write a text value as a literal in the SQL instead:
rows.next() returns the next row, or null after the last one, and row.getString(i) reads a column by index. An insert or delete through the connection fails with attempt to write a readonly database. Under azion dev, Azion.Sql is undefined, so test the code on a deployed function. For server-side scripts, the @aziontech/sql package manages databases through the API.
The Azion CLI has no SQL Database command. Create the database in Azion Console or through the API.
A database name takes 6 to 50 characters of letters, numbers, and hyphens, and it cannot change after creation. For the steps, refer to Create the database.
To move the data, export it from AWS. A PostgreSQL database exports to INSERT statements:
An Aurora cluster can also export a snapshot to S3:
A DynamoDB export becomes INSERT statements after you transform its items. Then run the statements through one of these paths:
- The API: send the statements in the
statementsarray of aPOSTrequest tohttps://api.azion.com/v4/workspace/sql/databases/<database-id>/query. One call takes 100 statements. A failed statement still returns HTTP200, with anerrorkey in place ofresults. When nothing can run, the request returns422with14005. - The EdgeSQL Shell:
.read export.sqlruns the script. The shell does not start on a clean install, so check EdgeSQL Shell before you rely on it. To install it, refer to Install SQL Shell.
Azion has no import API. For the other import formats, refer to Import data into SQL Database. For the runtime API, refer to SQL Database runtime API.
pg_dump writes PostgreSQL types, and SQLite stores each value in its own type classes. Convert the column types in the schema before the import:
| PostgreSQL type | SQLite type |
|---|---|
| INTEGER, BIGINT, SMALLINT | INTEGER |
| SERIAL, BIGSERIAL | INTEGER, with auto-increment |
| VARCHAR(n), CHAR(n), TEXT | TEXT |
| BOOLEAN | INTEGER, 0 or 1 |
| REAL, DOUBLE PRECISION | REAL |
| DECIMAL, NUMERIC | REAL |
| DATE, TIME, TIMESTAMP | TEXT, in ISO 8601 format |
| JSON, JSONB | TEXT, read with the JSON functions |
| UUID | TEXT |
| BYTEA | BLOB |
For the SQL each statement accepts, refer to the SQLite language reference.
Protect the application with WAF
Web Application Firewall scores requests against eight threat families: cross-site scripting, directory traversal, evading tricks, file upload, identified attack, remote file inclusion, SQL injection, and unwanted access. A WAF rule set holds a sensitivity for each family, and a firewall rule applies it with Set WAF.
| Aspect | AWS WAF | Azion WAF |
|---|---|---|
| Rule language | JSON rules in a web ACL | Criteria of Rules Engine for Firewall |
| Managed rules | AWS Managed Rules and Marketplace rules | One managed ruleset, scored per threat family |
| Custom rules | Rules of a web ACL | Rules Engine for Firewall |
| Scope | Regional or CloudFront | The workloads the firewall is bound to |
| Modes | Count and Block | Logging and Blocking |
Map each AWS managed rule group to the families of the one Azion ruleset:
| AWS managed rule group | Azion equivalent |
|---|---|
| AWSManagedRulesSQLiRuleSet | The sql_injection threat family |
| AWSManagedRulesXSSRuleSet | The cross_site_scripting threat family |
| AWSManagedRulesCommonRuleSet | The managed ruleset, with all eight families |
| AWSManagedRulesLinuxRuleSet | - |
| AWSManagedRulesPHPAppRuleSet | - |
mode is required on every Set WAF behavior, and it has no default. Start in Logging, which matches the AWS Count action, to check what the rule set would block. Then switch to Blocking. In Blocking mode, a request the rule set blocks receives 400. To keep a legitimate request from matching, add a WAF exception or use the Tuning tab, and review the blocked requests in Real-Time Events.
To bind a firewall with the Azion CLI, pass --firewall-id to the workload deployment. For the rule set and the rule, follow the WAF quickstart.
Convert each AWS WAF custom rule to firewall criteria. Firewall variables differ from application variables: the path is ${request_uri}, and an address range goes in a network list matched with ${network}.
The same rule as Azion criteria, with the IP set moved to a network list:
The ${network} criterion requires Network Shield on the firewall. For the variables and operators, refer to Rules Engine for Firewall. For code that inspects requests, refer to Functions for Firewall.
Recreate IP sets and threat lists
AWS WAF IP sets and the threat findings of GuardDuty become network lists on Azion. A network list holds IP addresses and CIDR ranges, ASNs, or countries, with 1 to 20,000 items. A firewall rule matches the client address against it through the ${network} criterion, which requires Network Shield.
| Aspect | AWS security services | Azion |
|---|---|---|
| Threat detection | GuardDuty | Firewall rules and network lists |
| Vulnerability scanning | Inspector | - |
| Centralized findings | Security Hub | Real-Time Events, with WAF fields on HTTP Requests, and Data Stream to a SIEM |
| Threat intelligence | GuardDuty threat feeds | The Azion IP Tor Exit Nodes list, ID 2 |
| Audit logs | CloudTrail | The Activity History data source, kept for 2 years |
Azion maintains one list for every account: Azion IP Tor Exit Nodes, with ID 2. No account can change it, and a write to it is refused with 22004. A country list is a list you create with the countries type.
Move the findings in this order:
- Export the GuardDuty findings, and put the addresses of IP-based threats in a network list.
- Fix the Inspector findings in the application before the move. WAF protects the application at run time.
- Read the CloudTrail equivalents in the Activity History data source of Real-Time Events.
- Send the logs that Security Hub collected to a SIEM, such as IBM QRadar or Splunk, with Data Stream.
To create a list with the Azion CLI:
--add-item and --remove-item change single items of an existing list. For the flags, refer to Network lists.
Then reference the list in a request rule of the firewall, at /v4/workspace/firewalls/<firewall-id>/request_rules:
The list ID is a JSON integer. An ID sent as a string is refused with 25042, and a firewall without Network Shield refuses the rule with 25047. A list deletes only when no rule references it.
Rely on DDoS Protection
DDoS Protection is on for every workload, with nothing to create and nothing to configure. It mitigates volumetric, protocol, and application-layer attacks, such as UDP and ICMP floods, SYN floods, packet fragmentation, HTTP floods, and slowloris, on layers 3, 4, 6, and 7.
| Aspect | AWS Shield | Azion DDoS Protection |
|---|---|---|
| Standard protection | Automatic, at no cost | Automatic, and it cannot be turned off |
| Advanced protection | Shield Advanced, at an additional cost | Custom firewall rules |
| Layers | 3, 4, and 7 | 3, 4, 6, and 7 |
| Response team | Shield Advanced only | The Security Response Team, an add-on to Enterprise and Mission-Critical support |
| Billing | Cost protection with Shield Advanced | Unmetered for layers 3 and 4. Layer 7 mitigation can generate chargeable traffic |
A firewall shows the DDoS Protection Unmetered switch in Main Settings > Modules, always on. In the API, modules.ddos_protection is read-only. DDoS Protection has no thresholds, no per-rule switches, and no alerts. For targeted mitigation, write custom rules on the firewall bound to the workload. For the attack types, refer to Attack mitigation.
Network Shield is a different module of the firewall. It matches the client address against a network list of IP addresses, CIDR ranges, ASNs, or countries, through the ${network} criterion. Use it to block or allow sets of clients, restrict countries, or rate-limit a set of clients.
Recreate bot management
Bot Manager scores each request and acts on the score. Bot Manager Lite is the Marketplace function included on every plan, and the full Bot Manager is available on Enterprise.
| Aspect | AWS WAF Bot Control | Azion Bot Manager |
|---|---|---|
| Detection | Machine learning, heuristics, and fingerprinting | Static rules, a dynamic behavioral method in the full Bot Manager, device fingerprints, and reputation network lists |
| Challenge | CAPTCHA and silent challenge | A JavaScript Tag for fingerprinting, and ALTCHA through the redirect action |
| Actions | Allow, Count, Block, and CAPTCHA | allow, custom_html, deny, drop, hold_connection, random_delay, and redirect |
| Lite version | Not available | Bot Manager Lite |
Bot Manager Lite scores a request with 26 static rules, against a threshold that defaults to 30, and takes the deny action by default. It can also check the client against reputation network lists. Tolerance levels belong to the dynamic rules of the full Bot Manager, which Bot Manager Lite does not have.
To set up Bot Manager Lite in Azion Console:
Access Azion Console > Marketplace, search for Bot Manager Lite, and select Install. The installation takes effect at once.
Go to Firewalls, and select a firewall with the Functions module on.
In the Functions Instances tab, create an instance of Bot Manager Lite. In its JSON arguments, set threshold and action.
In the Rules Engine tab, create a rule with the Run Function behavior and the instance.
The firewall scores the requests of the workload. For every argument, refer to Install Bot Manager Lite and Bot Manager Lite. For how a function runs on a firewall, refer to Functions for Firewall. Bot protection from a third party is also available through the Radware Bot Manager integration.
To block a client by its user agent, add a firewall rule:
${header_user_agent} requires the WAF module on the firewall and supports only matches and does not match. The firewall has no allow behavior. To exempt a client, such as Googlebot, add a does not match criterion to the deny rule, or order the rules. A client can send any user agent, so verify a good bot another way. To check the rule:
The response is 403, with the Forbidden error page. A request with a browser user agent, such as Mozilla/5.0, receives the normal response.
Recreate rate limits
Azion limits request rates in two ways, and each covers a different part of what AWS WAF rate-based rules do. AWS counts per IP, header, URI, or method, over a window of 1 minute to 1 hour, and blocks or counts. Use the native Set Rate Limit behavior of a firewall rule to cap the requests per second or per minute. It counts per client IP address or across all clients. Use the Upstash Rate Limiting integration, a rate limit with penalty run as a firewall function, for custom keys, custom windows, or a penalty period.
| Capability | Native Set Rate Limit | Upstash Rate Limiting function |
|---|---|---|
| Count key | Client IP address or global | Any combination of request metadata, headers, and the hostname |
| Window | Per second or per minute | Any interval in seconds or minutes, with different limits for different times of day |
| Algorithm | Leaky bucket, counted in each data center | Fixed window, sliding window, or token bucket, counted globally |
| Response | 429, with no rate-limit header | 429 at the limit, and 403 during a penalty |
| Log-only action | None | None |
| Requirements | None | An Upstash account and Global Database |
Use the native rate limit
A Set Rate Limit behavior counts the requests its rule matches. The criteria of the rule scope the limit, such as the path with ${request_uri}, or the method, which requires WAF on the firewall. Rate Limit Type is Req/s or Req/min, and Limit By is Client IP address or Global. Average Rate Limit takes at least 1, and Maximum Burst Size takes at least 1 and applies to Req/s only. No behavior can follow Set Rate Limit in a rule. A rule whose criteria join several paths with or shares one count across all of them.
To create the rule with the Azion CLI, save the rule body of the API panel in a file. Then pass the file with --file to the firewall rule command. For the commands, refer to Firewall quickstart.
A request beyond the rate and the burst receives 429, with the error page titled Too Many Requests. For how the rate and the burst admit requests, refer to Set Rate Limit. For the instances a firewall runs, refer to Functions instances.
Use the rate limit with penalty
The Upstash Rate Limiting function keeps its counters in an Upstash Global Database. It therefore counts every request across the network, not in each data center. A request during a penalty receives 403 Forbidden. A valid request is counted, and the function returns 429 Too Many Requests when the count reaches the limit.
To set it up in Azion Console:
Access Azion Console > Marketplace, search for Upstash Rate Limiting, and select Install.
Go to Firewalls, and open a firewall with Functions turned on in Modules.
In the Functions Instances tab, create an instance. In Function, select the Upstash Rate Limiting function, and edit the JSON Arguments.
In the Rules Engine tab, create a rule with criteria such as Host matches yourdomain.com, and the Run Function behavior with the instance.
Run the CLI command that creates the workload deployment with the firewall:
The function counts the requests the rule matches. These arguments set a sliding window of 2 requests per 20 seconds from midnight to noon UTC, with a 45-second penalty:
| Argument | Description |
|---|---|
upstash_redis_rest_url, upstash_redis_rest_token | The REST URL and the token of the Upstash database that stores the counters and the penalties |
rate_limit_prefix | A prefix for every key, which keeps two instances of the function apart |
rate_limit_key_metadata | The request metadata that forms the key, such as remote_addr |
rate_limit_key_header | The headers that form the key |
rate_limit_key_hostname | When true, the hostname is part of the key |
rate_limit_repenalize | When true, every request during a penalty restarts it |
rate_limits | The windows, at least one. When two windows overlap, the first one in the list applies |
algorithm | fixed_window, sliding_window, or token_bucket |
requests | The requests allowed in the interval |
interval | The window, as a number and s or m. For example: "120 s" |
start, end | The time of day the window covers, in 24-hour UTC. They default to 00:00 and 23:59 |
penalty_in_seconds | How long a client that exceeds the limit receives 403. Without it, the window is a plain rate limit |
max_tokens, refil_rate | The bucket size and the refill per interval of a token_bucket window. refil_rate is the spelling the function reads |
The key joins the prefix and every value the arguments select. In this example, it is my_rate_limit + client IP + x-a-custom-header value + hostname, such as my_rate_limit_127.0.0.1_Value_azion.com. For the full setup, refer to Install the Upstash Rate Limiting integration.
Rebuild monitoring
Azion splits observability across three products. Real-Time Metrics charts aggregates over time, Real-Time Events answers queries about individual requests, and Data Stream sends the logs to external destinations.
Real-Time Metrics
| Aspect | Amazon CloudWatch metrics | Azion Real-Time Metrics |
|---|---|---|
| Data freshness | 1-5 minutes | Up to 10 minutes to aggregate |
| Retention | 15 months | 2 years, except 90 days for httpBreakdownMetrics and 60 days for botManagerBreakdownMetrics |
| Query method | GetMetricStatistics API and CloudWatch Insights | Dashboards, Copy query, Export CSV, and the GraphQL API |
| Metrics | Custom metrics in namespaces | Requests, data transferred, status codes, cache offload, average request time, WAF threats, and DNS queries |
| Granularity | 1 second to 1 day | 1 minute under 2.5 days, 1 hour up to 60 days, and 1 day beyond |
| Dashboards | CloudWatch dashboards | Real-Time Metrics and the Grafana plugin |
| Alarms | CloudWatch alarms | Alerts in the destination of a Data Stream stream, such as Datadog or Splunk |
The dashboards cover these products:
- Applications: Requests, with total requests, requests by method, and Average Request Time, the average time in seconds Azion takes to process and answer a request. Status Codes, with the 2XX, 3XX, 4XX, and 5XX responses. Data Transferred, Bandwidth Saving, and Edge Offload.
- Functions: Total Invocations, split into invocations on applications and on firewalls.
- Image Processor: Total Requests and Total Requests per Second.
- Tiered Cache: the Caching Offload dashboard, with the Tiered Cache and Tiered Cache Offload charts.
- WAF: Threats vs Requests, the cross-site scripting, remote file inclusion, and SQL injection threats, and the threats by country, family, and host.
- Edge DNS: Total Queries.
- Bot Manager: Bad Bot Hits, Good Bot Hits, Bot Hits, and Transactions. The tab needs a Bot Manager subscription.
- Data Stream: Total Data Streamed and Total Requests.
Real-Time Metrics reports no latency, time to first byte, or origin response time. To read the cache status of the requests, filter a dashboard by Upstream Cache Status, whose values include HIT, MISS, STALE, and EXPIRED. To find origin errors, filter by Upstream Status, which is 0 when the origin did not answer.
To open the dashboards, access Azion Console > Real-Time Metrics. It opens on Build > Applications > Data Transferred, over the Last 5 minutes. Select a category tab, Build, Secure, or Observe, then a product tab. To narrow a dashboard to one workload, add the Domain or Workload filter. To export a chart, open its More options menu and select Export CSV.
To query the same data, send a GraphQL query to https://api.azion.com/v4/metrics/graphql. This query counts the requests by status code:
This query sums the bytes sent for one host, per time bucket:
Replace the dates with a range inside the retention period. A range past it returns an empty array. limit takes up to 10,000 rows and defaults to 10. A calculated field, such as dataTransferredOut, cannot be aggregated. The httpMetrics dataset of older queries still works, but it is deprecated. To query a WAF chart, such as the threats by country, open its More options menu and select Copy query.
For every field, refer to Real-Time Metrics GraphQL fields and Build dashboards. For dashboards in Grafana, refer to Grafana plugin custom dashboards, pre-built dashboards, and the Azion Grafana plugin repository. To read the dashboards, refer to Analyze metrics.
Real-Time Events
| Aspect | Amazon CloudWatch Logs | Azion Real-Time Events |
|---|---|---|
| Access | GetLogEvents API and CloudWatch Logs Insights | Queries in Azion Console or the GraphQL API |
| Delay | Seconds to minutes | Up to 30 seconds |
| Retention | 1 day to 10 years | 7 days, or 168 hours. Activity History keeps 2 years. For longer retention, use Data Stream |
| Query language | CloudWatch Logs Insights | GraphQL, with the fields you select |
| Organization | Log groups with log streams | Data sources by product |
| Metric filters | Metrics created from logs | Data Stream to an external destination |
Real-Time Events needs no setup. Each CloudWatch log group maps to a data source:
| CloudWatch log group | Real-Time Events data source |
|---|---|
/aws/cloudfront/... | HTTP Requests |
/aws/lambda/... | Functions |
/aws/waf/... | HTTP Requests, which carries the WAF fields |
/aws/route53/... | Edge DNS |
| CloudTrail | Activity History |
The other data sources are Functions Console, Image Processor, Tiered Cache, and Data Stream.
To query the events in Azion Console:
Access Azion Console > Products menu > Observe > Real-Time Events.
Select the data source, such as HTTP Requests.
Set the Time Filter, which opens on the last 15 minutes. In Filter by, add conditions such as the host, the status, or the remote address.
The results table lists the events. Select a row to open the More details view, with every variable of the record. A custom time range stays inside the last 168 hours.
A CloudWatch Logs Insights query filters and sorts the log lines:
To query the same data, send a GraphQL query to https://api.azion.com/v4/events/graphql. The workloadEvents dataset holds the HTTP requests:
Replace the dates with a range inside the last 7 days. statusGte: 500 keeps the server errors, and statusEq: 500 keeps one status. upstreamResponseTime reads - for a response served from cache. The Activity History data source answers queries over 2 years.
The datasets carry these fields, among others:
- HTTP Requests:
ts,remoteAddress,remotePort,host,requestUri,requestMethod, andstatus. Timing:requestTime,upstreamResponseTime, andupstreamHeaderTime. Bytes:bytesSent,requestLength,upstreamBytesReceived, andupstreamBytesSent. Cache:upstreamCacheStatus. WAF:wafBlock,wafMatch,wafScore, andwafLearning, which reports the Logging mode. Location:geolocCountryName,geolocRegionName, andgeolocAsn. TLS:sslCipherandsslProtocol. - Functions:
functionsInstanceIdList,functionsList,functionsTime, andfunctionLanguage. - Edge DNS:
level,qtype,resolutionType,statusCode, andzoneId.
For every field, refer to Real-Time Events GraphQL fields and Investigate requests with the GraphQL API.
Data Stream
| Aspect | Amazon Data Firehose | Azion Data Stream |
|---|---|---|
| Access | Delivery to configured destinations | Push to an external destination |
| Delay | Buffered delivery | Batches of 2,000 records or 60 seconds, delivered within 3 minutes |
| Retention | Set by the destination | Set by the destination |
| Format | Records, with optional Lambda transformation | Templates that select the fields |
| Destinations | S3, Redshift, OpenSearch, and HTTP endpoints | 11 types, listed below |
A stream sends one data source to one destination:
- Storage: Amazon S3, Azure Blob Storage, and Azion Object Storage, through the S3 type.
- Monitoring: Datadog, Splunk, Elasticsearch, and Azure Monitor.
- Streaming: AWS Kinesis Data Firehose and Apache Kafka.
- Analytics: Google BigQuery.
- Security: IBM QRadar.
- Custom: Standard HTTP/HTTPS POST.
Each Firehose destination maps to an endpoint type:
| Firehose destination | Data Stream endpoint |
|---|---|
| S3 | S3, for any S3-compatible storage |
| Redshift | Google BigQuery, or Standard HTTP/HTTPS POST |
| Elasticsearch | Elasticsearch |
| HTTP endpoint | Standard HTTP/HTTPS POST |
| Lambda transformation | A custom template that selects the fields. Data Stream runs no code on the records |
A CloudWatch metric filter or alarm becomes a stream to a monitoring destination, such as Datadog or Splunk, which counts and alerts there. A stream needs exactly one of sampling or a workload filter. Saving an active sampled stream deactivates every other stream on the account. Filtered streams coexist.
To create a stream with the Azion CLI, follow the CLI panel of the Data Stream quickstart.
For an Object Storage destination, the credential needs listAllBucketNames, listBuckets, listFiles, and writeFiles, or every send fails with 503. For the fields, refer to Stream settings and Endpoints. For destination guides, refer to Amazon S3, Azion Object Storage, Datadog, Splunk, Elasticsearch, Kinesis, BigQuery, and Configure sampling.
Replace X-Ray tracing
Azion collects no traces and draws no service map. Each request log carries a unique ID, $request_id, which a tracing tool joins with the logs of your other services. Data Stream sends those logs to the tool, and a function passes a trace ID to the origin.
| Aspect | AWS X-Ray | Azion |
|---|---|---|
| Trace collection | Automatic with the X-Ray SDK | Request logs sent by Data Stream to an external tool |
| Service map | Built-in service map | The external tool, such as Datadog or Splunk |
| Trace analysis | X-Ray console | The external tool |
| Annotations | Custom key-value pairs | The variables of a custom template |
| Sampling | Sampling rules | A sampling rate from 1 to 100 percent |
| Destinations | X-Ray console and CloudWatch | 11 endpoint types |
| X-Ray concept | Azion equivalent |
|---|---|
| Segment | A request log entry, from the Applications data source |
| Subsegment | A function log entry, from a second stream with the Functions data source |
| Service graph | The service map of the external tool |
| Trace ID propagation | A header that a function adds to the request it forwards |
| Annotation | A variable of the custom template |
Data Stream reaches these tracing tools: Datadog, Splunk, Elasticsearch, Apache Kafka, which feeds Jaeger or Zipkin, Google BigQuery, AWS Kinesis Data Firehose, and Standard HTTP/HTTPS POST for a custom system.
To send the trace fields, create a custom template with a POST request to https://api.azion.com/v4/workspace/stream/templates. The data_set is a JSON object, sent as a string, whose values are variables:
The response carries the template id. Use it in render_template of a stream with the workloads data source, as the Data Stream stage shows, and a Datadog or Splunk output. In Azion Console, Create Custom Template in the Render Template section opens the same form. A stream holds one data source, so function logs go in a second stream with the functions_console data source.
To pass a trace ID to the origin, run a function that forwards the request. It reads the incoming ID, or uses the Azion request ID:
The origin receives X-Trace-Id, and the client receives the same request ID in the x-azion-request-id response header. For the variables of each data source, refer to Data sources and variables.
Replace CloudWatch RUM with Edge Pulse
Edge Pulse measures how real visitors reach Azion’s infrastructure from their browsers: navigation, availability, latency, and bandwidth. Every account has it active on every plan, at no additional charge, so there is nothing to create.
| Aspect | Amazon CloudWatch RUM | Azion Edge Pulse |
|---|---|---|
| Collection | JavaScript SDK | A JavaScript tag on each page, the Default Tag or the Pre-loading Tag |
| Metrics | Page load, Core Web Vitals, and JavaScript errors | Navigation, availability, latency, and bandwidth against Azion’s infrastructure |
| Settings | Sampling and custom events | None. The tag has no sampling rate and no custom events |
| Reading the data | The RUM console | Queries to the GraphQL API of Real-Time Events, on the pulseEvents dataset |
To add the tag:
Access Azion Console > Products menu > Observe > Edge Pulse.
Select the Pre-loading Tag for pages whose Content Security Policy rules out inline JavaScript. Otherwise, select the Default Tag.
Paste it before the closing body tag of each page you want measured, and publish the pages.
Each visitor runs one test every 30 minutes. Azion Console has no page that charts the results: read them with the GraphQL API of Real-Time Events. For the steps, refer to Edge Pulse quickstart.
Prepare the certificate
Certificate Manager holds the certificates that workloads serve. Prepare the certificate before the domain points to Azion, so users reach the project over HTTPS from the first request.
| Area | AWS Certificate Manager | Azion Certificate Manager |
|---|---|---|
| Certificate types | Public, private, and imported | Azion SAN, Let’s Encrypt, custom certificates, and Trusted CA certificates for mTLS |
| Validation | DNS and email | Let’s Encrypt HTTP-01 or DNS-01 challenges |
| Renewal | Automatic | Let’s Encrypt certificates renew from 30 days before their 90-day expiry. Custom certificates follow your own lifecycle |
| Scope | Regional, and us-east-1 for CloudFront | TLS certificates for workloads |
| mTLS | Supported, with AWS Private CA | Trusted CA certificates. Azion SAN does not support mTLS |
| Cost | Free for AWS resources | Let’s Encrypt at no additional cost |
| Default certificate | - | Azion SAN covers the azionedge.net workload domain and the azion.app hostname |
| Custom certificates | Imported certificates | Upload of a certificate and its private key, single-domain or SAN, with RSA 2048 or P-256 keys |
| Origin encryption | Origin protocol policy | Transport Protocol Policy of the connector: Preserve, Force HTTPS, or Force HTTP |
Azion issues a Let’s Encrypt certificate once you choose a Let’s Encrypt preset. Pick the challenge by where DNS answers:
- HTTP-01 needs the hostname, and every alternative name, to already point to Azion.
- DNS-01 works before the move. At an external DNS provider, such as Route 53, add a CNAME from
_acme-challenge.<domain>to<domain>.letsencrypt.azion.com. In Edge DNS, the record is automatic.
For a move from AWS, use DNS-01.
To set mTLS or the certificate of a workload with the Azion CLI, run azion update workload --file with the workload body. For the certificate commands, refer to Certificate Manager quickstart.
If the certificate does not become active, read its status and status_detail. For HTTP-01, check that the hostname points to Azion. For DNS-01, check the _acme-challenge CNAME. Retries continue on schedule, so a fixed record issues the certificate later. On a TLS handshake failure, check that the certificate covers the hostname and that the intermediates are in the certificate field. Then check the minimum_version of the workload. For the issuance rules, refer to Issuance and renewal.
mTLS needs a Trusted CA certificate, and an Azion-generated certificate cannot be the Trusted CA. An AWS Private CA certificate can be exported and uploaded with the Trusted CA Certificate preset. Sales activates mTLS on the account. Then set mtls.enabled, mtls.config.certificate, and verification, enforce or permissive, on the workload through the API or azion update workload --file. mTLS works over HTTPS only. For the steps, refer to Configure mTLS on a workload and mTLS.
Move Route 53 zones to Edge DNS
Moving the zone to Edge DNS gives Azion every record of the domain, including the apex. Every zone uses the same three nameservers, ns1.aziondns.net, ns2.aziondns.com, and ns3.aziondns.org. Skip this stage when you keep Route 53 and point only subdomains, as Point the domain to the workload shows.
| Aspect | Amazon Route 53 | Azion Edge DNS |
|---|---|---|
| Nameservers | Assigned per hosted zone | ns1.aziondns.net, ns2.aziondns.com, and ns3.aziondns.org for every zone |
| Record types | A, AAAA, CNAME, MX, TXT, SRV, NS, SOA, PTR, and CAA | A, AAAA, ANAME, CAA, CNAME, DS, MX, NS, PTR, SRV, and TXT |
| Routing policies | Simple, weighted, latency, failover, and geolocation | Simple and Weighted |
| Health checks | Route 53 health checks | None |
| DNSSEC | Supported | Supported |
| API | REST API | /v4/workspace/dns/zones |
Map each routing policy:
| Route 53 policy | Azion equivalent |
|---|---|
| Simple | Simple (simple), which answers with every value of the record |
| Weighted | Weighted (weighted): several records share a name and a type, each answered in proportion to its weight |
| Latency | - |
| Failover | -. For origins, Load Balancer sends traffic to Backup addresses when every primary fails |
| Geolocation | - |
A weight takes 0 to 255, and 0 keeps the record without answering it. The API defaults to 255, and the Console fills in 100. TXT and NS records refuse the Weighted policy with 19017.
Recreate each Route 53 record with its type:
| Record | Use on Azion |
|---|---|
| A | IPv4 address |
| AAAA | IPv6 address |
| ANAME | Alias of the apex to an Azion hostname, such as the workload domain. Its TTL must be 20 |
| CNAME | Alias to another name. It holds exactly one value and cannot sit at the apex |
| MX | Mail exchange, with its priority |
| TXT | Text, such as SPF and DKIM |
| SRV | Service records, one per name |
| CAA | Certificate authorities allowed to issue for the domain |
| NS | Delegation of a subdomain |
| DS | Delegation signer of a signed child zone |
| PTR | Reverse lookup |
Edge DNS refuses other types, such as SOA. A, AAAA, ANAME, DS, MX, and NS records hold up to 10 values each.
To create zones and records with the Azion CLI, follow the CLI panel of the Edge DNS quickstart. Boolean flags need =, such as --active=false.
With DNSSEC on, Edge DNS shows four DS values: Key Tag, Algorithm 13, Digest Type 2, and Digest. Reload the page after you save to see them. Add them at the registrar, which can take up to 48 hours to publish them. For the steps, refer to DNSSEC.
To check the move, query the nameservers and the records, and compare the answer of Route 53 with the answer of Edge DNS:
The first command lists the three Azion nameservers once the registrar change propagates, which can take up to 48 hours. The second shows the answer the resolver returns now. The third and the fourth show the answers of Route 53, with your own Route 53 nameserver, and of Edge DNS. With DNSSEC on, the last returns two DNSKEY records, with flags 257 and 256 and algorithm 13. Do not query a new name before its record exists: Edge DNS caches the negative answer for one hour. For more commands, refer to Run the dig command and Run the traceroute command.
Point the domain to the workload
The DNS change is the switch: once the domain resolves to the workload, users reach the project through Azion. A domain change affects users, search rankings, and availability, so treat it as a controlled cutover. Before you switch, confirm that:
- The certificate is active.
- The hostname is in the Domains of the workload.
- The DNS records are ready.
- The critical routes and the redirects answer as expected on the workload domain. To test them under the real hostname before the switch, refer to Test an application through the hosts file.
- Monitoring is ready to watch the traffic after the switch.
Point each name with the record its zone allows:
| Strategy | Use it for | Record |
|---|---|---|
| CNAME | A subdomain, keeping Route 53 as the DNS provider | www CNAME <your-workload-domain> |
| Nameservers | The apex and every other name, with Edge DNS answering for the zone | An ANAME at the apex to the workload domain |
To check a CNAME:
The answer is the workload domain, such as xxxxxxxxxx.map.azionedge.net. DNS changes take time to propagate. For the Console settings of the custom domain, refer to Point a domain to a workload. To move the nameservers, refer to Migrate the nameservers to Azion.