Nest repeated playground fields

This commit is contained in:
2026-07-09 19:06:28 +09:00
parent 384d17b539
commit a653f0b7c6
@@ -16,20 +16,26 @@ in
owner = org.teams.checkout; owner = org.teams.checkout;
port = 8443; port = 8443;
replicas = env.capacity.base_replicas + 2; replicas = env.capacity.base_replicas + 2;
resources.cpu_milli = env.capacity.cpu_milli; resources = {
resources.memory_mb = env.capacity.memory_mb; cpu_milli = env.capacity.cpu_milli;
autoscaling.enabled = true; memory_mb = env.capacity.memory_mb;
autoscaling.min = env.capacity.base_replicas; };
autoscaling.max = env.capacity.base_replicas * 4; autoscaling = {
rollout.strategy = match release.risk { enabled = true;
min = env.capacity.base_replicas;
max = env.capacity.base_replicas * 4;
};
rollout = {
strategy = match release.risk {
"high": "canary"; "high": "canary";
"medium": "rolling"; "medium": "rolling";
_: "all-at-once"; _: "all-at-once";
}; };
rollout.canary_percent = match release.risk { canary_percent = match release.risk {
"high": 10; "high": 10;
_: 100; _: 100;
}; };
};
ingress.hosts = env.domains.public ++ ["checkout.internal.example.com"]; ingress.hosts = env.domains.public ++ ["checkout.internal.example.com"];
labels = org.common_labels ++ ["service:checkout", "tier:edge"]; labels = org.common_labels ++ ["service:checkout", "tier:edge"];
alerts.pager = org.pagers.checkout; alerts.pager = org.pagers.checkout;
@@ -41,16 +47,24 @@ in
owner = String; owner = String;
port = Int & >= 1024 & <= 65535 default 8080; port = Int & >= 1024 & <= 65535 default 8080;
replicas = Int & > 0 default 2; replicas = Int & > 0 default 2;
resources.cpu_milli = Int & >= 100 default 500; resources = {
resources.memory_mb = Int & >= 128 default 512; cpu_milli = Int & >= 100 default 500;
autoscaling.enabled = Bool default false; memory_mb = Int & >= 128 default 512;
autoscaling.min = Int & > 0 default 2; };
autoscaling.max = Int & > 0 default 4; autoscaling = {
rollout.strategy = String default "rolling"; enabled = Bool default false;
rollout.canary_percent = Int & >= 0 & <= 100 default 100; min = Int & > 0 default 2;
observability.metrics = Bool default true; max = Int & > 0 default 4;
observability.tracing = Bool default true; };
observability.logs = Bool default true; rollout = {
strategy = String default "rolling";
canary_percent = Int & >= 0 & <= 100 default 100;
};
observability = {
metrics = Bool default true;
tracing = Bool default true;
logs = Bool default true;
};
network.public = Bool default false; network.public = Bool default false;
}; };
`, `,
@@ -64,8 +78,10 @@ domains.public = ["checkout.example.com", "api.example.com"];
Production = { Production = {
network.public = true; network.public = true;
observability.tracing = true; observability = {
observability.logs = true; tracing = true;
logs = true;
};
}; };
`, `,
'org/platform.dcdl': `teams = { 'org/platform.dcdl': `teams = {
@@ -99,12 +115,16 @@ in
schema.Tenant & (plans.Enterprise // region.Europe // customer.Acme // { schema.Tenant & (plans.Enterprise // region.Europe // customer.Acme // {
slug = "acme"; slug = "acme";
display_name = "Acme Manufacturing"; display_name = "Acme Manufacturing";
limits.users = customer.seats + 25; limits = {
limits.projects = 200; users = customer.seats + 25;
limits.storage_gb = 2048; projects = 200;
features.audit_log = true; storage_gb = 2048;
features.sso = true; };
features.data_residency = true; features = {
audit_log = true;
sso = true;
data_residency = true;
};
compliance.retention_days = match customer.contract_tier { compliance.retention_days = match customer.contract_tier {
"regulated": 2555; "regulated": 2555;
_: 365; _: 365;
@@ -116,31 +136,45 @@ in
slug = String; slug = String;
display_name = String; display_name = String;
plan = String default "standard"; plan = String default "standard";
limits.users = Int & > 0 default 25; limits = {
limits.projects = Int & > 0 default 20; users = Int & > 0 default 25;
limits.storage_gb = Int & > 0 default 100; projects = Int & > 0 default 20;
features.sso = Bool default false; storage_gb = Int & > 0 default 100;
features.audit_log = Bool default true; };
features.data_residency = Bool default false; features = {
compliance.region = String default "us"; sso = Bool default false;
compliance.retention_days = Int & >= 30 default 90; audit_log = Bool default true;
billing.currency = String default "USD"; data_residency = Bool default false;
billing.invoice_day = Int & >= 1 & <= 28 default 1; };
compliance = {
region = String default "us";
retention_days = Int & >= 30 default 90;
};
billing = {
currency = String default "USD";
invoice_day = Int & >= 1 & <= 28 default 1;
};
}; };
`, `,
'plans.dcdl': `Enterprise = { 'plans.dcdl': `Enterprise = {
plan = "enterprise"; plan = "enterprise";
limits.users = 500; limits = {
limits.projects = 100; users = 500;
limits.storage_gb = 1024; projects = 100;
features.sso = true; storage_gb = 1024;
features.audit_log = true; };
features = {
sso = true;
audit_log = true;
};
billing.invoice_day = 15; billing.invoice_day = 15;
}; };
`, `,
'regions/eu.dcdl': `Europe = { 'regions/eu.dcdl': `Europe = {
compliance.region = "eu-west"; compliance = {
compliance.retention_days = 365; region = "eu-west";
retention_days = 365;
};
billing.currency = "EUR"; billing.currency = "EUR";
}; };
`, `,
@@ -168,14 +202,20 @@ Acme = {
in in
schema.Pipeline & env.Production & { schema.Pipeline & env.Production & {
name = "events-rollup"; name = "events-rollup";
source.kafka_cluster = sources.cluster; source = {
source.topic = sources.raw_topic; kafka_cluster = sources.cluster;
source.consumer_group = "analytics-events-rollup"; topic = sources.raw_topic;
sink.table = sinks.daily_events_table; consumer_group = "analytics-events-rollup";
sink.mode = "append"; };
sink = {
table = sinks.daily_events_table;
mode = "append";
};
workers = env.scale.worker_count; workers = env.scale.worker_count;
batch.size = env.scale.batch_size; batch = {
batch.timeout_seconds = 60 + 30; size = env.scale.batch_size;
timeout_seconds = 60 + 30;
};
schedule.cron = "*/15 * * * *"; schedule.cron = "*/15 * * * *";
transforms = transforms.standard ++ transforms.privacy ++ ["aggregate_daily"]; transforms = transforms.standard ++ transforms.privacy ++ ["aggregate_daily"];
quality.max_lag_seconds = match env.tier { quality.max_lag_seconds = match env.tier {
@@ -188,18 +228,26 @@ in
`, `,
'schemas/pipeline.dcdl': `Pipeline = { 'schemas/pipeline.dcdl': `Pipeline = {
name = String; name = String;
source.kafka_cluster = String; source = {
source.topic = String; kafka_cluster = String;
source.consumer_group = String; topic = String;
sink.table = String; consumer_group = String;
sink.mode = String default "append"; };
sink = {
table = String;
mode = String default "append";
};
workers = Int & > 0 default 2; workers = Int & > 0 default 2;
batch.size = Int & >= 100 default 1000; batch = {
batch.timeout_seconds = Int & > 0 default 60; size = Int & >= 100 default 1000;
timeout_seconds = Int & > 0 default 60;
};
schedule.cron = String; schedule.cron = String;
quality.max_lag_seconds = Int & > 0 default 300; quality.max_lag_seconds = Int & > 0 default 300;
dead_letter.enabled = Bool default true; dead_letter = {
dead_letter.topic = String default "events.dead_letter"; enabled = Bool default true;
topic = String default "events.dead_letter";
};
}; };
`, `,
'env/prod.dcdl': `tier = "gold"; 'env/prod.dcdl': `tier = "gold";
@@ -238,26 +286,38 @@ in
schema.EdgeApplication & security.StrictHeaders & { schema.EdgeApplication & security.StrictHeaders & {
name = "docs-and-playground"; name = "docs-and-playground";
domains = domains.primary ++ domains.aliases; domains = domains.primary ++ domains.aliases;
origin.host = "origin-docs.internal.example.com"; origin = {
origin.port = 443; host = "origin-docs.internal.example.com";
port = 443;
};
tls.mode = "strict"; tls.mode = "strict";
cache.default_ttl_seconds = 60 * 60; cache = {
cache.static_ttl_seconds = 60 * 60 * 24; default_ttl_seconds = 60 * 60;
cache.bypass_preview = env != "production"; static_ttl_seconds = 60 * 60 * 24;
routing.docs_paths = ["/docs/*", "/assets/*"]; bypass_preview = env != "production";
routing.playground_paths = ["/playground/*"]; };
waf.enabled = true; routing = {
waf.rules = security.managed_rules ++ ["block-country:kp", "rate-limit-login"]; docs_paths = ["/docs/*", "/assets/*"];
playground_paths = ["/playground/*"];
};
waf = {
enabled = true;
rules = security.managed_rules ++ ["block-country:kp", "rate-limit-login"];
};
} }
`, `,
'schemas/edge.dcdl': `EdgeApplication = { 'schemas/edge.dcdl': `EdgeApplication = {
name = String; name = String;
origin.host = String; origin = {
origin.port = Int & >= 1 & <= 65535 default 443; host = String;
port = Int & >= 1 & <= 65535 default 443;
};
tls.mode = String default "strict"; tls.mode = String default "strict";
cache.default_ttl_seconds = Int & >= 0 default 300; cache = {
cache.static_ttl_seconds = Int & >= 0 default 86400; default_ttl_seconds = Int & >= 0 default 300;
cache.bypass_preview = Bool default false; static_ttl_seconds = Int & >= 0 default 86400;
bypass_preview = Bool default false;
};
waf.enabled = Bool default true; waf.enabled = Bool default true;
}; };
`, `,
@@ -267,9 +327,11 @@ aliases = ["www.decodal.example.com", "docs.decodal.example.com"];
'security.dcdl': `managed_rules = ["owasp-core", "known-bots", "credential-stuffing"]; 'security.dcdl': `managed_rules = ["owasp-core", "known-bots", "credential-stuffing"];
StrictHeaders = { StrictHeaders = {
headers.hsts = "max-age=31536000; includeSubDomains; preload"; headers = {
headers.referrer_policy = "same-origin"; hsts = "max-age=31536000; includeSubDomains; preload";
headers.frame_options = "DENY"; referrer_policy = "same-origin";
frame_options = "DENY";
};
}; };
`, `,
}, },
@@ -296,12 +358,14 @@ in
"sev2": 15; "sev2": 15;
_: 60; _: 60;
}; };
escalation.after_minutes = match severity { escalation = {
after_minutes = match severity {
"sev1": 10; "sev1": 10;
"sev2": 30; "sev2": 30;
_: 120; _: 120;
}; };
escalation.targets = teams.platform_secondary ++ calendar.executive_watch; targets = teams.platform_secondary ++ calendar.executive_watch;
};
runbooks = ["runbooks/payments-api", "runbooks/database-failover"]; runbooks = ["runbooks/payments-api", "runbooks/database-failover"];
} }
`, `,