Step Function Tasks > Secret Manager: 'INVALID_JSON_DESCRIPTION: Unexpected character ('S' (code 83)): was expecting comma to separate Object entries
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
I'm currently trying to deploy some codes using CDK library. When I tried to deploy the EcsRunTask from StepFunctionTasks using the containerOverrides, I received a message that it's a invalid json description even though it looks correctly.. So I wonder what is the real issue behind this.
### Expected Behavior
Deploy it to the AWS Server with no error.
### Current Behavior
The stack named [STACK_NAME] failed to deploy: UPDATE_ROLLBACK_COMPLETE: 1 validation error detected: Value 'Invalid State Machine Definition: 'INVALID_JSON_DESCRIPTION: Unexpected character ('S' (code 83)): was expecting comma to separate Object entries
......
### Reproduction Steps
```
const getSecret = (name: string) => {
return secretsmanager.Secret.fromSecretPartialArn(
this,
name,
`arn:aws:secretsmanager:us-east-1:${props.account}:secret:${name}`
).secretValue.toString();
};
[STEP_FUNCTION_MAP].iterator(
new tasks.EcsRunTask(this, "Task Name", {
integrationPattern: sfn.IntegrationPattern.RUN_JOB,
cluster: props.cluster,
taskDefinition,
launchTarget: new tasks.EcsFargateLaunchTarget(),
containerOverrides: [
{
containerDefinition,
environment: [
{
name: "SYSTEM_USERNAME",
value: getSecret("SystemCredentialsUsername"),
},
{
name: "SYSTEM_PASSWORD",
value: getSecret("SystemCredentialsPassword"),
},
// .........more codes, but when I deployed it by commenting the "SYSTEM_USERNAME" and "SYSTEM_PASSWORD",
// deploy is successful. So I'm guessing that this part is troublesome.
],
},
],
})
);
```
### Possible Solution
I think that if it just allows the string for the part of the json, it might solve the problem. I'm guessing that it might be the problem with secret manager and EcsRunTask.
### Additional Information/Context
_No response_
### CDK CLI Version
2
### Framework Version
_No response_
### Node.js Version
v18.3.0
### OS
Linux
### Language
Typescript
### Language Version
4.7.4
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.