Background: we are experimenting with Pulumi on A...
# general
s
Background: we are experimenting with Pulumi on Azure with GoLang. Noobie question: After we created a new
containerservice.ManagedCluster
, we would like to retrieve the generated default security group for the agent pools, and apply a more stringent set of traffic rules. I tried to use
network.LookupNetworkSecurityGroup
to do so, but there doesn't seem to have a way to resolve a
pulumi.StringOutput
managedCluster.nodeSecurityGroup
promises back to a string within subsequent codes in the same custom module. If this is not possible, what are the recommended mechanism to achieve what we wanted to do? (create a resource then modify some of the azure generated / created properties within the same stack)
Copy code
network.LookupNetworkSecurityGroup(
    ctx, &network.LookupNetworkSecurityGroupArgs{
      ResourceGroupName: <- this parameter requires a concrete string type,
    },
Is the expected solution either 1) construct the managed networksecurity group name since it is a well know pattern, or 2) do the tightening of the security group in a separate stack using stack export / import mechanism?
l
Generally: don't use resources created automatically by the provider. Just create your own always.