import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Use this resource to create and manage New Relic fleet deployments. * * A fleet deployment defines the agent versions and configuration versions to roll out to a fleet. Each deployment belongs to a fleet and may contain zero or more `agent` blocks describing which agent type and version to deploy and which configuration version (from `newrelic.FleetConfiguration`) to apply. * * > **Note: Phase-gate immutability.** Deployments can only be modified while in the `CREATED` phase. Once the fleet backend begins executing the deployment (phase advances to `IN_PROGRESS`, `FAILED`, or `COMPLETED`), any attempt to change `name`, `description`, `agent`, or `tags` is **blocked at plan time** with a clear error. The recommended recovery path is `terraform state rm ` (or a `removed` block) to drop the executed deployment from Terraform state, then re-declare a fresh deployment with the desired configuration. `terraform destroy` works only if you have no pending changes to the deployment in your HCL — otherwise the same plan-time gate fires during the destroy plan. * * ## Example Usage * * ### Basic Deployment * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const infraCfg = new newrelic.FleetConfiguration("infra_cfg", { * name: "Production Infra Config", * agentType: "NRInfra", * managedEntityType: "HOST", * operatingSystem: "LINUX", * configurationContent: `log: * level: info * `, * }); * const infra = new newrelic.FleetDeployment("infra", { * fleetId: prod.id, * name: "Production Infra Deployment", * description: "Deploys NRInfra v1.58.0 with the production config", * agents: [{ * agentType: "NRInfra", * version: "1.58.0", * configurationVersionId: infraCfg.latestVersionEntityId, * }], * }); * ``` * * ### Multiple Agents * * Each `agentType` may appear at most once per deployment. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const fullStack = new newrelic.FleetDeployment("full_stack", { * fleetId: prod.id, * name: "Full Stack Deployment", * agents: [ * { * agentType: "NRInfra", * version: "1.58.0", * configurationVersionId: infraCfg.latestVersionEntityId, * }, * { * agentType: "FluentBit", * version: "3.2.0", * configurationVersionId: fbCfg.latestVersionEntityId, * }, * ], * }); * ``` * * ### Zero-Agent Deployment * * A deployment can be created or updated with zero `agent` blocks — for example, to drain all agent assignments from an existing deployment, or to seed a deployment record that will have agents added later (while still in `CREATED` phase). * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const drained = new newrelic.FleetDeployment("drained", { * fleetId: prod.id, * name: "Drained deployment", * }); * ``` * * ### Pinning to a Specific Configuration Version * * By default, referencing `newrelic_fleet_configuration..latest_version_entity_id` ties the deployment to whichever version is current at plan time. Updating the configuration's `configurationContent` will change `latestVersionEntityId`, which in turn proposes an update to any deployment referencing it. If the deployment has already left `CREATED`, that update will be **blocked by the phase-gate** — see the note above. * * For long-lived deployments that should remain stable, pin to a specific historical version instead: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const pinned = new newrelic.FleetDeployment("pinned", { * fleetId: prod.id, * name: "Stable v1 rollout", * agents: [{ * agentType: "NRInfra", * version: "1.58.0", * configurationVersionId: infraCfg.versionEntityIds[0], * }], * }); * ``` * * ### With Tags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const infra = new newrelic.FleetDeployment("infra", { * fleetId: prod.id, * name: "Production Deployment", * agents: [{ * agentType: "NRInfra", * version: "1.58.0", * configurationVersionId: infraCfg.latestVersionEntityId, * }], * tags: [ * "environment:production", * "team:platform", * ], * }); * ``` * * ## Import * * Fleet deployments can be imported using the deployment entity GUID: * * ```sh * $ pulumi import newrelic:index/fleetDeployment:FleetDeployment infra * ``` */ export declare class FleetDeployment extends pulumi.CustomResource { /** * Get an existing FleetDeployment 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?: FleetDeploymentState, opts?: pulumi.CustomResourceOptions): FleetDeployment; /** * Returns true if the given object is an instance of FleetDeployment. 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 FleetDeployment; /** * Zero or more `agent` blocks. An empty list is accepted on both create and update — useful to drain agent assignments. Each `agentType` may appear at most once per deployment. See Nested `agent` blocks below. */ readonly agents: pulumi.Output; /** * The entity GUID of the deployment. */ readonly deploymentId: pulumi.Output; /** * A description of the deployment. */ readonly description: pulumi.Output; /** * The entity GUID of the fleet this deployment belongs to. **Cannot be changed after creation.** */ readonly fleetId: pulumi.Output; /** * The name of the deployment. Updatable while the deployment is in `CREATED` phase. */ readonly name: pulumi.Output; /** * The organization ID. Auto-fetched from the account when not provided. **Cannot be changed after creation.** */ readonly organizationId: pulumi.Output; /** * The current phase of the deployment. Possible values: `CREATED`, `IN_PROGRESS`, `FAILED`, `COMPLETED`. */ readonly phase: pulumi.Output; /** * A list of tags in `key:value1,value2` format. */ readonly tags: pulumi.Output; /** * Create a FleetDeployment 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: FleetDeploymentArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FleetDeployment resources. */ export interface FleetDeploymentState { /** * Zero or more `agent` blocks. An empty list is accepted on both create and update — useful to drain agent assignments. Each `agentType` may appear at most once per deployment. See Nested `agent` blocks below. */ agents?: pulumi.Input[] | undefined>; /** * The entity GUID of the deployment. */ deploymentId?: pulumi.Input; /** * A description of the deployment. */ description?: pulumi.Input; /** * The entity GUID of the fleet this deployment belongs to. **Cannot be changed after creation.** */ fleetId?: pulumi.Input; /** * The name of the deployment. Updatable while the deployment is in `CREATED` phase. */ name?: pulumi.Input; /** * The organization ID. Auto-fetched from the account when not provided. **Cannot be changed after creation.** */ organizationId?: pulumi.Input; /** * The current phase of the deployment. Possible values: `CREATED`, `IN_PROGRESS`, `FAILED`, `COMPLETED`. */ phase?: pulumi.Input; /** * A list of tags in `key:value1,value2` format. */ tags?: pulumi.Input[] | undefined>; } /** * The set of arguments for constructing a FleetDeployment resource. */ export interface FleetDeploymentArgs { /** * Zero or more `agent` blocks. An empty list is accepted on both create and update — useful to drain agent assignments. Each `agentType` may appear at most once per deployment. See Nested `agent` blocks below. */ agents?: pulumi.Input[] | undefined>; /** * A description of the deployment. */ description?: pulumi.Input; /** * The entity GUID of the fleet this deployment belongs to. **Cannot be changed after creation.** */ fleetId: pulumi.Input; /** * The name of the deployment. Updatable while the deployment is in `CREATED` phase. */ name?: pulumi.Input; /** * The organization ID. Auto-fetched from the account when not provided. **Cannot be changed after creation.** */ organizationId?: pulumi.Input; /** * A list of tags in `key:value1,value2` format. */ tags?: pulumi.Input[] | undefined>; } //# sourceMappingURL=fleetDeployment.d.ts.map