published on Monday, Jul 27, 2026 by juju
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:
- 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 Dictionary<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]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.
- 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,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 {[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.
- 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the Action resource produces the following output properties:
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) -> Actionfunc 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.
- 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 Dictionary<string, 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.
- 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]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.
- 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.
- 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,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.
- 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 {[key: string]: 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.
- 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.
- 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.
Package Details
- Repository
- juju juju/terraform-provider-juju
- License
- Notes
- This Pulumi package is based on the
jujuTerraform Provider.
published on Monday, Jul 27, 2026 by juju