import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Use this resource to create, update, and delete [New Relic Teams](https://docs.newrelic.com/docs/service-architecture-intelligence/teams/teams-intro/). * * Teams group people and associate owned entities (services, dashboards, scorecards, and more) under a single operational identity. They appear across alerts, service maps, and the Teams UI. * * > **NOTE:** Entity ownership is managed non-authoritatively. Terraform tracks only the entities you declare in the `entities` block and ensures they remain in the collection. Entities added to the collection outside Terraform — through tag-based discovery or manual additions via the UI or API — are not surfaced as drift and are not removed on apply. To disable entity management entirely and suppress all entity-related plan output, set `entityManagementMode = "unmanaged"`. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const platform = new newrelic.Team("platform", { * name: "Platform Engineering", * description: "Owns core platform services and shared infrastructure", * aliases: [ * "platform", * "infra", * ], * tags: [ * { * key: "department", * values: ["engineering"], * }, * { * key: "tier", * values: ["1"], * }, * ], * members: [ * 1234567, * 2345678, * ], * managers: [1234567], * resources: [ * { * type: "GITHUB", * content: "https://github.com/example-org/platform", * title: "GitHub Repository", * }, * { * type: "SLACK", * content: "https://example.slack.com/channels/platform-eng", * title: "Team Slack Channel", * }, * ], * entityManagementMode: "managed", * entities: [ * "MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1", * engineeringStandards.id, * ], * }); * ``` * * See additional examples below. * * ## Entity Ownership Modes * * ### `managed` (default) * * Terraform manages a declared set of entities within the team's ownership collection using a non-authoritative approach. You declare which entity GUIDs Terraform should track; Terraform ensures those entities are present in the collection and surfaces a plan change only when one of them is missing. * * Entities added to the collection outside Terraform — through tag-based discovery or manual additions via the UI or API — are not surfaced as drift and are not removed on apply. This means the ownership collection can contain more entities than are declared in `entities`, and Terraform will not interfere with those additional entries. * * **When to use:** You want Terraform to maintain a specific set of owned entities (for example, a scorecard or a key service) while allowing the platform to populate the rest of the collection through its own discovery mechanisms. * * **Behaviour:** * - Entities declared in the `entities` block are added to the collection on apply. * - Entities removed from the `entities` block are removed from the collection on apply. * - If a declared entity is removed from the collection outside Terraform, the next plan surfaces a change to re-add it. * - Entities present in the collection but not declared in `entities` are silently ignored — no drift, no warnings. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const example = new newrelic.Team("example", { * name: "Payments Service", * entityManagementMode: "managed", * entities: [ * "MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1", * platformStandards.id, * ], * }); * ``` * * ### `unmanaged` * * Terraform does not manage the team's entity ownership collection at all. The collection is left entirely to the New Relic platform — tag-based discovery or manual management through the Teams UI or API. * * **When to use:** Entity ownership for this team is governed entirely outside Terraform (for example, by tagging conventions). You want to manage the team resource itself — name, aliases, members — without Terraform interfering with what the platform assigns to the collection. * * **Behaviour:** * - The `entities` attribute cannot be set in config. The provider returns a plan-time error if it is. * - The `entities` attribute is always empty in state. * - No drift is surfaced for the ownership collection, regardless of what is added or removed externally. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const example = new newrelic.Team("example", { * name: "Payments Service", * entityManagementMode: "unmanaged", * }); * ``` * * ### Switching Between Modes * * Switching from `managed` to `unmanaged` clears `entities` from state on the next apply. The ownership collection itself is **not modified** — entities remain in the collection and are governed entirely outside Terraform from that point. * * Switching from `unmanaged` back to `managed` allows entity tracking to resume. Entities already in the collection are unaffected; you can begin declaring any of them in the `entities` block to bring them under Terraform management. * * ## Hierarchy Levels * * When teams are linked via `parentId`, the platform automatically assigns each team a `hierarchyLevelId` based on its depth in the hierarchy. This value becomes available on the **next** plan after `parentId` is first set. * * You can reference `hierarchyLevelId` directly in `newrelic.TeamsOrganizationSettings` to rename the level, without requiring a separate NerdGraph query or data source lookup: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const division = new newrelic.Team("division", {name: "Engineering Division"}); * const squad = new newrelic.Team("squad", { * name: "Backend Squad", * parentId: division.id, * }); * const org = new newrelic.TeamsOrganizationSettings("org", {hierarchyLevels: [ * { * id: division.hierarchyLevelId, * name: "Division", * }, * { * id: squad.hierarchyLevelId, * name: "Squad", * }, * ]}); * ``` * * Alternatively, use the `newrelic.getTeamsHierarchyLevels` data source to reference levels by index: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const all = newrelic.getTeamsHierarchyLevels({}); * const org = new newrelic.TeamsOrganizationSettings("org", {hierarchyLevels: [{ * id: all.then(all => all.levels?.[0]?.id), * name: "Division", * }]}); * ``` * * ## Additional Examples * * ### Minimal team * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const backend = new newrelic.Team("backend", {name: "Backend Engineering"}); * ``` * * ### Team with a parent (hierarchy) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const engineering = new newrelic.Team("engineering", { * name: "Engineering", * description: "Top-level engineering division", * }); * const backend = new newrelic.Team("backend", { * name: "Backend", * parentId: engineering.id, * }); * ``` * * ### Team owning a scorecard * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const standards = new newrelic.Scorecard("standards", { * name: "Engineering Standards", * ruleIds: [alertCoverage.id], * }); * const platform = new newrelic.Team("platform", { * name: "Platform", * entityManagementMode: "managed", * entities: [standards.id], * }); * ``` * * ### Team with externally managed entity ownership * * Use `unmanaged` mode when entity ownership is managed outside Terraform — through tag-based discovery, relationship rules, or the Teams UI — and you do not want Terraform to produce any drift for the ownership collection. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const payments = new newrelic.Team("payments", { * name: "Payments", * aliases: ["payments-service"], * entityManagementMode: "unmanaged", * }); * ``` * * ### Team with members, managers, and supplemental resources * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const platform = new newrelic.Team("platform", { * name: "Platform Engineering", * description: "Owns shared infrastructure and developer tooling", * members: [ * 1234567, * 2345678, * 3456789, * ], * managers: [1234567], * resources: [ * { * type: "GITHUB", * content: "https://github.com/example-org/platform", * title: "Source Repository", * }, * { * type: "SLACK", * content: "https://example.slack.com/channels/platform-eng", * title: "Team Channel", * }, * { * type: "PAGERDUTY", * content: "https://example.pagerduty.com/teams/platform", * title: "On-Call Schedule", * }, * ], * }); * ``` * * ## Import * * Teams can be imported using the entity GUID: * * ```sh * $ pulumi import newrelic:index/team:Team example * ``` * * To find a team's GUID after creating it, use `terraform state show` or the following NerdGraph query: */ export declare class Team extends pulumi.CustomResource { /** * Get an existing Team resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: TeamState, opts?: pulumi.CustomResourceOptions): Team; /** * Returns true if the given object is an instance of Team. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Team; /** * Additional searchable names for the team. Each alias must be unique within the organization. */ readonly aliases: pulumi.Output; /** * A free-text description of the team. */ readonly description: pulumi.Output; /** * Set of entity GUIDs that this team owns. Added to the team's auto-created ownership collection. */ readonly entities: pulumi.Output; /** * Controls how Terraform manages this team's entity ownership collection. * * • `managed` (default): Terraform tracks the entities declared in the entities block and ensures they remain in the collection. Drift surfaces only when a declared entity goes missing. External additions are silently ignored. * • `unmanaged`: Terraform does not control entity ownership. The ownership collection is left entirely to tag-based discovery and/or manual UI management. No drift or warnings are shown for entities, and the `entities` attribute cannot be set in this mode. */ readonly entityManagementMode: pulumi.Output; /** * The GUID of the hierarchy level this team is assigned to. The platform assigns this automatically based on the team's depth in the `parentId` chain. It becomes available on the plan cycle **after** `parentId` is first set (one refresh cycle of eventual consistency). Matches a level GUID from the `newrelic.TeamsOrganizationSettings` `hierarchyLevels` list. See Hierarchy Levels. */ readonly hierarchyLevelId: pulumi.Output; /** * Set of New Relic user IDs (integers) to designate as team managers. Each ID must also appear in members. */ readonly managers: pulumi.Output; /** * Set of New Relic user IDs (integers) to add as members of this team. Managers must be a subset of members. */ readonly members: pulumi.Output; /** * The GUID of the auto-created team membership collection. Managed by the provider; do not modify directly. */ readonly membershipCollectionId: pulumi.Output; /** * The name of the team. Must be unique within the organization. */ readonly name: pulumi.Output; /** * The organisation UUID, resolved automatically from the provider account. */ readonly organizationId: pulumi.Output; /** * The GUID of the auto-created team ownership collection. Managed by the provider; do not modify directly. */ readonly ownershipCollectionId: pulumi.Output; /** * Entity management GUID of the parent team. Cannot be set to the team's own GUID. */ readonly parentId: pulumi.Output; /** * Supplemental resource links attached to this team (e.g. runbooks, chat channels, on-call schedules). These are displayed in the team's Settings page in the New Relic UI under Contacts or Links, automatically categorised by type. */ readonly resources: pulumi.Output; /** * Tags to assign to this resource. Each tag has a key and one or more values. */ readonly tags: pulumi.Output; /** * Create a Team resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: TeamArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Team resources. */ export interface TeamState { /** * Additional searchable names for the team. Each alias must be unique within the organization. */ aliases?: pulumi.Input[] | undefined>; /** * A free-text description of the team. */ description?: pulumi.Input; /** * Set of entity GUIDs that this team owns. Added to the team's auto-created ownership collection. */ entities?: pulumi.Input[] | undefined>; /** * Controls how Terraform manages this team's entity ownership collection. * * • `managed` (default): Terraform tracks the entities declared in the entities block and ensures they remain in the collection. Drift surfaces only when a declared entity goes missing. External additions are silently ignored. * • `unmanaged`: Terraform does not control entity ownership. The ownership collection is left entirely to tag-based discovery and/or manual UI management. No drift or warnings are shown for entities, and the `entities` attribute cannot be set in this mode. */ entityManagementMode?: pulumi.Input; /** * The GUID of the hierarchy level this team is assigned to. The platform assigns this automatically based on the team's depth in the `parentId` chain. It becomes available on the plan cycle **after** `parentId` is first set (one refresh cycle of eventual consistency). Matches a level GUID from the `newrelic.TeamsOrganizationSettings` `hierarchyLevels` list. See Hierarchy Levels. */ hierarchyLevelId?: pulumi.Input; /** * Set of New Relic user IDs (integers) to designate as team managers. Each ID must also appear in members. */ managers?: pulumi.Input[] | undefined>; /** * Set of New Relic user IDs (integers) to add as members of this team. Managers must be a subset of members. */ members?: pulumi.Input[] | undefined>; /** * The GUID of the auto-created team membership collection. Managed by the provider; do not modify directly. */ membershipCollectionId?: pulumi.Input; /** * The name of the team. Must be unique within the organization. */ name?: pulumi.Input; /** * The organisation UUID, resolved automatically from the provider account. */ organizationId?: pulumi.Input; /** * The GUID of the auto-created team ownership collection. Managed by the provider; do not modify directly. */ ownershipCollectionId?: pulumi.Input; /** * Entity management GUID of the parent team. Cannot be set to the team's own GUID. */ parentId?: pulumi.Input; /** * Supplemental resource links attached to this team (e.g. runbooks, chat channels, on-call schedules). These are displayed in the team's Settings page in the New Relic UI under Contacts or Links, automatically categorised by type. */ resources?: pulumi.Input[] | undefined>; /** * Tags to assign to this resource. Each tag has a key and one or more values. */ tags?: pulumi.Input[] | undefined>; } /** * The set of arguments for constructing a Team resource. */ export interface TeamArgs { /** * Additional searchable names for the team. Each alias must be unique within the organization. */ aliases?: pulumi.Input[] | undefined>; /** * A free-text description of the team. */ description?: pulumi.Input; /** * Set of entity GUIDs that this team owns. Added to the team's auto-created ownership collection. */ entities?: pulumi.Input[] | undefined>; /** * Controls how Terraform manages this team's entity ownership collection. * * • `managed` (default): Terraform tracks the entities declared in the entities block and ensures they remain in the collection. Drift surfaces only when a declared entity goes missing. External additions are silently ignored. * • `unmanaged`: Terraform does not control entity ownership. The ownership collection is left entirely to tag-based discovery and/or manual UI management. No drift or warnings are shown for entities, and the `entities` attribute cannot be set in this mode. */ entityManagementMode?: pulumi.Input; /** * Set of New Relic user IDs (integers) to designate as team managers. Each ID must also appear in members. */ managers?: pulumi.Input[] | undefined>; /** * Set of New Relic user IDs (integers) to add as members of this team. Managers must be a subset of members. */ members?: pulumi.Input[] | undefined>; /** * The name of the team. Must be unique within the organization. */ name?: pulumi.Input; /** * Entity management GUID of the parent team. Cannot be set to the team's own GUID. */ parentId?: pulumi.Input; /** * Supplemental resource links attached to this team (e.g. runbooks, chat channels, on-call schedules). These are displayed in the team's Settings page in the New Relic UI under Contacts or Links, automatically categorised by type. */ resources?: pulumi.Input[] | undefined>; /** * Tags to assign to this resource. Each tag has a key and one or more values. */ tags?: pulumi.Input[] | undefined>; } //# sourceMappingURL=team.d.ts.map