Hey everyone :wave: I’m using F# in a Pulumi proje...
# general
e
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:
Copy code
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
Is your code setting "config" to anything?
e
@echoing-dinner-19531 yes, would it help if I put up a gist with the code?
e
It would
e
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
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
Sure thing! Thanks. 😄
@echoing-dinner-19531 I’ve sent the email. Thanks again. 🙂
e
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:
Copy code
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
My
program.fs
is just this:
Copy code
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
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
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
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
Yeah, thanks for the help. 😄