Hello! I’m new to Pulumi (and TS) and am strugglin...
# getting-started
a
Hello! I’m new to Pulumi (and TS) and am struggling with something that I think should be fairly straight forward. Scenario: I have existing users and groups in an Azure AD. I would like to programmatically manage certain groups. I have a github admins group where the owners are the platform team, but the members should also include an additional user (Director of Development). I can’t for the life of me figure out how to concat two groups together in a way that TS likes for this object. Code to come in a moment.
I’ve tried several permutations to pull these together. Under the TS they’re just a list of object IDs, but I’m struggling to get them out of the nested Pulumi stuff.
Any help would be greatly appreciated
b
@adventurous-television-3865 this doesn’t answer your question, but I think the easier way to do this is:
Copy code
const githubAdminsGroup = new azuread.Group("github-admins", {
  displayName: "github-admins",
  owners: sourcePlatformGroup.members,
  securityEnabled: true,
});

const exampleGroupMember = new azuread.GroupMember("githubMembers", {
    groupObjectId: githubAdminsGroup.id,
    memberObjectId: // add member objects for each user here,
});
👍 1
🙏 1
a
Thanks for the suggestion. I think I’m going to take that approach as well, but I’m still going to have the issue of having to merge the two lists of object IDs.
b
you can merge the two lists inside a promise resolution (or a pulumi output resolution) - the real problem is that you then have to do things like create resources inside the
.then
or the
apply
l
Is
members
an Output<array> of Output<string>s (ids)? You may be able to use
Copy code
members: pulumi.all([array1, array2])
  .apply(([a1,  a2]) => [...a1, ...a2]);
This won't work if the type of members isn't
Output<Output<string>[]>
or similarl.
a
thank you both! I will try those tomorrow!