published on Friday, Oct 30, 2026 by zenduty
published on Friday, Oct 30, 2026 by zenduty
zenduty.UserForwardingRule forwards every notification of a user to another member of the account between two points in time, for example during a vacation. The API has no update for forwarding rules, so every attribute forces a new resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as zenduty from "@pulumi/zenduty";
const alice = zenduty.getUser({
email: "alice@example.com",
});
const bob = zenduty.getUser({
email: "bob@example.com",
});
const aliceVacation = new zenduty.UserForwardingRule("alice_vacation", {
username: alice.then(alice => alice.users?.[0]?.username),
toUser: bob.then(bob => bob.users?.[0]?.username),
fromDate: "2027-08-01 00:00",
toDate: "2027-08-15 00:00",
timeZone: "Europe/Amsterdam",
});
import pulumi
import pulumi_zenduty as zenduty
alice = zenduty.get_user(email="alice@example.com")
bob = zenduty.get_user(email="bob@example.com")
alice_vacation = zenduty.UserForwardingRule("alice_vacation",
username=alice.users[0].username,
to_user=bob.users[0].username,
from_date="2027-08-01 00:00",
to_date="2027-08-15 00:00",
time_zone="Europe/Amsterdam")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/zenduty/v2/zenduty"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
alice, err := zenduty.LookupUser(ctx, &zenduty.LookupUserArgs{
Email: "alice@example.com",
}, nil)
if err != nil {
return err
}
bob, err := zenduty.LookupUser(ctx, &zenduty.LookupUserArgs{
Email: "bob@example.com",
}, nil)
if err != nil {
return err
}
_, err = zenduty.NewUserForwardingRule(ctx, "alice_vacation", &zenduty.UserForwardingRuleArgs{
Username: pulumi.String(alice.Users[0].Username),
ToUser: pulumi.String(bob.Users[0].Username),
FromDate: pulumi.String("2027-08-01 00:00"),
ToDate: pulumi.String("2027-08-15 00:00"),
TimeZone: pulumi.String("Europe/Amsterdam"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Zenduty = Pulumi.Zenduty;
return await Deployment.RunAsync(() =>
{
var alice = Zenduty.GetUser.Invoke(new()
{
Email = "alice@example.com",
});
var bob = Zenduty.GetUser.Invoke(new()
{
Email = "bob@example.com",
});
var aliceVacation = new Zenduty.UserForwardingRule("alice_vacation", new()
{
Username = alice.Apply(getUserResult => getUserResult.Users[0]?.Username),
ToUser = bob.Apply(getUserResult => getUserResult.Users[0]?.Username),
FromDate = "2027-08-01 00:00",
ToDate = "2027-08-15 00:00",
TimeZone = "Europe/Amsterdam",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.zenduty.ZendutyFunctions;
import com.pulumi.zenduty.inputs.GetUserArgs;
import com.pulumi.zenduty.UserForwardingRule;
import com.pulumi.zenduty.UserForwardingRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var alice = ZendutyFunctions.getUser(GetUserArgs.builder()
.email("alice@example.com")
.build());
final var bob = ZendutyFunctions.getUser(GetUserArgs.builder()
.email("bob@example.com")
.build());
var aliceVacation = new UserForwardingRule("aliceVacation", UserForwardingRuleArgs.builder()
.username(alice.users()[0].username())
.toUser(bob.users()[0].username())
.fromDate("2027-08-01 00:00")
.toDate("2027-08-15 00:00")
.timeZone("Europe/Amsterdam")
.build());
}
}
resources:
aliceVacation:
type: zenduty:UserForwardingRule
name: alice_vacation
properties:
username: ${alice.users[0].username}
toUser: ${bob.users[0].username}
fromDate: 2027-08-01 00:00
toDate: 2027-08-15 00:00
timeZone: Europe/Amsterdam
variables:
alice:
fn::invoke:
function: zenduty:getUser
arguments:
email: alice@example.com
bob:
fn::invoke:
function: zenduty:getUser
arguments:
email: bob@example.com
Example coming soon!
Create UserForwardingRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new UserForwardingRule(name: string, args: UserForwardingRuleArgs, opts?: CustomResourceOptions);@overload
def UserForwardingRule(resource_name: str,
args: UserForwardingRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def UserForwardingRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
from_date: Optional[str] = None,
to_date: Optional[str] = None,
to_user: Optional[str] = None,
username: Optional[str] = None,
time_zone: Optional[str] = None,
user_forwarding_rule_id: Optional[str] = None)func NewUserForwardingRule(ctx *Context, name string, args UserForwardingRuleArgs, opts ...ResourceOption) (*UserForwardingRule, error)public UserForwardingRule(string name, UserForwardingRuleArgs args, CustomResourceOptions? opts = null)
public UserForwardingRule(String name, UserForwardingRuleArgs args)
public UserForwardingRule(String name, UserForwardingRuleArgs args, CustomResourceOptions options)
type: zenduty:UserForwardingRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "zenduty_user_forwarding_rule" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args UserForwardingRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args UserForwardingRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args UserForwardingRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserForwardingRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UserForwardingRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var userForwardingRuleResource = new Zenduty.UserForwardingRule("userForwardingRuleResource", new()
{
FromDate = "string",
ToDate = "string",
ToUser = "string",
Username = "string",
TimeZone = "string",
UserForwardingRuleId = "string",
});
example, err := zenduty.NewUserForwardingRule(ctx, "userForwardingRuleResource", &zenduty.UserForwardingRuleArgs{
FromDate: pulumi.String("string"),
ToDate: pulumi.String("string"),
ToUser: pulumi.String("string"),
Username: pulumi.String("string"),
TimeZone: pulumi.String("string"),
UserForwardingRuleId: pulumi.String("string"),
})
resource "zenduty_user_forwarding_rule" "userForwardingRuleResource" {
lifecycle {
create_before_destroy = true
}
from_date = "string"
to_date = "string"
to_user = "string"
username = "string"
time_zone = "string"
user_forwarding_rule_id = "string"
}
var userForwardingRuleResource = new UserForwardingRule("userForwardingRuleResource", UserForwardingRuleArgs.builder()
.fromDate("string")
.toDate("string")
.toUser("string")
.username("string")
.timeZone("string")
.userForwardingRuleId("string")
.build());
user_forwarding_rule_resource = zenduty.UserForwardingRule("userForwardingRuleResource",
from_date="string",
to_date="string",
to_user="string",
username="string",
time_zone="string",
user_forwarding_rule_id="string")
const userForwardingRuleResource = new zenduty.UserForwardingRule("userForwardingRuleResource", {
fromDate: "string",
toDate: "string",
toUser: "string",
username: "string",
timeZone: "string",
userForwardingRuleId: "string",
});
type: zenduty:UserForwardingRule
properties:
fromDate: string
timeZone: string
toDate: string
toUser: string
userForwardingRuleId: string
username: string
UserForwardingRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The UserForwardingRule resource accepts the following input properties:
- From
Date string - Start as
YYYY-MM-DD HH:MMintime_zone. - To
Date string - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - To
User string - Username of the member who receives them.
- Username string
- Username of the user whose notifications are forwarded.
- Time
Zone string - IANA time zone of the dates. Defaults to
UTC. - User
Forwarding stringRule Id - The unique_id of the forwarding rule.
- From
Date string - Start as
YYYY-MM-DD HH:MMintime_zone. - To
Date string - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - To
User string - Username of the member who receives them.
- Username string
- Username of the user whose notifications are forwarded.
- Time
Zone string - IANA time zone of the dates. Defaults to
UTC. - User
Forwarding stringRule Id - The unique_id of the forwarding rule.
- from_
date string - Start as
YYYY-MM-DD HH:MMintime_zone. - to_
date string - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - to_
user string - Username of the member who receives them.
- username string
- Username of the user whose notifications are forwarded.
- time_
zone string - IANA time zone of the dates. Defaults to
UTC. - user_
forwarding_ stringrule_ id - The unique_id of the forwarding rule.
- from
Date String - Start as
YYYY-MM-DD HH:MMintime_zone. - to
Date String - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - to
User String - Username of the member who receives them.
- username String
- Username of the user whose notifications are forwarded.
- time
Zone String - IANA time zone of the dates. Defaults to
UTC. - user
Forwarding StringRule Id - The unique_id of the forwarding rule.
- from
Date string - Start as
YYYY-MM-DD HH:MMintime_zone. - to
Date string - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - to
User string - Username of the member who receives them.
- username string
- Username of the user whose notifications are forwarded.
- time
Zone string - IANA time zone of the dates. Defaults to
UTC. - user
Forwarding stringRule Id - The unique_id of the forwarding rule.
- from_
date str - Start as
YYYY-MM-DD HH:MMintime_zone. - to_
date str - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - to_
user str - Username of the member who receives them.
- username str
- Username of the user whose notifications are forwarded.
- time_
zone str - IANA time zone of the dates. Defaults to
UTC. - user_
forwarding_ strrule_ id - The unique_id of the forwarding rule.
- from
Date String - Start as
YYYY-MM-DD HH:MMintime_zone. - to
Date String - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - to
User String - Username of the member who receives them.
- username String
- Username of the user whose notifications are forwarded.
- time
Zone String - IANA time zone of the dates. Defaults to
UTC. - user
Forwarding StringRule Id - The unique_id of the forwarding rule.
Outputs
All input properties are implicitly available as output properties. Additionally, the UserForwardingRule resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing UserForwardingRule Resource
Get an existing UserForwardingRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: UserForwardingRuleState, opts?: CustomResourceOptions): UserForwardingRule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
from_date: Optional[str] = None,
time_zone: Optional[str] = None,
to_date: Optional[str] = None,
to_user: Optional[str] = None,
user_forwarding_rule_id: Optional[str] = None,
username: Optional[str] = None) -> UserForwardingRulefunc GetUserForwardingRule(ctx *Context, name string, id IDInput, state *UserForwardingRuleState, opts ...ResourceOption) (*UserForwardingRule, error)public static UserForwardingRule Get(string name, Input<string> id, UserForwardingRuleState? state, CustomResourceOptions? opts = null)public static UserForwardingRule get(String name, Output<String> id, UserForwardingRuleState state, CustomResourceOptions options)resources: _: type: zenduty:UserForwardingRule get: id: ${id}import {
to = zenduty_user_forwarding_rule.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- From
Date string - Start as
YYYY-MM-DD HH:MMintime_zone. - Time
Zone string - IANA time zone of the dates. Defaults to
UTC. - To
Date string - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - To
User string - Username of the member who receives them.
- User
Forwarding stringRule Id - The unique_id of the forwarding rule.
- Username string
- Username of the user whose notifications are forwarded.
- From
Date string - Start as
YYYY-MM-DD HH:MMintime_zone. - Time
Zone string - IANA time zone of the dates. Defaults to
UTC. - To
Date string - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - To
User string - Username of the member who receives them.
- User
Forwarding stringRule Id - The unique_id of the forwarding rule.
- Username string
- Username of the user whose notifications are forwarded.
- from_
date string - Start as
YYYY-MM-DD HH:MMintime_zone. - time_
zone string - IANA time zone of the dates. Defaults to
UTC. - to_
date string - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - to_
user string - Username of the member who receives them.
- user_
forwarding_ stringrule_ id - The unique_id of the forwarding rule.
- username string
- Username of the user whose notifications are forwarded.
- from
Date String - Start as
YYYY-MM-DD HH:MMintime_zone. - time
Zone String - IANA time zone of the dates. Defaults to
UTC. - to
Date String - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - to
User String - Username of the member who receives them.
- user
Forwarding StringRule Id - The unique_id of the forwarding rule.
- username String
- Username of the user whose notifications are forwarded.
- from
Date string - Start as
YYYY-MM-DD HH:MMintime_zone. - time
Zone string - IANA time zone of the dates. Defaults to
UTC. - to
Date string - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - to
User string - Username of the member who receives them.
- user
Forwarding stringRule Id - The unique_id of the forwarding rule.
- username string
- Username of the user whose notifications are forwarded.
- from_
date str - Start as
YYYY-MM-DD HH:MMintime_zone. - time_
zone str - IANA time zone of the dates. Defaults to
UTC. - to_
date str - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - to_
user str - Username of the member who receives them.
- user_
forwarding_ strrule_ id - The unique_id of the forwarding rule.
- username str
- Username of the user whose notifications are forwarded.
- from
Date String - Start as
YYYY-MM-DD HH:MMintime_zone. - time
Zone String - IANA time zone of the dates. Defaults to
UTC. - to
Date String - End as
YYYY-MM-DD HH:MMintime_zone, afterfrom_date. - to
User String - Username of the member who receives them.
- user
Forwarding StringRule Id - The unique_id of the forwarding rule.
- username String
- Username of the user whose notifications are forwarded.
Import
hcl
resource “zenduty_user_forwarding_rule” “alice_vacation” {
}
$ pulumi import zenduty:index/userForwardingRule:UserForwardingRule alice_vacation username/forwarding_rule_id`
$ terraform state show zenduty_user_forwarding_rule.alice_vacation
* copy the output data and paste inside zenduty_user_forwarding_rule.alice_vacation resource block and remove the id attribute
$ pulumi preview to verify the import
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- zenduty zenduty/terraform-provider-zenduty
- License
- Notes
- This Pulumi package is based on the
zendutyTerraform Provider.
published on Friday, Oct 30, 2026 by zenduty