able-zebra-36923
02/29/2024, 7:57 PM[]*pagerduty.User
, same for pager duty teams.
I will have to use the IDs for other ressources but I also want to compare a string with pulumi.StringOutput
is it only possible using the applyT function ?
Also, if I want to make sure that the ID (or name or email) of the pagerduty user is avaible, i'il still need to use the applyT function ?little-cartoon-10569
02/29/2024, 8:18 PMlittle-cartoon-10569
02/29/2024, 8:19 PMable-zebra-36923
02/29/2024, 8:39 PMlittle-cartoon-10569
02/29/2024, 8:41 PMlittle-cartoon-10569
02/29/2024, 8:44 PMable-zebra-36923
02/29/2024, 8:53 PMpulumi.IDOutput
, will pulumi handle (in the membership resource) the wait (that the user is created) ?little-cartoon-10569
02/29/2024, 9:03 PMlittle-cartoon-10569
02/29/2024, 9:03 PMlittle-cartoon-10569
02/29/2024, 9:05 PMable-zebra-36923
02/29/2024, 9:11 PMlittle-cartoon-10569
02/29/2024, 9:22 PMlittle-cartoon-10569
02/29/2024, 9:23 PMlittle-cartoon-10569
02/29/2024, 9:25 PMable-zebra-36923
02/29/2024, 9:27 PMlittle-cartoon-10569
02/29/2024, 9:50 PMlittle-cartoon-10569
02/29/2024, 9:51 PMlittle-cartoon-10569
02/29/2024, 9:52 PMable-zebra-36923
03/01/2024, 7:34 AMmap[*string*]*pagerduty.User{}
to store my user with createdUsers[userInfo.Email] = user
, same for teams, and i did
for _, user := range users {
if len(user.Teams) != 0 {
for _, teamName := range user.Teams {
pdUserID = pdUsers[user.Email].ID()
pdTeamID = pdTeams[teamName].ID()
_, err := pagerduty.NewTeamMembership(ctx, teamName+user.Email, &pagerduty.TeamMembershipArgs{
UserId: pdUserID,
TeamId: pdTeamID,
Role: pulumi.String("manager"),
})
and it works.
But I had a bug, I imported the team membership and I had this diff :
[provider: urn:pulumi:alteia::pagerduty::pulumi:providers:pagerduty::default_4_8_1::5838e4ef-9af4-4874-b4a7-1183eb53abc8 => urn:pulumi:alteia::pagerduty::pulumi:providers:pagerduty::default::1676f13a-f0a9-4f25-9cc8-22a9d3ec30f7]
+ role : "manager"
even though the role was already defined ... I applied and it works also ...
Same for users where pulumi wanted to remove the timezone ... 🤷♂️little-cartoon-10569
03/03/2024, 7:04 PMuser.Email
, can you not use user.ID
? Why do you have to use pdUsers[user.Email].ID
? I'm assuming that user
is the resource returned by Pulumi.able-zebra-36923
03/04/2024, 7:21 AM