Referenceable Parameters

The $ResourceParam directive retrieves deployment-time outputs — URLs, ARNs, hostnames, ports, and connection strings — from supported resource types listed on this page. Use it in environment variables, stack outputs, or any string-valued config property to wire resources together when connectTo doesn't cover your specific use case.

Syntax

$ResourceParam takes two arguments: the resource name (matching the key in your config's resources map) and the parameter name.

export default defineConfig(() => {
  const api = new LambdaFunction({
    packaging: new JsBundleLambdaPackaging({
      entryfilePath: './src/handler.ts'
    }),
    environment: {
      GATEWAY_URL: "$ResourceParam('gateway', 'url')"
    }
  });

  const gateway = new HttpApiGateway({});

  return {
    resources: { api, gateway }
  };
});

The $ResourceParam directive resolves at deploy time. The resulting value is a string — suitable for environment variables, script inputs, stack outputs, or anywhere a string value is accepted in your Stacktape configuration.

Some parameters are only available when a resource is configured a certain way. Each resource's parameter table below notes the conditions under which a given parameter is exposed.

The sections below list the available parameters for each resource type. Not all resource types expose referenceable parameters — those that do are grouped by category.

Compute resources

Stacktape compute resources expose $ResourceParam values such as ARNs, URLs, domains, and log group identifiers. Use these to wire compute outputs into other parts of your configuration.

Lambda function

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

arn
  • Arn of the function

  • Usage: $ResourceParam('<<resource-name>>', 'arn')
logGroupArn
  • Arn of the log group aggregating logs from the function

  • Usage: $ResourceParam('<<resource-name>>', 'logGroupArn')

Web service

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

domain
  • Web service default domain name

  • Usage: $ResourceParam('<<resource-name>>', 'domain')
url
  • Web service default URL

  • Usage: $ResourceParam('<<resource-name>>', 'url')
customDomains
  • Comma-separated list of custom domain names assigned to the Web Service (only available if you use custom domain names)

  • Usage: $ResourceParam('<<resource-name>>', 'customDomains')
customDomainUrls
  • Comma-separated list of custom domain name URLs (only available if you use custom domain names)

  • Usage: $ResourceParam('<<resource-name>>', 'customDomainUrls')
cdnDomain
  • Default domain of the CDN distribution (only available if you DO NOT configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnDomain')
cdnUrl
  • Default url of the CDN distribution (only available if you DO NOT configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnUrl')
cdnCustomDomains
  • Comma-separated list of custom domain names assigned to the CDN (only available if you configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnCustomDomains')
cdnCustomDomainUrls
  • Comma-separated list of custom domain name URLs of the CDN (only available if you configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnCustomDomainUrls')

Private service

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

address

Batch job

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

jobDefinitionArn
  • Arn of the job definition resource

  • Usage: $ResourceParam('<<resource-name>>', 'jobDefinitionArn')
stateMachineArn
  • Arn of the state machine controlling the execution flow of the batch job

  • Usage: $ResourceParam('<<resource-name>>', 'stateMachineArn')
logGroupArn
  • Arn of the log group aggregating logs from the batch job

  • Usage: $ResourceParam('<<resource-name>>', 'logGroupArn')

Worker service

Worker services do not currently expose referenceable parameters. Use connectTo for workload-to-resource wiring.

Multi-container workload

Multi-container workloads do not currently expose referenceable parameters. Use connectTo for workload-to-resource wiring.

Frontend resources

The following frontend resources expose referenceable parameters. Static hosting buckets additionally expose bucket identifiers and — when a CDN is attached — CDN-related parameters. See each resource's parameter table for the exact set of available values.

A website's url is always one URL: the first of its customDomains, or its default Stacktape URL when it has none. customDomainUrls lists every custom domain URL, comma-separated, in the order they are configured. It exists only when the website has custom domains.

Next.js

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

url
  • Website URL

  • Usage: $ResourceParam('<<resource-name>>', 'url')

Astro

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

url
  • Website URL

  • Usage: $ResourceParam('<<resource-name>>', 'url')

Nuxt

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

url
  • Website URL

  • Usage: $ResourceParam('<<resource-name>>', 'url')

SvelteKit

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

url
  • Website URL

  • Usage: $ResourceParam('<<resource-name>>', 'url')

SolidStart

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

url
  • Website URL

  • Usage: $ResourceParam('<<resource-name>>', 'url')

TanStack Start

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

url
  • Website URL

  • Usage: $ResourceParam('<<resource-name>>', 'url')

Remix

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

url
  • Website URL

  • Usage: $ResourceParam('<<resource-name>>', 'url')

Hosting bucket (static sites)

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

name
  • AWS (physical) name of the bucket

  • Usage: $ResourceParam('<<resource-name>>', 'name')
arn
  • Arn of the bucket

  • Usage: $ResourceParam('<<resource-name>>', 'arn')
cdnDomain
  • Default domain of the CDN distribution (only available if you DO NOT configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnDomain')
cdnUrl
  • Default url of the CDN distribution (only available if you DO NOT configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnUrl')
cdnCustomDomains
  • Comma-separated list of custom domain names assigned to the CDN (only available if you configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnCustomDomains')
cdnCustomDomainUrls
  • Comma-separated list of custom domain name URLs of the CDN (only available if you configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnCustomDomainUrls')

Databases

Stacktape database resources expose connection strings, hostnames, ports, and identifiers via $ResourceParam. These are especially useful when connectTo doesn't cover your wiring need — for example, passing a reader connection string to a specific environment variable.

Relational database

Relational databases expose the richest set of parameters. Standard RDS engines provide host, port, and connection strings. Aurora engines additionally expose reader endpoints for read scaling. Read replica parameters are available when replicas are explicitly configured.

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

connectionString
  • Fully-formed connection string that can be used to access the primary instance. For aurora databases, this is connectionString to cluster endpoint, which can be used for both reads and writes. Includes host, port, username, password and dbName.

  • Usage: $ResourceParam('<<resource-name>>', 'connectionString')
jdbcConnectionString
  • Fully-formed connection string in JDBC form that can be used to access the primary instance. Includes host, port, username, password and dbName.

  • Usage: $ResourceParam('<<resource-name>>', 'jdbcConnectionString')
host
  • Hostname (address) of the primary instance that can be used for both reads and writes. For aurora databases, this is hostname of a cluster endpoint, which can be used for both reads and writes.

  • Usage: $ResourceParam('<<resource-name>>', 'host')
port
  • Port of the database.

  • Usage: $ResourceParam('<<resource-name>>', 'port')
dbName
  • Name of the automatically created database (can be configured using the dbName property).

  • Usage: $ResourceParam('<<resource-name>>', 'dbName')
readerHost
  • Hostname (address) used for reads only. (only available for aurora-postgresql and aurora-mysql engines). If you have multiple instances, it is advised to use readerHost for reads to offload the primary (read/write) host. ReaderHost automatically balances requests between available instances. Connections are auto-balanced among available reader hosts.

  • Usage: $ResourceParam('<<resource-name>>', 'readerHost')
readerConnectionString
  • Same as connectionString but targets readerHosts (only available for aurora-postgresql and aurora-mysql engines). Connections are auto-balanced among available reader hosts.

  • Usage: $ResourceParam('<<resource-name>>', 'readerConnectionString')
readerJdbcConnectionString
  • Same as readerConnectionString but in JDBC format (only available for aurora-postgresql and aurora-mysql engines).

  • Usage: $ResourceParam('<<resource-name>>', 'readerJdbcConnectionString')
readReplicaHosts
  • Comma-separated list of read replica hostnames (only available if read replicas are configured). Read replicas can only be used for read operations.

  • Usage: $ResourceParam('<<resource-name>>', 'readReplicaHosts')
readReplicaConnectionStrings
  • Comma-separated list of connection strings (URLs) used to connect to read replicas (only available when read replicas are configured). Read replicas can only be used for read operations.

  • Usage: $ResourceParam('<<resource-name>>', 'readReplicaConnectionStrings')
readReplicaJdbcConnectionStrings
  • Same as readReplicaConnectionStrings but in JDBC format (only available when read replicas are configured).

  • Usage: $ResourceParam('<<resource-name>>', 'readReplicaJdbcConnectionStrings')

DynamoDB table

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

name
  • AWS (physical) name of the table

  • Usage: $ResourceParam('<<resource-name>>', 'name')
arn
  • Arn of the table

  • Usage: $ResourceParam('<<resource-name>>', 'arn')
streamArn
  • Arn of DynamoDb stream (available only if streamType is configured)

  • Usage: $ResourceParam('<<resource-name>>', 'streamArn')

Redis

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

host
  • In case of NON-sharded cluster(default), this is a hostname of the primary instance that can be used for both reads and writes. In case of sharded cluster, this is cluster's configuration endpoint that can be used for all operations.

  • Usage: $ResourceParam('<<resource-name>>', 'host')
readerHost
  • Hostname (address) that can be used for reads only. (only available for NON-sharded clusters). If you use multiple replicas, it is advised to use readerHost for read operations to offload the primary host. ReaderHost automatically balances requests between available read replicas.

  • Usage: $ResourceParam('<<resource-name>>', 'readerHost')
port
  • Port of the cluster.

  • Usage: $ResourceParam('<<resource-name>>', 'port')
sharding
  • Indicates whether cluster is sharded. Available values: enabled or disabled.

  • Usage: $ResourceParam('<<resource-name>>', 'sharding')

MongoDB Atlas cluster

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

connectionString
  • Connection string (URL) that allows connecting to the cluster.

  • Usage: $ResourceParam('<<resource-name>>', 'connectionString')

Upstash Redis

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

host
  • Hostname (address) of the Upstash Redis database.

  • Usage: $ResourceParam('<<resource-name>>', 'host')
port
  • Port of the Upstash Redis database.

  • Usage: $ResourceParam('<<resource-name>>', 'port')
password
  • Autogenerated password that can be used to authenticate towards the database.

  • Usage: $ResourceParam('<<resource-name>>', 'password')
restToken
  • Rest token which can be used when reading/writing from/to the database using the REST API

  • Usage: $ResourceParam('<<resource-name>>', 'restToken')
readOnlyRestToken
  • Rest token which can be used only for reading from the database using the REST API

  • Usage: $ResourceParam('<<resource-name>>', 'readOnlyRestToken')
restUrl
  • Rest URL which can be used when communicating with the database using the REST API

  • Usage: $ResourceParam('<<resource-name>>', 'restUrl')
redisUrl
  • Standard redis url (including password) which can be used for connecting using cli.

  • Usage: $ResourceParam('<<resource-name>>', 'redisUrl')

OpenSearch domain

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

domainEndpoint
  • Endpoint used for communicating with your opensearch-domain

  • Usage: $ResourceParam('<<resource-name>>', 'domainEndpoint')
arn
  • Arn of the domain

  • Usage: $ResourceParam('<<resource-name>>', 'arn')

Storage

Stacktape storage resources expose bucket names, ARNs, and — when a CDN is attached — CDN-related domain and URL parameters via $ResourceParam.

Bucket

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

name
  • AWS (physical) name of the bucket

  • Usage: $ResourceParam('<<resource-name>>', 'name')
arn
  • Arn of the bucket

  • Usage: $ResourceParam('<<resource-name>>', 'arn')
cdnDomain
  • Default domain of the CDN distribution (only available if you DO NOT configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnDomain')
cdnUrl
  • Default url of the CDN distribution (only available if you DO NOT configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnUrl')
cdnCustomDomains
  • Comma-separated list of custom domain names assigned to the CDN (only available if you configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnCustomDomains')
cdnCustomDomainUrls
  • Comma-separated list of custom domain name URLs of the CDN (only available if you configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnCustomDomainUrls')

Networking

HTTP API Gateways and Application Load Balancers expose default domains, custom domain lists, and CDN-related parameters via $ResourceParam. Network Load Balancers expose domain and custom domain parameters but do not support CDN attachment.

HTTP API Gateway

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

domain
  • Default domain name

  • Usage: $ResourceParam('<<resource-name>>', 'domain')
url
  • Default URL

  • Usage: $ResourceParam('<<resource-name>>', 'url')
customDomains
  • Comma-separated list of custom domain names assigned to the HTTP Api Gateway (only available if you use custom domain names)

  • Usage: $ResourceParam('<<resource-name>>', 'customDomains')
customDomainUrls
  • Comma-separated list of custom domain name URLs (only available if you use custom domain names)

  • Usage: $ResourceParam('<<resource-name>>', 'customDomainUrls')
customDomainUrl
  • URL of the first custom domain name connected to this resource (only available if you use custom domain names)

  • Usage: $ResourceParam('<<resource-name>>', 'customDomainUrl')
cdnDomain
  • Default domain of the CDN distribution (only available if you DO NOT configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnDomain')
cdnUrl
  • Default url of the CDN distribution (only available if you DO NOT configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnUrl')
cdnCustomDomains
  • Comma-separated list of custom domain names assigned to the CDN (only available if you configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnCustomDomains')
cdnCustomDomainUrls
  • Comma-separated list of custom domain name URLs of the CDN (only available if you configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnCustomDomainUrls')

Application Load Balancer

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

domain
  • default domain name of load balancer

  • Usage: $ResourceParam('<<resource-name>>', 'domain')
customDomains
  • Comma-separated list of custom domain names assigned to the Load balancer (only available if you use custom domain names)

  • Usage: $ResourceParam('<<resource-name>>', 'customDomains')
cdnDomain
  • Default domain of the CDN distribution (only available if you DO NOT configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnDomain')
cdnUrl
  • Default url of the CDN distribution (only available if you DO NOT configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnUrl')
cdnCustomDomains
  • Comma-separated list of custom domain names assigned to the CDN (only available if you configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnCustomDomains')
cdnCustomDomainUrls
  • Comma-separated list of custom domain name URLs of the CDN (only available if you configure custom domain names for the CDN).

  • Usage: $ResourceParam('<<resource-name>>', 'cdnCustomDomainUrls')

Network Load Balancer

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

domain
  • default domain name of load balancer

  • Usage: $ResourceParam('<<resource-name>>', 'domain')
customDomains
  • Comma-separated list of custom domain names assigned to the Load balancer (only available if you use custom domain names)

  • Usage: $ResourceParam('<<resource-name>>', 'customDomains')

Messaging and orchestration

Stacktape messaging and orchestration resources expose ARNs and names via $ResourceParam, letting you pass event bus, state machine, and stream identifiers into workloads or stack outputs.

Event bus

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

arn
  • Arn of the event bus

  • Usage: $ResourceParam('<<resource-name>>', 'arn')
archiveArn
  • Arn of the event bus archive (available only if the archivation is enabled)

  • Usage: $ResourceParam('<<resource-name>>', 'archiveArn')

State machine

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

arn
  • Arn of the state machine.

  • Usage: $ResourceParam('<<resource-name>>', 'arn')
name
  • AWS (physical) name of the state machine.

  • Usage: $ResourceParam('<<resource-name>>', 'name')

Kinesis stream

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

arn
  • Arn of the Kinesis stream.

  • Usage: $ResourceParam('<<resource-name>>', 'arn')
name
  • AWS (physical) name of the Kinesis stream.

  • Usage: $ResourceParam('<<resource-name>>', 'name')

Security

Stacktape security resources expose identifiers and ARNs via $ResourceParam — user pool IDs, client IDs, and firewall ARNs.

User auth pool

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

id
  • Id of the userpool

  • Usage: $ResourceParam('<<resource-name>>', 'id')
clientId
  • Id of the userpool

  • Usage: $ResourceParam('<<resource-name>>', 'clientId')
domain
  • Domain of the userpool

  • Usage: $ResourceParam('<<resource-name>>', 'domain')

Web application firewall

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

arn
  • Arn of the web-app-firewall.

  • Usage: $ResourceParam('<<resource-name>>', 'arn')
scope
  • Scope of the web-app-firewall (regional or cdn).

  • Usage: $ResourceParam('<<resource-name>>', 'scope')

Platform resources

EFS filesystem

An EFS filesystem exposes both id and arn. connectTo injects both values but does not mount the filesystem; configure an explicit EFS volume mount when the workload needs filesystem access.

Convex

Convex exposes backend URLs, dashboard URL, and sensitive credentials via $ResourceParam. The adminKey and instanceSecret parameters are sensitive and are never auto-injected by connectTo — reference them explicitly with $ResourceParam when needed.

The following parameters can be easily referenced using $ResourceParam directive directive.

To learn more about referencing parameters, refer to referencing parameters.

url
  • Cloud origin (CONVEX_CLOUD_ORIGIN) used by frontend clients.

  • Usage: $ResourceParam('<<resource-name>>', 'url')
siteUrl
  • HTTP-actions origin (CONVEX_SITE_ORIGIN) where httpAction() routes live.

  • Usage: $ResourceParam('<<resource-name>>', 'siteUrl')
dashboardUrl
  • Admin dashboard URL. Only available when the dashboard is enabled.

  • Usage: $ResourceParam('<<resource-name>>', 'dashboardUrl')
adminKey
  • Sensitive root credentials for the deployment, resolved from AWS Secrets Manager. Reference explicitly with $ResourceParam; never auto-injected by connectTo.

  • Usage: $ResourceParam('<<resource-name>>', 'adminKey')
instanceSecret
  • Sensitive boot secret stored in AWS Secrets Manager. Almost never needed by user code.

  • Usage: $ResourceParam('<<resource-name>>', 'instanceSecret')

AgentCore

Stacktape AgentCore resources expose referenceable parameters for wiring AI agent infrastructure. The following AgentCore resource types expose id and arn parameters via $ResourceParam:

Using parameters in practice

The $ResourceParam directive is most commonly used in environment variables and stack outputs. The examples below show the primary patterns for wiring resource outputs into your configuration.

Environment variables

The most common use of $ResourceParam is injecting resource details into workloads via environment variables. Use it when you want to choose your own environment variable name, reference a specific documented parameter directly, or pass a value into a context that connectTo does not support.

In this example, the Lambda function uses connectTo for IAM permissions to access the bucket, and $ResourceParam to read the bucket's ARN into a custom environment variable.

export default defineConfig(() => {
  const uploads = new Bucket({});

  const processor = new LambdaFunction({
    packaging: new JsBundleLambdaPackaging({
      entryfilePath: './src/process.ts'
    }),
    environment: {
      UPLOAD_BUCKET_ARN: "$ResourceParam('uploads', 'arn')"
    },
    connectTo: [uploads]
  });

  return {
    resources: { uploads, processor }
  };
});

Stack outputs

Use $ResourceParam in stack outputs to surface deployment values in the terminal and stack info file. Outputs are useful for sharing endpoints with other teams, CI pipelines, or other stacks.

export default defineConfig(() => {
  const gateway = new HttpApiGateway({});

  return {
    resources: { gateway },
    stackConfig: {
      outputs: [
        {
          name: 'apiUrl',
          value: "$ResourceParam('gateway', 'url')"
        }
      ]
    }
  };
});

Stack outputs can be exported for cross-stack use by setting export: true. Exported outputs can be referenced from other stacks using the $CfStackOutput() directive.

Difference from connectTo

connectTo is a higher-level abstraction for wiring resources together. For supported resource types (databases, buckets, queues, Lambda functions, and others documented on the connecting resources page), connectTo grants IAM permissions, opens security group rules for network-accessible resources like databases and Redis, and injects a predefined set of environment variables automatically.

$ResourceParam gives you access to individual parameters without side effects — no permissions are granted and no security groups are modified. Use $ResourceParam when you want to:

  • Choose your own environment variable name for a resource parameter
  • Use a resource parameter outside an environment variable (e.g. in stack outputs or other resource properties)
  • Reference one of the documented parameters directly from a resource type

Use connectTo when you want Stacktape's documented IAM, networking, and environment-variable wiring. For most workload-to-resource wiring, start with connectTo and add $ResourceParam for any additional parameters you need.

Referenceable Parameters FAQ

How is $ResourceParam different from connectTo?

connectTo is a higher-level abstraction that, for supported resource types, grants IAM permissions, opens security group rules, and injects a predefined set of environment variables. $ResourceParam gives you access to individual parameters without any side effects — no permissions are granted and no security groups are modified. Use connectTo for standard access patterns; use $ResourceParam for specific values, non-standard wiring, or resource types not covered by connectTo.

Can I reference resources from other stacks?

$ResourceParam references resources defined in the same Stacktape configuration. To share values across stacks, use stack outputs with export: true. The source stack's exported values can then be referenced from other stacks using the $CfStackOutput() directive, as documented on the StackOutput type's export property.

What happens if I reference a parameter that doesn't exist?

If you reference a resource name not defined in your config, or a parameter name not supported by that resource type, the configuration is invalid. Check the parameter tables on this page to confirm the parameter name is supported for the resource type you are referencing.

Are CDN parameters always available?

CDN-related parameters (cdnDomain, cdnUrl, cdnCustomDomains, cdnCustomDomainUrls) are only available on resources that have a cdn configuration block attached. Several resource types expose CDN parameters when configured — including buckets, hosting buckets, web services, Application Load Balancers, and HTTP API Gateways. Check the per-resource parameter table above for the exact CDN parameter names exposed by each type.

How do relational database parameters differ between engine types?

Standard RDS engines (Postgres, MySQL, MariaDB) expose core parameters: host, port, connection string, JDBC connection string, and database name. Aurora engines (Aurora PostgreSQL, Aurora MySQL) additionally expose reader endpoints — reader host and reader connection strings — for distributing read traffic. Read replica parameters are a separate set, available only when read replicas are explicitly configured. See the relational database resource page and the parameter table above for the full list.

Can I use $ResourceParam in hooks and scripts?

Yes. Scripts and lifecycle hooks can use $ResourceParam to reference resource outputs — the environment and parameters properties of a script accept directives like $ResourceParam(), which resolve at deploy time. A common pattern is passing a database connection string into a seeding script. A service's releaseCommand gets the service's own environment variables.