@intentius/chant-lexicon-aws 0.18.16 → 0.18.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5045,6 +5045,11 @@
5045
5045
  "kind": "property",
5046
5046
  "lexicon": "aws"
5047
5047
  },
5048
+ "AppConfiguration": {
5049
+ "resourceType": "AWS::EMR::InstanceGroupConfig.AppConfiguration",
5050
+ "kind": "property",
5051
+ "lexicon": "aws"
5052
+ },
5048
5053
  "AppCookieStickinessPolicy": {
5049
5054
  "resourceType": "AWS::ElasticLoadBalancing::LoadBalancer.AppCookieStickinessPolicy",
5050
5055
  "kind": "property",
@@ -7156,6 +7161,92 @@
7156
7161
  "tagUpdatable": false
7157
7162
  }
7158
7163
  },
7164
+ "AssessmentFramework": {
7165
+ "resourceType": "AWS::AuditManager::AssessmentFramework",
7166
+ "kind": "resource",
7167
+ "lexicon": "aws",
7168
+ "attrs": {
7169
+ "Arn": "Arn",
7170
+ "FrameworkId": "FrameworkId",
7171
+ "Type": "Type",
7172
+ "CreatedAt": "CreatedAt",
7173
+ "LastUpdatedAt": "LastUpdatedAt",
7174
+ "CreatedBy": "CreatedBy",
7175
+ "LastUpdatedBy": "LastUpdatedBy"
7176
+ },
7177
+ "propertyConstraints": {
7178
+ "Arn": {
7179
+ "pattern": "^arn:.*:auditmanager:",
7180
+ "minLength": 20,
7181
+ "maxLength": 2048
7182
+ },
7183
+ "FrameworkId": {
7184
+ "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
7185
+ "minLength": 36,
7186
+ "maxLength": 36
7187
+ },
7188
+ "Name": {
7189
+ "pattern": "^[^\\\\]*$",
7190
+ "minLength": 1,
7191
+ "maxLength": 300
7192
+ },
7193
+ "Description": {
7194
+ "pattern": "^[\\w\\W\\s\\S]*$",
7195
+ "minLength": 1,
7196
+ "maxLength": 1000
7197
+ },
7198
+ "ComplianceType": {
7199
+ "pattern": "^[\\w\\W\\s\\S]*$",
7200
+ "minLength": 0,
7201
+ "maxLength": 100
7202
+ },
7203
+ "Type": {
7204
+ "enum": [
7205
+ "Standard",
7206
+ "Custom"
7207
+ ]
7208
+ },
7209
+ "CreatedAt": {
7210
+ "format": "date-time"
7211
+ },
7212
+ "LastUpdatedAt": {
7213
+ "format": "date-time"
7214
+ },
7215
+ "CreatedBy": {
7216
+ "pattern": "^[a-zA-Z0-9\\s-_()\\[\\]]+$",
7217
+ "minLength": 1,
7218
+ "maxLength": 100
7219
+ },
7220
+ "LastUpdatedBy": {
7221
+ "pattern": "^[a-zA-Z0-9\\s-_()\\[\\]]+$",
7222
+ "minLength": 1,
7223
+ "maxLength": 100
7224
+ }
7225
+ },
7226
+ "primaryIdentifier": [
7227
+ "Arn"
7228
+ ],
7229
+ "tagging": {
7230
+ "taggable": true,
7231
+ "tagOnCreate": true,
7232
+ "tagUpdatable": true
7233
+ }
7234
+ },
7235
+ "AssessmentFramework_ControlSet": {
7236
+ "resourceType": "AWS::AuditManager::AssessmentFramework.ControlSet",
7237
+ "kind": "property",
7238
+ "lexicon": "aws"
7239
+ },
7240
+ "AssessmentFramework_ControlSetControl": {
7241
+ "resourceType": "AWS::AuditManager::AssessmentFramework.ControlSetControl",
7242
+ "kind": "property",
7243
+ "lexicon": "aws"
7244
+ },
7245
+ "AssessmentFramework_Tag": {
7246
+ "resourceType": "AWS::AuditManager::AssessmentFramework.Tag",
7247
+ "kind": "property",
7248
+ "lexicon": "aws"
7249
+ },
7159
7250
  "AssessmentReportsDestination": {
7160
7251
  "resourceType": "AWS::AuditManager::Assessment.AssessmentReportsDestination",
7161
7252
  "kind": "property",
@@ -15857,6 +15948,37 @@
15857
15948
  "kind": "property",
15858
15949
  "lexicon": "aws"
15859
15950
  },
15951
+ "CodeInterpreter": {
15952
+ "resourceType": "AWS::BedrockAgentCore::CodeInterpreter",
15953
+ "kind": "resource",
15954
+ "lexicon": "aws",
15955
+ "attrs": {
15956
+ "CodeInterpreterArn": "CodeInterpreterArn",
15957
+ "CodeInterpreterId": "CodeInterpreterId",
15958
+ "Status": "Status"
15959
+ },
15960
+ "propertyConstraints": {
15961
+ "CodeInterpreterArn": {
15962
+ "pattern": "^arn:[a-z0-9-]+:bedrock-agentcore:[a-z0-9-]+:(aws|[0-9]{12}):code-interpreter/aws\\.codeinterpreter\\.v1$"
15963
+ },
15964
+ "CodeInterpreterId": {
15965
+ "pattern": "^aws\\.codeinterpreter\\.v1$"
15966
+ },
15967
+ "Status": {
15968
+ "enum": [
15969
+ "CREATING",
15970
+ "CREATE_FAILED",
15971
+ "READY",
15972
+ "DELETING",
15973
+ "DELETE_FAILED",
15974
+ "DELETED"
15975
+ ]
15976
+ }
15977
+ },
15978
+ "primaryIdentifier": [
15979
+ "CodeInterpreterArn"
15980
+ ]
15981
+ },
15860
15982
  "CodeInterpreterCustom": {
15861
15983
  "resourceType": "AWS::BedrockAgentCore::CodeInterpreterCustom",
15862
15984
  "kind": "resource",
@@ -20910,6 +21032,16 @@
20910
21032
  "kind": "property",
20911
21033
  "lexicon": "aws"
20912
21034
  },
21035
+ "ControlSet": {
21036
+ "resourceType": "AWS::AuditManager::AssessmentFramework.ControlSet",
21037
+ "kind": "property",
21038
+ "lexicon": "aws"
21039
+ },
21040
+ "ControlSetControl": {
21041
+ "resourceType": "AWS::AuditManager::AssessmentFramework.ControlSetControl",
21042
+ "kind": "property",
21043
+ "lexicon": "aws"
21044
+ },
20913
21045
  "CookieObject": {
20914
21046
  "resourceType": "AWS::Lightsail::Distribution.CookieObject",
20915
21047
  "kind": "property",
@@ -37385,6 +37517,84 @@
37385
37517
  "kind": "property",
37386
37518
  "lexicon": "aws"
37387
37519
  },
37520
+ "EvidentlyExperiment": {
37521
+ "resourceType": "AWS::Evidently::Experiment",
37522
+ "kind": "resource",
37523
+ "lexicon": "aws",
37524
+ "attrs": {
37525
+ "Arn": "Arn"
37526
+ },
37527
+ "propertyConstraints": {
37528
+ "Arn": {
37529
+ "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*/experiment/[-a-zA-Z0-9._]*"
37530
+ },
37531
+ "Name": {
37532
+ "pattern": "[-a-zA-Z0-9._]*",
37533
+ "minLength": 1,
37534
+ "maxLength": 127
37535
+ },
37536
+ "Project": {
37537
+ "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)",
37538
+ "minLength": 0,
37539
+ "maxLength": 2048
37540
+ },
37541
+ "Description": {
37542
+ "minLength": 0,
37543
+ "maxLength": 160
37544
+ },
37545
+ "RandomizationSalt": {
37546
+ "pattern": ".*",
37547
+ "minLength": 0,
37548
+ "maxLength": 127
37549
+ },
37550
+ "SamplingRate": {
37551
+ "minimum": 0,
37552
+ "maximum": 100000
37553
+ },
37554
+ "Segment": {
37555
+ "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:segment/[-a-zA-Z0-9._]*)",
37556
+ "minLength": 0,
37557
+ "maxLength": 2048
37558
+ }
37559
+ },
37560
+ "createOnly": [
37561
+ "Name",
37562
+ "Project"
37563
+ ],
37564
+ "primaryIdentifier": [
37565
+ "Arn"
37566
+ ]
37567
+ },
37568
+ "EvidentlyExperiment_MetricGoalObject": {
37569
+ "resourceType": "AWS::Evidently::Experiment.MetricGoalObject",
37570
+ "kind": "property",
37571
+ "lexicon": "aws"
37572
+ },
37573
+ "EvidentlyExperiment_OnlineAbConfigObject": {
37574
+ "resourceType": "AWS::Evidently::Experiment.OnlineAbConfigObject",
37575
+ "kind": "property",
37576
+ "lexicon": "aws"
37577
+ },
37578
+ "EvidentlyExperiment_RunningStatusObject": {
37579
+ "resourceType": "AWS::Evidently::Experiment.RunningStatusObject",
37580
+ "kind": "property",
37581
+ "lexicon": "aws"
37582
+ },
37583
+ "EvidentlyExperiment_Tag": {
37584
+ "resourceType": "AWS::Evidently::Experiment.Tag",
37585
+ "kind": "property",
37586
+ "lexicon": "aws"
37587
+ },
37588
+ "EvidentlyExperiment_TreatmentObject": {
37589
+ "resourceType": "AWS::Evidently::Experiment.TreatmentObject",
37590
+ "kind": "property",
37591
+ "lexicon": "aws"
37592
+ },
37593
+ "EvidentlyExperiment_TreatmentToWeight": {
37594
+ "resourceType": "AWS::Evidently::Experiment.TreatmentToWeight",
37595
+ "kind": "property",
37596
+ "lexicon": "aws"
37597
+ },
37388
37598
  "EvidentlyProject": {
37389
37599
  "resourceType": "AWS::Evidently::Project",
37390
37600
  "kind": "resource",
@@ -37548,54 +37758,6 @@
37548
37758
  "kind": "property",
37549
37759
  "lexicon": "aws"
37550
37760
  },
37551
- "Experiment": {
37552
- "resourceType": "AWS::Evidently::Experiment",
37553
- "kind": "resource",
37554
- "lexicon": "aws",
37555
- "attrs": {
37556
- "Arn": "Arn"
37557
- },
37558
- "propertyConstraints": {
37559
- "Arn": {
37560
- "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*/experiment/[-a-zA-Z0-9._]*"
37561
- },
37562
- "Name": {
37563
- "pattern": "[-a-zA-Z0-9._]*",
37564
- "minLength": 1,
37565
- "maxLength": 127
37566
- },
37567
- "Project": {
37568
- "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)",
37569
- "minLength": 0,
37570
- "maxLength": 2048
37571
- },
37572
- "Description": {
37573
- "minLength": 0,
37574
- "maxLength": 160
37575
- },
37576
- "RandomizationSalt": {
37577
- "pattern": ".*",
37578
- "minLength": 0,
37579
- "maxLength": 127
37580
- },
37581
- "SamplingRate": {
37582
- "minimum": 0,
37583
- "maximum": 100000
37584
- },
37585
- "Segment": {
37586
- "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:segment/[-a-zA-Z0-9._]*)",
37587
- "minLength": 0,
37588
- "maxLength": 2048
37589
- }
37590
- },
37591
- "createOnly": [
37592
- "Name",
37593
- "Project"
37594
- ],
37595
- "primaryIdentifier": [
37596
- "Arn"
37597
- ]
37598
- },
37599
37761
  "ExperimentConfig": {
37600
37762
  "resourceType": "AWS::SageMaker::ProcessingJob.ExperimentConfig",
37601
37763
  "kind": "property",
@@ -37650,36 +37812,6 @@
37650
37812
  "kind": "property",
37651
37813
  "lexicon": "aws"
37652
37814
  },
37653
- "Experiment_MetricGoalObject": {
37654
- "resourceType": "AWS::Evidently::Experiment.MetricGoalObject",
37655
- "kind": "property",
37656
- "lexicon": "aws"
37657
- },
37658
- "Experiment_OnlineAbConfigObject": {
37659
- "resourceType": "AWS::Evidently::Experiment.OnlineAbConfigObject",
37660
- "kind": "property",
37661
- "lexicon": "aws"
37662
- },
37663
- "Experiment_RunningStatusObject": {
37664
- "resourceType": "AWS::Evidently::Experiment.RunningStatusObject",
37665
- "kind": "property",
37666
- "lexicon": "aws"
37667
- },
37668
- "Experiment_Tag": {
37669
- "resourceType": "AWS::Evidently::Experiment.Tag",
37670
- "kind": "property",
37671
- "lexicon": "aws"
37672
- },
37673
- "Experiment_TreatmentObject": {
37674
- "resourceType": "AWS::Evidently::Experiment.TreatmentObject",
37675
- "kind": "property",
37676
- "lexicon": "aws"
37677
- },
37678
- "Experiment_TreatmentToWeight": {
37679
- "resourceType": "AWS::Evidently::Experiment.TreatmentToWeight",
37680
- "kind": "property",
37681
- "lexicon": "aws"
37682
- },
37683
37815
  "ExpirationDataRule": {
37684
37816
  "resourceType": "AWS::S3Files::FileSystem.ExpirationDataRule",
37685
37817
  "kind": "property",
@@ -48824,7 +48956,7 @@
48824
48956
  "kind": "resource",
48825
48957
  "lexicon": "aws",
48826
48958
  "attrs": {
48827
- "Id": "Id"
48959
+ "InstanceGroupId": "InstanceGroupId"
48828
48960
  },
48829
48961
  "createOnly": [
48830
48962
  "InstanceRole",
@@ -48837,17 +48969,21 @@
48837
48969
  "Market",
48838
48970
  "BidPrice"
48839
48971
  ],
48972
+ "writeOnly": [
48973
+ "EbsConfiguration/EbsBlockDeviceConfigs/*/VolumesPerInstance"
48974
+ ],
48840
48975
  "primaryIdentifier": [
48841
- "Id"
48976
+ "InstanceGroupId",
48977
+ "JobFlowId"
48842
48978
  ]
48843
48979
  },
48844
- "InstanceGroupConfig_AutoScalingPolicy": {
48845
- "resourceType": "AWS::EMR::InstanceGroupConfig.AutoScalingPolicy",
48980
+ "InstanceGroupConfig_AppConfiguration": {
48981
+ "resourceType": "AWS::EMR::InstanceGroupConfig.AppConfiguration",
48846
48982
  "kind": "property",
48847
48983
  "lexicon": "aws"
48848
48984
  },
48849
- "InstanceGroupConfig_Configuration": {
48850
- "resourceType": "AWS::EMR::InstanceGroupConfig.Configuration",
48985
+ "InstanceGroupConfig_AutoScalingPolicy": {
48986
+ "resourceType": "AWS::EMR::InstanceGroupConfig.AutoScalingPolicy",
48851
48987
  "kind": "property",
48852
48988
  "lexicon": "aws"
48853
48989
  },
@@ -85478,6 +85614,53 @@
85478
85614
  "kind": "property",
85479
85615
  "lexicon": "aws"
85480
85616
  },
85617
+ "SageMakerExperiment": {
85618
+ "resourceType": "AWS::SageMaker::Experiment",
85619
+ "kind": "resource",
85620
+ "lexicon": "aws",
85621
+ "attrs": {
85622
+ "Arn": "Arn",
85623
+ "CreationTime": "CreationTime",
85624
+ "LastModifiedTime": "LastModifiedTime"
85625
+ },
85626
+ "propertyConstraints": {
85627
+ "Arn": {
85628
+ "pattern": "^arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:experiment/",
85629
+ "maxLength": 256
85630
+ },
85631
+ "ExperimentName": {
85632
+ "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,119}$",
85633
+ "minLength": 1,
85634
+ "maxLength": 120
85635
+ },
85636
+ "DisplayName": {
85637
+ "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,119}$",
85638
+ "minLength": 1,
85639
+ "maxLength": 120
85640
+ },
85641
+ "Description": {
85642
+ "minLength": 0,
85643
+ "maxLength": 3072
85644
+ },
85645
+ "CreationTime": {
85646
+ "format": "date-time"
85647
+ },
85648
+ "LastModifiedTime": {
85649
+ "format": "date-time"
85650
+ }
85651
+ },
85652
+ "createOnly": [
85653
+ "ExperimentName"
85654
+ ],
85655
+ "primaryIdentifier": [
85656
+ "Arn"
85657
+ ],
85658
+ "tagging": {
85659
+ "taggable": true,
85660
+ "tagOnCreate": true,
85661
+ "tagUpdatable": true
85662
+ }
85663
+ },
85481
85664
  "SageMakerHub": {
85482
85665
  "resourceType": "AWS::SageMaker::Hub",
85483
85666
  "kind": "resource",
@@ -116,6 +116,22 @@ describe("Join intrinsic", () => {
116
116
  "Fn::Join": ["-", [{ Ref: "Prefix" }, "bucket"]],
117
117
  });
118
118
  });
119
+
120
+ test("accepts a single list-returning intrinsic (not only an array) (#517)", () => {
121
+ // Fn::Join's second arg legitimately takes a list-returning intrinsic
122
+ // (GetAtt of a list attr, Split, Ref to a List<>) — emitted as-is, no `.map`.
123
+ expect(Join(",", GetAtt("Zone", "NameServers")).toJSON()).toEqual({
124
+ "Fn::Join": [",", { "Fn::GetAtt": ["Zone", "NameServers"] }],
125
+ });
126
+ expect(Join(",", Split(",", "a,b")).toJSON()).toEqual({
127
+ "Fn::Join": [",", { "Fn::Split": [",", "a,b"] }],
128
+ });
129
+ });
130
+
131
+ test("throws a clear error for a non-array, non-intrinsic value (#517)", () => {
132
+ // @ts-expect-error — exercising the runtime guard
133
+ expect(() => Join(",", "oops")).toThrow(/array or a list-returning intrinsic/);
134
+ });
119
135
  });
120
136
 
121
137
  describe("Select intrinsic", () => {
package/src/intrinsics.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { INTRINSIC_MARKER, resolveIntrinsicValue, type Intrinsic } from "@intentius/chant/intrinsic";
1
+ import { INTRINSIC_MARKER, resolveIntrinsicValue, isIntrinsic, type Intrinsic } from "@intentius/chant/intrinsic";
2
2
  import { buildInterpolatedString, defaultInterpolationSerializer } from "@intentius/chant/intrinsic-interpolation";
3
3
  import { type Declarable } from "@intentius/chant/declarable";
4
4
  import { getLogicalName } from "@intentius/chant/utils";
@@ -129,22 +129,35 @@ export function If(conditionName: string, valueIfTrue: unknown, valueIfFalse: un
129
129
  export class JoinIntrinsic implements Intrinsic {
130
130
  readonly [INTRINSIC_MARKER] = true as const;
131
131
  private delimiter: string;
132
- private values: unknown[];
132
+ private values: unknown[] | Intrinsic;
133
133
 
134
- constructor(delimiter: string, values: unknown[]) {
134
+ constructor(delimiter: string, values: unknown[] | Intrinsic) {
135
135
  this.delimiter = delimiter;
136
136
  this.values = values;
137
137
  }
138
138
 
139
- toJSON(): { "Fn::Join": [string, unknown[]] } {
140
- return { "Fn::Join": [this.delimiter, this.values.map(resolveIntrinsicValue)] };
139
+ toJSON(): { "Fn::Join": [string, unknown] } {
140
+ // Fn::Join's second arg is either a literal list of values OR a single
141
+ // list-returning intrinsic (GetAtt of a list attr, Split, Ref to a List<>
142
+ // param). Only the array form gets `.map`; a lone intrinsic is emitted as-is
143
+ // (#517 — mapping over it dereferenced undefined and crashed the build).
144
+ const list = Array.isArray(this.values)
145
+ ? this.values.map(resolveIntrinsicValue)
146
+ : resolveIntrinsicValue(this.values);
147
+ return { "Fn::Join": [this.delimiter, list] };
141
148
  }
142
149
  }
143
150
 
144
151
  /**
145
- * Create a Join intrinsic
152
+ * Create a Join intrinsic. `values` is a literal array, or a single
153
+ * list-returning intrinsic (e.g. `Join(",", zone.NameServers)`).
146
154
  */
147
- export function Join(delimiter: string, values: unknown[]): JoinIntrinsic {
155
+ export function Join(delimiter: string, values: unknown[] | Intrinsic): JoinIntrinsic {
156
+ if (!Array.isArray(values) && !isIntrinsic(values)) {
157
+ throw new Error(
158
+ "Join(delimiter, values): values must be an array or a list-returning intrinsic (GetAtt/Split/Ref to a List)",
159
+ );
160
+ }
148
161
  return new JoinIntrinsic(delimiter, values);
149
162
  }
150
163
 
@@ -3,7 +3,7 @@ import { awsSerializer } from "./serializer";
3
3
  import { AttrRef } from "@intentius/chant/attrref";
4
4
  import { DECLARABLE_MARKER, type Declarable } from "@intentius/chant/declarable";
5
5
  import { LexiconOutput } from "@intentius/chant/lexicon-output";
6
- import { Sub } from "./intrinsics";
6
+ import { Sub, Join } from "./intrinsics";
7
7
  import { AWS } from "./pseudo";
8
8
  import { nestedStack, NestedStackOutputRef } from "./nested-stack";
9
9
  import { stackOutput } from "@intentius/chant/stack-output";
@@ -262,6 +262,23 @@ describe("intrinsic serialization", () => {
262
262
  });
263
263
 
264
264
  describe("LexiconOutput serialization", () => {
265
+ test("resolves AttrRef nested in a Join output to Fn::GetAtt, not the __attrRef envelope (chant#935)", () => {
266
+ const s1 = new MockBucket({ BucketName: "subnet-1" });
267
+ const s2 = new MockBucket({ BucketName: "subnet-2" });
268
+ (s1.arn as Record<string, unknown>)._setLogicalName("Subnet1");
269
+ (s2.arn as Record<string, unknown>)._setLogicalName("Subnet2");
270
+ const joined = new LexiconOutput(Join(":", [s1.arn, s2.arn]), "SubnetIds");
271
+ joined._setSourceEntity("Subnet1");
272
+ const entities = new Map<string, Declarable>();
273
+ entities.set("Subnet1", s1);
274
+ entities.set("Subnet2", s2);
275
+ const template = JSON.parse(awsSerializer.serialize(entities, [joined]));
276
+ const value = JSON.stringify(template.Outputs.SubnetIds.Value);
277
+ expect(value).not.toContain("__attrRef");
278
+ expect(value).toContain("Fn::GetAtt");
279
+ expect(value).toContain("Fn::Join");
280
+ });
281
+
265
282
  test("generates CF Outputs section for LexiconOutputs", () => {
266
283
  const bucket = new MockBucket({ BucketName: "data-bucket" });
267
284
  const lexiconOutput = new LexiconOutput(bucket.arn, "DataBucketArn");
@@ -305,6 +322,23 @@ describe("LexiconOutput serialization", () => {
305
322
  });
306
323
  });
307
324
 
325
+ test("resolves an AttrRef nested in an intrinsic output → Fn::GetAtt, not __attrRef (#935)", () => {
326
+ const b1 = new MockBucket({ BucketName: "b1" });
327
+ const b2 = new MockBucket({ BucketName: "b2" });
328
+ const r1 = new AttrRef(b1, "Arn"); r1._setLogicalName("B1");
329
+ const r2 = new AttrRef(b2, "Arn"); r2._setLogicalName("B2");
330
+ const joined = new LexiconOutput(Join(",", [r1, r2]), "oArns");
331
+
332
+ const entities = new Map<string, Declarable>();
333
+ entities.set("B1", b1);
334
+ entities.set("B2", b2);
335
+
336
+ const template = JSON.parse(awsSerializer.serialize(entities, [joined]) as string);
337
+ expect(template.Outputs.oArns.Value).toEqual({
338
+ "Fn::Join": [",", [{ "Fn::GetAtt": ["B1", "Arn"] }, { "Fn::GetAtt": ["B2", "Arn"] }]],
339
+ });
340
+ });
341
+
308
342
  test("omits Outputs section when no LexiconOutputs provided", () => {
309
343
  const entities = new Map<string, Declarable>();
310
344
  entities.set("MyBucket", new MockBucket({ BucketName: "bucket" }));
@@ -364,6 +398,23 @@ describe("stackOutput serialization", () => {
364
398
  "Fn::GetAtt": ["MyBucket", "Arn"],
365
399
  });
366
400
  });
401
+
402
+ test("intrinsic-wrapped output (Join over a ref) → Fn::Join + Fn::GetAtt (#517)", () => {
403
+ const bucket = new MockBucket({ BucketName: "my-bucket" });
404
+ // Deliberately NOT pre-resolved — the serializer must set the nested ref's
405
+ // logical name from the entity map (resolveAttrRefs doesn't reach it here).
406
+ const arnRef = new AttrRef(bucket, "Arn");
407
+ const output = stackOutput(Join(",", arnRef));
408
+
409
+ const entities = new Map<string, Declarable>();
410
+ entities.set("MyBucket", bucket);
411
+ entities.set("MyBucketJoined", output as unknown as Declarable);
412
+
413
+ const template = JSON.parse(awsSerializer.serialize(entities) as string);
414
+ expect(template.Outputs.MyBucketJoined.Value).toEqual({
415
+ "Fn::Join": [",", { "Fn::GetAtt": ["MyBucket", "Arn"] }],
416
+ });
417
+ });
367
418
  });
368
419
 
369
420
  // ── Nested Stack Serialization ──────────────────────────
package/src/serializer.ts CHANGED
@@ -7,6 +7,7 @@ import type { LexiconOutput } from "@intentius/chant/lexicon-output";
7
7
  import { walkValue, type SerializerVisitor } from "@intentius/chant/serializer-walker";
8
8
  import { isChildProject, type ChildProjectInstance } from "@intentius/chant/child-project";
9
9
  import { isStackOutput, type StackOutput } from "@intentius/chant/stack-output";
10
+ import { isAttrRefLike } from "@intentius/chant/utils";
10
11
  import { resolveDependsOn } from "@intentius/chant/resource-attributes";
11
12
  import { isDefaultTags, type TagEntry } from "./default-tags";
12
13
  import { loadTaggableResources } from "./taggable";
@@ -101,6 +102,31 @@ function toCFValue(value: unknown, entityNames: Map<Declarable, string>): unknow
101
102
  return walkValue(value, entityNames, cfnVisitor(entityNames));
102
103
  }
103
104
 
105
+ /**
106
+ * Set logical names on any AttrRefs nested inside a value (e.g. inside a `Join`
107
+ * that a `stackOutput` exports). resolveAttrRefs only reaches entity attributes,
108
+ * not refs buried in an output's intrinsic — without this the walker would throw
109
+ * "logical name not set" for them (#517).
110
+ */
111
+ function resolveNestedAttrRefs(
112
+ value: unknown,
113
+ entityNames: Map<Declarable, string>,
114
+ seen = new Set<unknown>(),
115
+ ): void {
116
+ if (value === null || typeof value !== "object" || seen.has(value)) return;
117
+ seen.add(value);
118
+ if (isAttrRefLike(value)) {
119
+ if (!value.getLogicalName()) {
120
+ const parent = value.parent.deref();
121
+ const parentName = parent ? entityNames.get(parent as Declarable) : undefined;
122
+ if (parentName) value._setLogicalName(parentName);
123
+ }
124
+ return;
125
+ }
126
+ const children = Array.isArray(value) ? value : Object.values(value as Record<string, unknown>);
127
+ for (const child of children) resolveNestedAttrRefs(child, entityNames, seen);
128
+ }
129
+
104
130
  /**
105
131
  * Convert entity props to CF properties
106
132
  */
@@ -289,31 +315,42 @@ function serializeToTemplate(
289
315
  template.Outputs = {};
290
316
  }
291
317
  const stackOutput = entity as StackOutput;
292
- const ref = stackOutput.sourceRef;
293
- const logicalName = ref.getLogicalName();
294
- if (logicalName) {
318
+ // Typed `unknown` so `isAttrRefLike` narrows cleanly regardless of how the
319
+ // AttrRef type resolves across the workspace/published boundary.
320
+ const ref: unknown = stackOutput.sourceRef;
321
+ let value: unknown;
322
+ if (isAttrRefLike(ref)) {
323
+ const logicalName = ref.getLogicalName();
324
+ if (!logicalName) continue;
295
325
  // Use Ref for primary identifier ("Id") since not all resources
296
326
  // support Fn::GetAtt for their primary identifier (e.g. ACM Certificate).
297
327
  // Ref always returns the primary identifier for any CF resource.
298
- const output: CFOutput = {
299
- Value: ref.attribute === "Id"
300
- ? { Ref: logicalName }
301
- : { "Fn::GetAtt": [logicalName, ref.attribute] },
302
- };
303
- if (stackOutput.description) {
304
- output.Description = stackOutput.description;
305
- }
306
- template.Outputs[name] = output;
328
+ value = ref.attribute === "Id" ? { Ref: logicalName } : { "Fn::GetAtt": [logicalName, ref.attribute] };
329
+ } else {
330
+ // An intrinsic wrapping refs (e.g. Join(",", zone.NameServers), #517):
331
+ // resolve the nested AttrRefs' logical names from the entity map, then
332
+ // serialize through the CF walker → {Fn::Join:[",",{Fn::GetAtt:[…]}]}.
333
+ resolveNestedAttrRefs(ref, entityNames);
334
+ value = toCFValue(ref, entityNames);
335
+ }
336
+ const output: CFOutput = { Value: value };
337
+ if (stackOutput.description) {
338
+ output.Description = stackOutput.description;
307
339
  }
340
+ template.Outputs[name] = output;
308
341
  }
309
342
  }
310
343
 
311
- // Add CF Outputs for LexiconOutputs produced by this lexicon
344
+ // Add CF Outputs for LexiconOutputs produced by this lexicon. Run the value
345
+ // through the CF walker so an AttrRef nested in an intrinsic (e.g.
346
+ // Join(",", [subnet1.SubnetId, …])) becomes Fn::GetAtt instead of leaking the
347
+ // generic `{__attrRef}` envelope — the same conversion resource Properties get
348
+ // (#935). A bare Fn::GetAtt value walks through unchanged.
312
349
  if (outputs && outputs.length > 0) {
313
350
  template.Outputs = template.Outputs ?? {};
314
351
  for (const output of outputs) {
315
352
  template.Outputs[output.outputName] = {
316
- Value: output.getOutputValue(),
353
+ Value: toCFValue(output.getOutputValue(), entityNames),
317
354
  };
318
355
  }
319
356
  }