how does dependsOn work in backend-config.json
See original GitHub issueI’m struggling to get dependsOn
in backend-config.json to do anything useful.
Which Category is your question related to? deploying
Amplify CLI Version
$ amplify -v
4.29.2
What AWS Services are you utilizing? many - AppSync, Functions, and custom cloudformation.
Provide additional details e.g. code snippets
My backend-config.json includes:
"security": {
"l12n": {
"providerPlugin": "awscloudformation"
}
},
"function": {
"l12nAPI": {
"build": true,
"providerPlugin": "awscloudformation",
"service": "Lambda",
"dependsOn": [
{"category": "security", "resourceName": "l12n", "attributes": ["SecurityGroupId"]}
]
}
},
where security/l12n
is just a folder structure to hold a custom cloudformation template that simply creates a SecurityGroup for the function to run in a VPC.
From what I’ve seen in other posts, I think dependsOn
can be used to force the deployment order. I have several stacks that need a specific order and in all of them I tried a scheme like I’m showing here. When I use this strategy, I get cloudformation errors that read like:
UPDATE_FAILED functionl12nAPI AWS::CloudFormation::Stack Thu Sep 24 2020 08:21:28 GMT-0700 (Pacific Daylight Time) Parameters: [securityl12nSecurityGroupId] do not exist in the template
The function stack takes a parameter called SecurityGroupId
, which is specified in the file function/l12nAPI/parameters.json
as:
{
"SecurityGroupId": {
"Fn::GetAtt": [
"securityl12n",
"Outputs.SecurityGroupId"
]
}
}
The parameters.json is sufficient to get the stack to deploy. It seems that adding dependsOn
corrupts the name of the parameter being passed to the CF template.
It would be great if you could describe how I’m supposed to use dependsOn
or point me to the documentation.
Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (6 by maintainers)
Yes, much clearer, actual documentation on the schema allowed.
Closing in favor of tracking #10043 for providing JSON schemas with descriptions of properties and their usage