Skip to main content
In ubx, every cloud resource is declared with a unit block. Each unit maps 1:1 to a Pulumi provider resource.

Resource Addresses

Resources are addressed using dot notation:
unit.resource_type.name
Examples:
  • unit.aws_s3_bucket_v2.assets
  • unit.aws_rds_instance.db
  • unit.google_storage_bucket.media

Resource Outputs

Every cloud resource has output attributes — values known only after the resource is created. Access them with the ~ prefix:
~unit.aws_rds_instance.db.endpoint   # Pending<string>
~unit.aws_s3_bucket_v2.assets.arn    # Pending<string>
~unit.aws_eks_cluster.cluster.name   # Pending<string>

Providers and Resource Types

ubx uses the same resource type names as Terraform/Pulumi, in snake_case:
ProviderExample type
AWSaws_rds_instance, aws_s3_bucket_v2, aws_vpc
GCPgoogle_storage_bucket, google_sql_database_instance
Azureazurerm_resource_group, azurerm_storage_account
KubernetesUsed via deploy and sync blocks
Run ubx schema list to see all registered types. Run ubx docs <type> --list to see fields.

Viewing Resource Schema

ubx docs aws_rds_instance --list
# Required:
#   engine               string
#   instance_class       string
#   ...
# Optional:
#   allocated_storage    number
#   multi_az             bool
#   ...

Resource Lifecycle

Resources go through these states:
  1. Plannedubx plan shows what will happen
  2. Createdubx apply provisions the resource
  3. Updatedubx apply after attribute changes
  4. Refreshedubx refresh syncs state with actual cloud
  5. Destroyedubx destroy removes the resource