sparse-intern-71089
06/15/2023, 6:23 PMfast-vr-6049
06/15/2023, 6:48 PM# Pulumi.yaml
project:mysql-instance-consts:
description: MySQL instance consts
value:
version: MYSQL_8_0
# Pulumi.<stack>.yaml
project:mysql-instance-vars:
name: my-db
disk-size: 10
tier: db-custom-1-3840
availability: ZONAL
Then access both as necessary like so:
# C#
var configConsts = new Config("mysql-instance-consts");
var configVars = new Config("mysql-instance-vars");
salmon-account-74572
06/15/2023, 6:51 PMfast-vr-6049
06/15/2023, 6:53 PMmysql-instance
in this case, rather than expanding down to the child keys if the config being compared is an objectsalmon-account-74572
06/15/2023, 6:55 PMPulumi.yaml
and Pulumi.<stack>.yaml
files being used.limited-farmer-68874
06/15/2023, 6:55 PMsalmon-account-74572
06/15/2023, 6:57 PMlimited-farmer-68874
06/15/2023, 6:58 PMname: project
runtime:
name: python
options:
virtualenv: venv
description: GCP universe definition
config:
# Defaults for GCP-wide configuration
gcp:region:
description: The GCP region
value: us-central1
gcp:zone:
description: The GCP zone
value: us-central1-a
# project-db-lite MySQL instance
project:project-db-lite-mysql-instance:
description: MySQL instance
value:
name: project-db-lite
version: MYSQL_8_0
disk-size: 10
availability: REGIONAL
tier: db-custom-1-3840
databases:
- name: project-db
users:
- name: project-developer
Pulumi.dev.yaml
#TEST-specific overrides
config:
gcp:project: project-test-01
project:project-db-lite-mysql-instance:
availability: ZONAL
To sanity check...
print(config.require_object('project-db-lite-mysql-instance'))
with the project:project-db-lite-mysql-instance
config present in Pulumi.dev.yaml:
{'availability': 'ZONAL'}
without:
{'availability': 'REGIONAL', 'databases': [{'name': 'project-db'}], 'disk-size': 10, 'name': 'project-db-lite', 'tier': 'db-custom-1-3840', 'users': [{'name': 'project-developer'}], 'version': 'MYSQL_8_0'}
limited-farmer-68874
06/15/2023, 6:59 PMlimited-farmer-68874
06/15/2023, 6:59 PMlimited-farmer-68874
06/15/2023, 6:59 PMsalmon-account-74572
06/15/2023, 7:04 PMPulumi.dev.yaml
file hand-crafted? I’d be interested to see if using pulumi config set project-db-lite-mysql-instance:availability ZONAL
writes it differently (going back to @fast-vr-6049’s thought on how the data is being structured as an object in the file).fast-vr-6049
06/15/2023, 7:11 PMlimited-farmer-68874
06/15/2023, 7:15 PMlimited-farmer-68874
06/15/2023, 7:18 PMpulumi config set --path project-db-lite-mysql-instance.availability ZONAL
sets it the same way I have it now
pulumi config set project-db-lite-mysql-instance:availability ZONAL
sets it to
project-db-lite-mysql-instance:availability: ZONAL
Which does not get picked up at all as overwriting any values in the object, which is what I expected, since that's the syntax for making project-db-lite-mysql-instance
a namespace. Adding an additional "project:" to the front does not change anything.salmon-account-74572
06/15/2023, 7:26 PMlimited-farmer-68874
06/15/2023, 7:33 PMsalmon-account-74572
06/15/2023, 7:48 PM