aws / aws/aws-cdk

aws-cdk-lib/aws-ssm: StringListParameter (Error in FnJoin)

Open
#27,810 8 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-ssm bug effort/medium p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

I added a StringListParameter to my existing Stack and suddenly get the following error:

```
Error: FnJoin requires at least one value to be provided
at Function.join (/Users/path_to_my_git_repo/node_modules/aws-cdk-lib/core/lib/cfn-fn.js:1:1026)
at new StringListParameter (/Users/path_to_my_git_repo/node_modules/aws-cdk-lib/aws-ssm/lib/parameter.js:1:13016)
at EosAwsAccountMlBootstrapStack.setupVpc (/Users/path_to_my_git_repo/lib/eos-aws-account-ml-bootstrap-stack.ts:157:5)
at new EosAwsAccountMlBootstrapStack (/Users/path_to_my_git_repo/lib/eos-aws-account-ml-bootstrap-stack.ts:42:10)
at Object. (/Users/path_to_my_git_repo/bin/eos-aws-account-ml-bootstrap.ts:29:1)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module.m._compile (/Users/path_to_my_git_repo/node_modules/ts-node/src/index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Object.require.extensions. [as .ts] (/Users/path_to_my_git_repo/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1119:32)
```

Here is the code I added:

```
const vpc = ec2.Vpc.fromLookup(this, "Vpc", {
vpcName: vpcName,
subnetGroupNameTag: "type",
})

const appSubnetGroupSelections = vpc.selectSubnets({
subnetGroupName: "app",
})

new cdk.aws_ssm.StringListParameter(this, "VpcParamSubnets", {
parameterName: "/iac/vpc/appSubnetIds",
stringListValue: appSubnetGroupSelections.subnetIds,
})
```

### Expected Behavior

Successfully synth and deploy stack.

### Current Behavior

Cannot synth or deploy stack.

### Reproduction Steps

For some reason this error only occurs in some AWS accounts but not in others so it may be hard to reproduce. We roll out this stack in 8 different accounts and I currently cannot tell why it fails in one account but not the others.

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.103.1

### Framework Version

_No response_

### Node.js Version

v18.17.0

### OS

MacOS Sonoma 14.1

### Language

TypeScript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with aws-ssm/lib/parameter.js at the StringListParameter stack-trace location, then compare it with the caller in lib/eos-aws-account-ml-bootstrap-stack.ts:157 and the VPC subnet selection shown in the report. Reproduce the synth in an affected account and compare the selected subnet IDs with a working account; done means the reported configuration synthesizes successfully without the FnJoin error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.