https://pulumi.com logo
Title
e

eager-keyboard-30823

04/05/2022, 7:16 AM
Hey everyone 👋 I’m using F# in a Pulumi project and tried importing a GCP Composer environment. Since the code defaulted to C#, I had to translate it to F#. It’s now in a state where it builds fine but when I run
pulumi preview
it complains about something that looks like missing properties - but I’m not sure why, as those properties were not included in the C# code that was generated by the import command. Any tips for what to look for?
Including the logs here, as it gets a bit long on the main channel:
pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:dev::test-pulumi::pulumi:pulumi:Stack::test-pulumi-dev]
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.software_config": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.SoftwareConfig'.
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.maintenance_window": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.MaintenanceWindow'.
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.node_count": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.NodeCount
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.web_server_network_access_control": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.WebServerNetworkAccessControl'.
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.workloads_config": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.WorkloadsConfig'.
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.environment_size": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.EnvironmentSize'.
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.master_authorized_networks_config": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.MasterAuthorizedNetworksConfig'.
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.node_config": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.NodeConfig'.
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.database_config": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.DatabaseConfig'.
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.encryption_config": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.EncryptionConfig'.
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.private_environment_config": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.PrivateEnvironmentConfig'.
error: gcp:composer/environment:Environment resource 'composer-env' has a problem: AtLeastOne: "config.0.web_server_config": one of `config.0.database_config,config.0.encryption_config,config.0.environment_size,config.0.maintenance_window,config.0.master_authorized_networks_config,config.0.node_config,config.0.node_count,config.0.private_environment_config,config.0.software_config,config.0.web_server_config,config.0.web_server_network_access_control,config.0.workloads_config` must be specified. Examine values at 'Environment.Config.WebServerConfig'.
Resources:
    1 unchanged
e

echoing-dinner-19531

04/05/2022, 7:56 AM
Is your code setting "config" to anything?
e

eager-keyboard-30823

04/05/2022, 7:58 AM
@echoing-dinner-19531 yes, would it help if I put up a gist with the code?
e

echoing-dinner-19531

04/05/2022, 7:59 AM
It would
e

eager-keyboard-30823

04/05/2022, 8:09 AM
This file is as close to a 1:1 conversion from the C# code as I could get it to be… so not sure why that would go wrong.
e

echoing-dinner-19531

04/05/2022, 8:17 AM
hmm that is odd, could you send us debug logs? Run up with
-v9 --logtostderr --logflow
and you can email them to fraser@pulumi.com or post to gist, it looks like either somethings getting broken in serialization but there's multiple layers of that and not clear which one is causing this.
e

eager-keyboard-30823

04/05/2022, 8:21 AM
Sure thing! Thanks. 😄
@echoing-dinner-19531 I’ve sent the email. Thanks again. 🙂
e

echoing-dinner-19531

04/05/2022, 8:47 AM
Thanks I'll take a look and see if its something easy to fix or if we need to raise a bug to track this.
🙌 1
Well looks like it's an issue in the program somewhere. The config isn't making its way to the pulumi engine:
Unmarshaling property for RPC[ResourceMonitor.RegisterResource(gcp:composer/environment:Environment,default)]: config={map[]}
So either you've got the subtlest little bug in your program that means Config isn't actually being assigned, or there's an SDK bug that's causing it to be dropped
e

eager-keyboard-30823

04/05/2022, 9:09 AM
My
program.fs
is just this:
module Program

open Pulumi.FSharp

let infra () =
    let environments = Composer.environments ()
    
    dict []

Deployment.run infra |> ignore
Composer.environments is the function from the gist
e

echoing-dinner-19531

04/05/2022, 9:10 AM
Hmm ok I'll see if I can repro this. Might be a dotnet sdk bug because your gist code doesn't look wrong.
I can't exactly reproduce your setup, but creating a basic configured composer Environment in C# at least seems to work as expected.
Will see if F# breaks it
e

eager-keyboard-30823

04/05/2022, 9:55 AM
Okay, I figured out what the problem was based on your commentary… turns out there’s no warnings or anything if you don’t put
input
in front of every value, but it is necessary
i.e.
Config = input (Environment(…)),
e

echoing-dinner-19531

04/05/2022, 10:06 AM
Interesting, that is odd behaviour. I guess the implict conversion isn't doing quite the same as the input function
which is really odd because all the input function does is call the implict converter
At any rate, glad you got it working
e

eager-keyboard-30823

04/05/2022, 10:08 AM
Yeah, thanks for the help. 😄