Skip to content

Reference

Lookup tables for the tunnel. The narrative for each is in the earlier chapters.

ResourcePatternExample
Cloudflare Tunneladv-cflared-{env}adv-cflared-prd
Launch template / ASGadv-cflared-{env}adv-cflared-prd
Runtime IAM role / instance profileadv-cflared-runtime-{env}adv-cflared-runtime-prd
Security groupadv-cflared-{env} runtime SGper environment
Image Builder recipe / pipelineadv-cflared-recipe / adv-cflared-pipelineshared, env-agnostic
Image Builder componentsadv-cflared-cloudflared, adv-cflared-bootstrap-script, adv-cflared-newrelicshared
AMI distribution nameadv-cflared-{buildDate}tagged adv:image=cflared
SSM AMI pointer/adventive/cloudflared/ami-id-latestshared
Secrets Manager tunnel secret/adventive/cloudflared/{env}one per environment
Secrets Manager New Relic key/adventive/newrelic/license-keyshared
Instance tagsadv:env, adv:project=cloudflare-tunnel, adv:role=tunnel-runtimeon every instance
AttributeValue
Base imageUbuntu 22.04 LTS (Canonical), latest, via Image Builder recipe
Root volume20 GiB gp3, encrypted, delete on termination
Instance metadataIMDSv2 required, instance tags exposed via IMDS (the bootstrap reads adv:env)
MonitoringDetailed monitoring (1-minute CloudWatch), CloudWatch agent, New Relic Infra agent
Operational accessAWS Systems Manager Session Manager only; no SSH, no inbound ports
Config sourcecloudflared reads /etc/cloudflared/config.yml, written at boot from Secrets Manager

The runtime security group is egress-only; there is no inbound rule.

DirectionPort / ProtoDestinationPurpose
Outbound7844 TCP0.0.0.0/0Cloudflare edge (tunnel control and data)
Outbound7844 UDP0.0.0.0/0Cloudflare edge (QUIC)
Outbound443 TCP0.0.0.0/0Cloudflare edge fallback; AWS APIs (Secrets Manager, SSM, S3)
Outbound3306 TCPAurora cluster SGTunneled MySQL to Aurora
Outbound53, 123VPC resolver, NTPDNS and time
InboundnonenoneAccess is Session Manager only

The runtime role adv-cflared-runtime-<env> attaches AmazonSSMManagedInstanceCore (Session Manager) plus a scoped inline policy granting secretsmanager:GetSecretValue on exactly two secrets: the environment’s tunnel secret (/adventive/cloudflared/<env>-*) and the shared New Relic license key (/adventive/newrelic/license-key-*). It grants no ec2:*, imagebuilder:*, iam:*, and cannot read another environment’s tunnel secret.

TermDefinition
cloudflaredCloudflare’s tunnel daemon; opens an outbound session to the edge and proxies TCP to a private origin.
Named tunnel (config_src = local)A Cloudflare tunnel whose ingress rules live in the host’s config.yml rather than the dashboard.
ConnectorA single cloudflared process registered with a tunnel; Cloudflare load-balances across healthy connectors sharing one tunnel.
Golden AMIThe immutable, pre-provisioned tunnel-host image built by EC2 Image Builder; instances are never patched in place.
Instance refreshThe ASG operation that rolls instances onto a new launch-template or AMI, respecting min_healthy_percentage.
cflared-bootstrapThe boot-time oneshot that resolves the env tag, fetches Secrets Manager credentials and the New Relic key, and writes the host config before cloudflared starts.
VersionDateAuthorSummary
1.02026-07-17Jeffrey LambertGraduated the tunnel plan into the Cloud Connectivity standard.
1.12026-07-17Jeffrey LambertCorrected to as-built: EC2 Image Builder on Ubuntu, Terraform-managed tunnels with Secrets Manager, adv-cflared naming, 7844 egress, systemd-plus-EC2 self-heal, and the New Relic Infrastructure agent (host and process metrics).