square-coat-62279
11/30/2021, 6:37 PMprehistoric-activity-61023
11/30/2021, 6:48 PMif
statementdependsOn
excepts an existing object. Either way, itās not gonna work at all and you should be forced to fix your code š.None
to depends_on
list, I got:
File "./__main__.py", line 78, in <module>
opts=pulumi.ResourceOptions(depends_on=[None]),
File "<redacted>/gcp_project_bootstrap/venv/lib/python3.8/site-packages/pulumi/resource.py", line 471, in __init__
raise Exception(
Exception: 'depends_on' was passed a value that was not a Resource.
error: an unhandled error occurred: Program exited with non-zero exit code: 1
dependsOn
might be null/None/nil/whatever-but-not-an-actual-resource, just check it and donāt create the resource cause itās gonna fail otherwise.if resource_i_depend_on is not None:
another_resource = MyResource(
...
opts=pulumi.ResourceOptions(depends_on=[resource_i_depend_on])
)
square-coat-62279
11/30/2021, 7:00 PMprehistoric-activity-61023
11/30/2021, 7:04 PMpurple-application-23904
11/30/2021, 7:09 PMprehistoric-activity-61023
11/30/2021, 7:10 PMsquare-coat-62279
12/01/2021, 9:22 AMprehistoric-activity-61023
12/01/2021, 10:07 AMsquare-coat-62279
12/01/2021, 11:53 AMprehistoric-activity-61023
12/01/2021, 11:58 AMname
in metadata
, only labels
). That means, pulumi autonaming will be used. When config map definition change (due to different content of default.conf
file), pulumi will try to update the resource and it will generate a new name (according to autonaming mechanism).
You can see later in the code, that name of the configmap is actually extracted from the resource (itās not hardcoded):
const nginxConfigName = nginxConfig.metadata.apply(m => m.name);
square-coat-62279
12/01/2021, 12:14 PMprehistoric-activity-61023
12/01/2021, 12:24 PMsquare-coat-62279
12/01/2021, 2:45 PMprehistoric-activity-61023
12/01/2021, 2:55 PM