https://pulumi.com logo
Title
r

rough-hydrogen-27449

07/09/2021, 8:28 PM
Hi, I'm trying to build a project on Confluent Cloud using the
pulumi_confluent
and
pulumi_kafka
providers. My initial structure was to have two separate projects, one for the Confluent Cloud infrastructure
confluent-cloud-infra
and one for the main application
main-infra
. My plan is to manage the Confluent Cloud resources for each of my stacks in the
confluent-cloud-infra
project and
pulumi.export
data like this:
def main() -> None:
    confluent = Confluent(name=f"{pulumi.get_stack()}_Confluent")
    pulumi.export(
        "confluent",
        {
            "bootstrap_servers": confluent.kafka_cluster.bootstrap_servers,
            "pulumi_api_key": confluent.pulumi_api_key,
            "service_credentials": confluent.service_credentials,
        }
   )
Then, I plan to consume these data via a
StackReference
in my
main-infra
project and create all my application-specifc resources (topics, ACLs) with the
pulumi_kafka
provider. The issue I've run into, and the reason for my question, is that the
pulumi_kafka
provider expects e.g. the
bootstrap_servers
to be passed in as a configuration parameter (https://github.com/pulumi/pulumi-kafka/blob/master/README.md#configuration), and as far as I can tell I can't mutate the
pulumi.Config
object. Is there a way to dynamically update my configuration at runtime? Or is it a hard constraint that I must set these values in my configuration file?