https://pulumi.com logo
#general
Title
# general
e

elegant-crayon-4967

04/01/2020, 9:35 PM
I’m creating a type of tags like this
Copy code
readonly tags: pulumi.Input<{
      [key: string]: pulumi.Input<string>;
    }>;
When I try to call a value in there like follows
pulumi.all([tags.t_env]).apply
I get error
Copy code
Property 't_env' does not exist on type 'Input<{ [key: string]: Input<string>; }>'.
  Property 't_env' does not exist on type 'Promise<{ [key: string]: Input<string>; }>'.ts(2339)
h

handsome-actor-1155

04/01/2020, 9:38 PM
Here’s how I do it in TS:
Copy code
const baseTags = {
    Owner: config.require("ownerTag")
};

// Create a VPC for our cluster.
const vpc = new awsx.ec2.Vpc("kafka-vpc", {
    numberOfAvailabilityZones: numberOfAvailZones,
    tags: {
        ...baseTags,
        Name: config.require("vpcName")
    }
});
Not sure if that helps
e

elegant-crayon-4967

04/01/2020, 9:40 PM
I’m just trying to reference one of the tag values as a string
I just said heck with it and changed it any type