1. Packages
  2. Packages
  3. Juju Provider
  4. API Docs
  5. Action
Viewing docs for juju 2.2.1
published on Monday, Jul 27, 2026 by juju
Viewing docs for juju 2.2.1
published on Monday, Jul 27, 2026 by juju

    A resource that represents a Juju action. The action is run and its result awaited during the resource’s creation. The action’s output is set as a computed field that can be used by other resources after the resource has been created.

    Create Action Resource

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

    Constructor syntax

    new Action(name: string, args: ActionArgs, opts?: CustomResourceOptions);
    @overload
    def Action(resource_name: str,
               args: ActionArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Action(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               action_name: Optional[str] = None,
               application_name: Optional[str] = None,
               model_uuid: Optional[str] = None,
               unit: Optional[str] = None,
               args: Optional[Mapping[str, str]] = None)
    func NewAction(ctx *Context, name string, args ActionArgs, opts ...ResourceOption) (*Action, error)
    public Action(string name, ActionArgs args, CustomResourceOptions? opts = null)
    public Action(String name, ActionArgs args)
    public Action(String name, ActionArgs args, CustomResourceOptions options)
    
    type: juju:Action
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "juju_action" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ActionArgs
    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 ActionArgs
    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 ActionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ActionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ActionArgs
    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 actionResource = new Juju.Action("actionResource", new()
    {
        ActionName = "string",
        ApplicationName = "string",
        ModelUuid = "string",
        Unit = "string",
        Args = 
        {
            { "string", "string" },
        },
    });
    
    example, err := juju.NewAction(ctx, "actionResource", &juju.ActionArgs{
    	ActionName:      pulumi.String("string"),
    	ApplicationName: pulumi.String("string"),
    	ModelUuid:       pulumi.String("string"),
    	Unit:            pulumi.String("string"),
    	Args: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    resource "juju_action" "actionResource" {
      lifecycle {
        create_before_destroy = true
      }
      action_name      = "string"
      application_name = "string"
      model_uuid       = "string"
      unit             = "string"
      args = {
        "string" = "string"
      }
    }
    
    var actionResource = new Action("actionResource", ActionArgs.builder()
        .actionName("string")
        .applicationName("string")
        .modelUuid("string")
        .unit("string")
        .args(Map.of("string", "string"))
        .build());
    
    action_resource = juju.Action("actionResource",
        action_name="string",
        application_name="string",
        model_uuid="string",
        unit="string",
        args={
            "string": "string",
        })
    
    const actionResource = new juju.Action("actionResource", {
        actionName: "string",
        applicationName: "string",
        modelUuid: "string",
        unit: "string",
        args: {
            string: "string",
        },
    });
    
    type: juju:Action
    properties:
        actionName: string
        applicationName: string
        args:
            string: string
        modelUuid: string
        unit: string
    

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

    ActionName string
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    ApplicationName string
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    ModelUuid string
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    Unit string
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    Args Dictionary<string, string>
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    ActionName string
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    ApplicationName string
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    ModelUuid string
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    Unit string
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    Args map[string]string
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    action_name string
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    application_name string
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    model_uuid string
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    unit string
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    args map(string)
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    actionName String
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    applicationName String
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    modelUuid String
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    unit String
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    args Map<String,String>
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    actionName string
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    applicationName string
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    modelUuid string
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    unit string
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    args {[key: string]: string}
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    action_name str
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    application_name str
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    model_uuid str
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    unit str
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    args Mapping[str, str]
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    actionName String
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    applicationName String
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    modelUuid String
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    unit String
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    args Map<String>
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Action resource produces the following output properties:

    ActionId string
    The ID of the enqueued action.
    Id string
    The provider-assigned unique ID for this managed resource.
    Output string
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    ActionId string
    The ID of the enqueued action.
    Id string
    The provider-assigned unique ID for this managed resource.
    Output string
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    action_id string
    The ID of the enqueued action.
    id string
    The provider-assigned unique ID for this managed resource.
    output string
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    actionId String
    The ID of the enqueued action.
    id String
    The provider-assigned unique ID for this managed resource.
    output String
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    actionId string
    The ID of the enqueued action.
    id string
    The provider-assigned unique ID for this managed resource.
    output string
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    action_id str
    The ID of the enqueued action.
    id str
    The provider-assigned unique ID for this managed resource.
    output str
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    actionId String
    The ID of the enqueued action.
    id String
    The provider-assigned unique ID for this managed resource.
    output String
    The output of the action as a JSON string. Use jsondecode() to extract values from it.

    Look up Existing Action Resource

    Get an existing Action 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?: ActionState, opts?: CustomResourceOptions): Action
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            action_id: Optional[str] = None,
            action_name: Optional[str] = None,
            application_name: Optional[str] = None,
            args: Optional[Mapping[str, str]] = None,
            model_uuid: Optional[str] = None,
            output: Optional[str] = None,
            unit: Optional[str] = None) -> Action
    func GetAction(ctx *Context, name string, id IDInput, state *ActionState, opts ...ResourceOption) (*Action, error)
    public static Action Get(string name, Input<string> id, ActionState? state, CustomResourceOptions? opts = null)
    public static Action get(String name, Output<String> id, ActionState state, CustomResourceOptions options)
    resources:  _:    type: juju:Action    get:      id: ${id}
    import {
      to = juju_action.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.
    The following state arguments are supported:
    ActionId string
    The ID of the enqueued action.
    ActionName string
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    ApplicationName string
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    Args Dictionary<string, string>
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    ModelUuid string
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    Output string
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    Unit string
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    ActionId string
    The ID of the enqueued action.
    ActionName string
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    ApplicationName string
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    Args map[string]string
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    ModelUuid string
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    Output string
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    Unit string
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    action_id string
    The ID of the enqueued action.
    action_name string
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    application_name string
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    args map(string)
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    model_uuid string
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    output string
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    unit string
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    actionId String
    The ID of the enqueued action.
    actionName String
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    applicationName String
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    args Map<String,String>
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    modelUuid String
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    output String
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    unit String
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    actionId string
    The ID of the enqueued action.
    actionName string
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    applicationName string
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    args {[key: string]: string}
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    modelUuid string
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    output string
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    unit string
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    action_id str
    The ID of the enqueued action.
    action_name str
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    application_name str
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    args Mapping[str, str]
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    model_uuid str
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    output str
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    unit str
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    actionId String
    The ID of the enqueued action.
    actionName String
    The name of the action to run. Changing this value will cause the resource to be destroyed and recreated.
    applicationName String
    The name of the application to run the action on. Changing this value will cause the resource to be destroyed and recreated.
    args Map<String>
    The arguments to pass to the action. Changing this value will cause the resource to be destroyed and recreated.
    modelUuid String
    The UUID of the model where the action will be run. Changing this value will cause the resource to be destroyed and recreated.
    output String
    The output of the action as a JSON string. Use jsondecode() to extract values from it.
    unit String
    The unit name (e.g. "ubuntu/0" or "ubuntu/leader") to run the action on. Changing this value will cause the resource to be destroyed and recreated.

    Package Details

    Repository
    juju juju/terraform-provider-juju
    License
    Notes
    This Pulumi package is based on the juju Terraform Provider.
    Viewing docs for juju 2.2.1
    published on Monday, Jul 27, 2026 by juju

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial