1. Packages
  2. Pulumi Cloud (Pulumi Service provider)
  3. API Docs
  4. ApprovalRule

This provider is currently in preview.

Pulumi Cloud v0.31.0 published on Friday, Aug 1, 2025 by Pulumi

pulumiservice.ApprovalRule

Explore with Pulumi AI

pulumiservice logo

This provider is currently in preview.

Pulumi Cloud v0.31.0 published on Friday, Aug 1, 2025 by Pulumi

    An approval rule for environment deployments.

    Create ApprovalRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ApprovalRule(name: string, args: ApprovalRuleArgs, opts?: CustomResourceOptions);
    @overload
    def ApprovalRule(resource_name: str,
                     args: ApprovalRuleArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApprovalRule(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     approval_rule_config: Optional[ApprovalRuleConfigArgs] = None,
                     enabled: Optional[bool] = None,
                     environment_identifier: Optional[EnvironmentIdentifierArgs] = None,
                     name: Optional[str] = None,
                     target_action_types: Optional[Sequence[TargetActionType]] = None)
    func NewApprovalRule(ctx *Context, name string, args ApprovalRuleArgs, opts ...ResourceOption) (*ApprovalRule, error)
    public ApprovalRule(string name, ApprovalRuleArgs args, CustomResourceOptions? opts = null)
    public ApprovalRule(String name, ApprovalRuleArgs args)
    public ApprovalRule(String name, ApprovalRuleArgs args, CustomResourceOptions options)
    
    type: pulumiservice:ApprovalRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ApprovalRuleArgs
    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 ApprovalRuleArgs
    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 ApprovalRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApprovalRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApprovalRuleArgs
    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 approvalRuleResource = new PulumiService.ApprovalRule("approvalRuleResource", new()
    {
        ApprovalRuleConfig = new PulumiService.Inputs.ApprovalRuleConfigArgs
        {
            AllowSelfApproval = false,
            EligibleApprovers = new[]
            {
                new PulumiService.Inputs.EligibleApproverArgs
                {
                    RbacPermission = PulumiService.RbacPermission.Read,
                    TeamName = "string",
                    User = "string",
                },
            },
            NumApprovalsRequired = 0,
            RequireReapprovalOnChange = false,
        },
        Enabled = false,
        EnvironmentIdentifier = new PulumiService.Inputs.EnvironmentIdentifierArgs
        {
            Name = "string",
            Organization = "string",
            Project = "string",
        },
        Name = "string",
        TargetActionTypes = new[]
        {
            PulumiService.TargetActionType.Update,
        },
    });
    
    example, err := pulumiservice.NewApprovalRule(ctx, "approvalRuleResource", &pulumiservice.ApprovalRuleArgs{
    	ApprovalRuleConfig: &pulumiservice.ApprovalRuleConfigArgs{
    		AllowSelfApproval: pulumi.Bool(false),
    		EligibleApprovers: pulumiservice.EligibleApproverArray{
    			&pulumiservice.EligibleApproverArgs{
    				RbacPermission: pulumiservice.RbacPermissionRead,
    				TeamName:       pulumi.String("string"),
    				User:           pulumi.String("string"),
    			},
    		},
    		NumApprovalsRequired:      pulumi.Int(0),
    		RequireReapprovalOnChange: pulumi.Bool(false),
    	},
    	Enabled: pulumi.Bool(false),
    	EnvironmentIdentifier: &pulumiservice.EnvironmentIdentifierArgs{
    		Name:         pulumi.String("string"),
    		Organization: pulumi.String("string"),
    		Project:      pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    	TargetActionTypes: pulumiservice.TargetActionTypeArray{
    		pulumiservice.TargetActionTypeUpdate,
    	},
    })
    
    var approvalRuleResource = new ApprovalRule("approvalRuleResource", ApprovalRuleArgs.builder()
        .approvalRuleConfig(ApprovalRuleConfigArgs.builder()
            .allowSelfApproval(false)
            .eligibleApprovers(EligibleApproverArgs.builder()
                .rbacPermission("environment:read")
                .teamName("string")
                .user("string")
                .build())
            .numApprovalsRequired(0)
            .requireReapprovalOnChange(false)
            .build())
        .enabled(false)
        .environmentIdentifier(EnvironmentIdentifierArgs.builder()
            .name("string")
            .organization("string")
            .project("string")
            .build())
        .name("string")
        .targetActionTypes("update")
        .build());
    
    approval_rule_resource = pulumiservice.ApprovalRule("approvalRuleResource",
        approval_rule_config={
            "allow_self_approval": False,
            "eligible_approvers": [{
                "rbac_permission": pulumiservice.RbacPermission.READ,
                "team_name": "string",
                "user": "string",
            }],
            "num_approvals_required": 0,
            "require_reapproval_on_change": False,
        },
        enabled=False,
        environment_identifier={
            "name": "string",
            "organization": "string",
            "project": "string",
        },
        name="string",
        target_action_types=[pulumiservice.TargetActionType.UPDATE])
    
    const approvalRuleResource = new pulumiservice.ApprovalRule("approvalRuleResource", {
        approvalRuleConfig: {
            allowSelfApproval: false,
            eligibleApprovers: [{
                rbacPermission: pulumiservice.RbacPermission.Read,
                teamName: "string",
                user: "string",
            }],
            numApprovalsRequired: 0,
            requireReapprovalOnChange: false,
        },
        enabled: false,
        environmentIdentifier: {
            name: "string",
            organization: "string",
            project: "string",
        },
        name: "string",
        targetActionTypes: [pulumiservice.TargetActionType.Update],
    });
    
    type: pulumiservice:ApprovalRule
    properties:
        approvalRuleConfig:
            allowSelfApproval: false
            eligibleApprovers:
                - rbacPermission: environment:read
                  teamName: string
                  user: string
            numApprovalsRequired: 0
            requireReapprovalOnChange: false
        enabled: false
        environmentIdentifier:
            name: string
            organization: string
            project: string
        name: string
        targetActionTypes:
            - update
    

    ApprovalRule 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 ApprovalRule resource accepts the following input properties:

    ApprovalRuleConfig Pulumi.PulumiService.Inputs.ApprovalRuleConfig
    The approval rule configuration.
    Enabled bool
    Whether the approval rule is enabled.
    EnvironmentIdentifier Pulumi.PulumiService.Inputs.EnvironmentIdentifier
    The environment this rule applies to.
    Name string
    The name of the approval rule.
    TargetActionTypes List<Pulumi.PulumiService.TargetActionType>
    The type of action this rule applies to.
    ApprovalRuleConfig ApprovalRuleConfigArgs
    The approval rule configuration.
    Enabled bool
    Whether the approval rule is enabled.
    EnvironmentIdentifier EnvironmentIdentifierArgs
    The environment this rule applies to.
    Name string
    The name of the approval rule.
    TargetActionTypes []TargetActionType
    The type of action this rule applies to.
    approvalRuleConfig ApprovalRuleConfig
    The approval rule configuration.
    enabled Boolean
    Whether the approval rule is enabled.
    environmentIdentifier EnvironmentIdentifier
    The environment this rule applies to.
    name String
    The name of the approval rule.
    targetActionTypes List<TargetActionType>
    The type of action this rule applies to.
    approvalRuleConfig ApprovalRuleConfig
    The approval rule configuration.
    enabled boolean
    Whether the approval rule is enabled.
    environmentIdentifier EnvironmentIdentifier
    The environment this rule applies to.
    name string
    The name of the approval rule.
    targetActionTypes TargetActionType[]
    The type of action this rule applies to.
    approval_rule_config ApprovalRuleConfigArgs
    The approval rule configuration.
    enabled bool
    Whether the approval rule is enabled.
    environment_identifier EnvironmentIdentifierArgs
    The environment this rule applies to.
    name str
    The name of the approval rule.
    target_action_types Sequence[TargetActionType]
    The type of action this rule applies to.
    approvalRuleConfig Property Map
    The approval rule configuration.
    enabled Boolean
    Whether the approval rule is enabled.
    environmentIdentifier Property Map
    The environment this rule applies to.
    name String
    The name of the approval rule.
    targetActionTypes List<"update">
    The type of action this rule applies to.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ApprovalRule 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 str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Supporting Types

    ApprovalRuleConfig, ApprovalRuleConfigArgs

    AllowSelfApproval bool
    Whether self-approval is allowed.
    EligibleApprovers List<Pulumi.PulumiService.Inputs.EligibleApprover>
    List of eligible approvers.
    NumApprovalsRequired int
    Number of approvals required.
    RequireReapprovalOnChange bool
    Whether reapproval is required on changes.
    AllowSelfApproval bool
    Whether self-approval is allowed.
    EligibleApprovers []EligibleApprover
    List of eligible approvers.
    NumApprovalsRequired int
    Number of approvals required.
    RequireReapprovalOnChange bool
    Whether reapproval is required on changes.
    allowSelfApproval Boolean
    Whether self-approval is allowed.
    eligibleApprovers List<EligibleApprover>
    List of eligible approvers.
    numApprovalsRequired Integer
    Number of approvals required.
    requireReapprovalOnChange Boolean
    Whether reapproval is required on changes.
    allowSelfApproval boolean
    Whether self-approval is allowed.
    eligibleApprovers EligibleApprover[]
    List of eligible approvers.
    numApprovalsRequired number
    Number of approvals required.
    requireReapprovalOnChange boolean
    Whether reapproval is required on changes.
    allow_self_approval bool
    Whether self-approval is allowed.
    eligible_approvers Sequence[EligibleApprover]
    List of eligible approvers.
    num_approvals_required int
    Number of approvals required.
    require_reapproval_on_change bool
    Whether reapproval is required on changes.
    allowSelfApproval Boolean
    Whether self-approval is allowed.
    eligibleApprovers List<Property Map>
    List of eligible approvers.
    numApprovalsRequired Number
    Number of approvals required.
    requireReapprovalOnChange Boolean
    Whether reapproval is required on changes.

    EligibleApprover, EligibleApproverArgs

    RbacPermission Pulumi.PulumiService.RbacPermission
    RBAC permission that gives right to approve.
    TeamName string
    Name of the team that can approve.
    User string
    Login of the user that can approve.
    RbacPermission RbacPermission
    RBAC permission that gives right to approve.
    TeamName string
    Name of the team that can approve.
    User string
    Login of the user that can approve.
    rbacPermission RbacPermission
    RBAC permission that gives right to approve.
    teamName String
    Name of the team that can approve.
    user String
    Login of the user that can approve.
    rbacPermission RbacPermission
    RBAC permission that gives right to approve.
    teamName string
    Name of the team that can approve.
    user string
    Login of the user that can approve.
    rbac_permission RbacPermission
    RBAC permission that gives right to approve.
    team_name str
    Name of the team that can approve.
    user str
    Login of the user that can approve.
    rbacPermission "environment:read" | "environment:read_decrypt" | "environment:open" | "environment:write" | "environment:delete" | "environment:clone" | "environment:rotate"
    RBAC permission that gives right to approve.
    teamName String
    Name of the team that can approve.
    user String
    Login of the user that can approve.

    EnvironmentIdentifier, EnvironmentIdentifierArgs

    Name string
    The environment name.
    Organization string
    The organization name.
    Project string
    The project name.
    Name string
    The environment name.
    Organization string
    The organization name.
    Project string
    The project name.
    name String
    The environment name.
    organization String
    The organization name.
    project String
    The project name.
    name string
    The environment name.
    organization string
    The organization name.
    project string
    The project name.
    name str
    The environment name.
    organization str
    The organization name.
    project str
    The project name.
    name String
    The environment name.
    organization String
    The organization name.
    project String
    The project name.

    RbacPermission, RbacPermissionArgs

    Read
    environment:readRead permission.
    ReadDecrypt
    environment:read_decryptRead and decrypt permission.
    Open
    environment:openOpen permission.
    Write
    environment:writeWrite permission.
    Delete
    environment:deleteDelete permission.
    Clone
    environment:cloneClone permission.
    Rotate
    environment:rotateRotate permission.
    RbacPermissionRead
    environment:readRead permission.
    RbacPermissionReadDecrypt
    environment:read_decryptRead and decrypt permission.
    RbacPermissionOpen
    environment:openOpen permission.
    RbacPermissionWrite
    environment:writeWrite permission.
    RbacPermissionDelete
    environment:deleteDelete permission.
    RbacPermissionClone
    environment:cloneClone permission.
    RbacPermissionRotate
    environment:rotateRotate permission.
    Read
    environment:readRead permission.
    ReadDecrypt
    environment:read_decryptRead and decrypt permission.
    Open
    environment:openOpen permission.
    Write
    environment:writeWrite permission.
    Delete
    environment:deleteDelete permission.
    Clone
    environment:cloneClone permission.
    Rotate
    environment:rotateRotate permission.
    Read
    environment:readRead permission.
    ReadDecrypt
    environment:read_decryptRead and decrypt permission.
    Open
    environment:openOpen permission.
    Write
    environment:writeWrite permission.
    Delete
    environment:deleteDelete permission.
    Clone
    environment:cloneClone permission.
    Rotate
    environment:rotateRotate permission.
    READ
    environment:readRead permission.
    READ_DECRYPT
    environment:read_decryptRead and decrypt permission.
    OPEN
    environment:openOpen permission.
    WRITE
    environment:writeWrite permission.
    DELETE
    environment:deleteDelete permission.
    CLONE
    environment:cloneClone permission.
    ROTATE
    environment:rotateRotate permission.
    "environment:read"
    environment:readRead permission.
    "environment:read_decrypt"
    environment:read_decryptRead and decrypt permission.
    "environment:open"
    environment:openOpen permission.
    "environment:write"
    environment:writeWrite permission.
    "environment:delete"
    environment:deleteDelete permission.
    "environment:clone"
    environment:cloneClone permission.
    "environment:rotate"
    environment:rotateRotate permission.

    TargetActionType, TargetActionTypeArgs

    Update
    updateUpdate action type for approval rules.
    TargetActionTypeUpdate
    updateUpdate action type for approval rules.
    Update
    updateUpdate action type for approval rules.
    Update
    updateUpdate action type for approval rules.
    UPDATE
    updateUpdate action type for approval rules.
    "update"
    updateUpdate action type for approval rules.

    Package Details

    Repository
    pulumiservice pulumi/pulumi-pulumiservice
    License
    Apache-2.0
    pulumiservice logo

    This provider is currently in preview.

    Pulumi Cloud v0.31.0 published on Friday, Aug 1, 2025 by Pulumi