i think you need apply(). containerDefinitions: se...
# general
p
i think you need apply(). containerDefinitions: service.arn.apply((arn) => JSON.stringify({…. value: arn … })
b
Hey @proud-pizza-80589 thanks so much! I actually got there in the end and figured out the apply thing so thanks for the pointer - it was exactly right. I'm a bit concerned having started the journey though ... I thought Pulumi would be able to reference resources, now I'm concerned I'll need to do this everytime I need to reference resources between eachother, e.g. subnets. Surely this isn't the case? Are there specific times when apply MUST be called?
p
only if you want to use stuff as strings
e.g. here, i can use the namespace name right from the Pulumi Output
Copy code
this.internalService = new k8s.core.v1.Service(
      name,
      {
        metadata: {
          labels: compileLabels(subject, SmartContractSet.name),
          namespace: namespace.metadata.name,
        },
        spec: {
          ports: [
            {
              port: 8080,
              name: 'http',
              protocol: 'TCP',
              targetPort: 'http',
            },
          ],
          selector: compileSelectorLabels(subject),
          type: 'ClusterIP',
        },
      },
      { parent: this, provider: opts.provider }
    );
there is a section about this in the docs which explains when and why it needs apply