Use the zia_workload_groups resource allows the creation and management of Workload Group objects in the Zscaler Internet Access. This resource can then be used as a criterion in ZIA policies such as, Firewall Filtering, URL Filtering, and Data Loss Prevention (DLP) to apply security policies to the workload traffic.
Example Usage
resource "zia_workload_groups" "example" {
name = "Test Group"
description = "Test Group"
expression_json {
expression_containers {
tag_type = "ATTR"
operator = "AND"
tag_container {
operator = "AND"
tags {
key = "GroupName"
value = "example"
}
}
}
expression_containers {
tag_type = "ENI"
operator = "AND"
tag_container {
operator = "AND"
tags {
key = "GroupId"
value = "123456789"
}
}
}
expression_containers {
tag_type = "VPC"
operator = "AND"
tag_container {
operator = "AND"
tags {
key = "Vpc-id"
value = "vpcid12344"
}
}
}
expression_containers {
tag_type = "VM"
operator = "AND"
tag_container {
operator = "AND"
tags {
key = "IamInstanceProfile-Arn"
value = "test01"
}
}
}
}
}
Create WorkloadGroups Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new WorkloadGroups(name: string, args?: WorkloadGroupsArgs, opts?: CustomResourceOptions);@overload
def WorkloadGroups(resource_name: str,
args: Optional[WorkloadGroupsArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def WorkloadGroups(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
expression_jsons: Optional[Sequence[WorkloadGroupsExpressionJsonArgs]] = None,
name: Optional[str] = None)func NewWorkloadGroups(ctx *Context, name string, args *WorkloadGroupsArgs, opts ...ResourceOption) (*WorkloadGroups, error)public WorkloadGroups(string name, WorkloadGroupsArgs? args = null, CustomResourceOptions? opts = null)
public WorkloadGroups(String name, WorkloadGroupsArgs args)
public WorkloadGroups(String name, WorkloadGroupsArgs args, CustomResourceOptions options)
type: zia:WorkloadGroups
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 WorkloadGroupsArgs
- 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 WorkloadGroupsArgs
- 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 WorkloadGroupsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkloadGroupsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkloadGroupsArgs
- 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 workloadGroupsResource = new Zia.WorkloadGroups("workloadGroupsResource", new()
{
Description = "string",
ExpressionJsons = new[]
{
new Zia.Inputs.WorkloadGroupsExpressionJsonArgs
{
ExpressionContainers = new[]
{
new Zia.Inputs.WorkloadGroupsExpressionJsonExpressionContainerArgs
{
Operator = "string",
TagContainers = new[]
{
new Zia.Inputs.WorkloadGroupsExpressionJsonExpressionContainerTagContainerArgs
{
Operator = "string",
Tags = new[]
{
new Zia.Inputs.WorkloadGroupsExpressionJsonExpressionContainerTagContainerTagArgs
{
Key = "string",
Value = "string",
},
},
},
},
TagType = "string",
},
},
},
},
Name = "string",
});
example, err := zia.NewWorkloadGroups(ctx, "workloadGroupsResource", &zia.WorkloadGroupsArgs{
Description: pulumi.String("string"),
ExpressionJsons: zia.WorkloadGroupsExpressionJsonArray{
&zia.WorkloadGroupsExpressionJsonArgs{
ExpressionContainers: zia.WorkloadGroupsExpressionJsonExpressionContainerArray{
&zia.WorkloadGroupsExpressionJsonExpressionContainerArgs{
Operator: pulumi.String("string"),
TagContainers: zia.WorkloadGroupsExpressionJsonExpressionContainerTagContainerArray{
&zia.WorkloadGroupsExpressionJsonExpressionContainerTagContainerArgs{
Operator: pulumi.String("string"),
Tags: zia.WorkloadGroupsExpressionJsonExpressionContainerTagContainerTagArray{
&zia.WorkloadGroupsExpressionJsonExpressionContainerTagContainerTagArgs{
Key: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
},
},
TagType: pulumi.String("string"),
},
},
},
},
Name: pulumi.String("string"),
})
var workloadGroupsResource = new WorkloadGroups("workloadGroupsResource", WorkloadGroupsArgs.builder()
.description("string")
.expressionJsons(WorkloadGroupsExpressionJsonArgs.builder()
.expressionContainers(WorkloadGroupsExpressionJsonExpressionContainerArgs.builder()
.operator("string")
.tagContainers(WorkloadGroupsExpressionJsonExpressionContainerTagContainerArgs.builder()
.operator("string")
.tags(WorkloadGroupsExpressionJsonExpressionContainerTagContainerTagArgs.builder()
.key("string")
.value("string")
.build())
.build())
.tagType("string")
.build())
.build())
.name("string")
.build());
workload_groups_resource = zia.WorkloadGroups("workloadGroupsResource",
description="string",
expression_jsons=[{
"expression_containers": [{
"operator": "string",
"tag_containers": [{
"operator": "string",
"tags": [{
"key": "string",
"value": "string",
}],
}],
"tag_type": "string",
}],
}],
name="string")
const workloadGroupsResource = new zia.WorkloadGroups("workloadGroupsResource", {
description: "string",
expressionJsons: [{
expressionContainers: [{
operator: "string",
tagContainers: [{
operator: "string",
tags: [{
key: "string",
value: "string",
}],
}],
tagType: "string",
}],
}],
name: "string",
});
type: zia:WorkloadGroups
properties:
description: string
expressionJsons:
- expressionContainers:
- operator: string
tagContainers:
- operator: string
tags:
- key: string
value: string
tagType: string
name: string
WorkloadGroups 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 WorkloadGroups resource accepts the following input properties:
- Description string
- (String) The description of the workload group.
- Expression
Jsons List<zscaler.Pulumi Package. Zia. Inputs. Workload Groups Expression Json> - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- Name string
- (String) The name of the workload group.
- Description string
- (String) The description of the workload group.
- Expression
Jsons []WorkloadGroups Expression Json Args - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- Name string
- (String) The name of the workload group.
- description String
- (String) The description of the workload group.
- expression
Jsons List<WorkloadGroups Expression Json> - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- name String
- (String) The name of the workload group.
- description string
- (String) The description of the workload group.
- expression
Jsons WorkloadGroups Expression Json[] - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- name string
- (String) The name of the workload group.
- description str
- (String) The description of the workload group.
- expression_
jsons Sequence[WorkloadGroups Expression Json Args] - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- name str
- (String) The name of the workload group.
- description String
- (String) The description of the workload group.
- expression
Jsons List<Property Map> - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- name String
- (String) The name of the workload group.
Outputs
All input properties are implicitly available as output properties. Additionally, the WorkloadGroups resource produces the following output properties:
Look up Existing WorkloadGroups Resource
Get an existing WorkloadGroups 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?: WorkloadGroupsState, opts?: CustomResourceOptions): WorkloadGroups@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
expression_jsons: Optional[Sequence[WorkloadGroupsExpressionJsonArgs]] = None,
group_id: Optional[int] = None,
name: Optional[str] = None) -> WorkloadGroupsfunc GetWorkloadGroups(ctx *Context, name string, id IDInput, state *WorkloadGroupsState, opts ...ResourceOption) (*WorkloadGroups, error)public static WorkloadGroups Get(string name, Input<string> id, WorkloadGroupsState? state, CustomResourceOptions? opts = null)public static WorkloadGroups get(String name, Output<String> id, WorkloadGroupsState state, CustomResourceOptions options)resources: _: type: zia:WorkloadGroups get: 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.
- Description string
- (String) The description of the workload group.
- Expression
Jsons List<zscaler.Pulumi Package. Zia. Inputs. Workload Groups Expression Json> - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- Group
Id int - (Number) A unique identifier assigned to the workload group.
- Name string
- (String) The name of the workload group.
- Description string
- (String) The description of the workload group.
- Expression
Jsons []WorkloadGroups Expression Json Args - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- Group
Id int - (Number) A unique identifier assigned to the workload group.
- Name string
- (String) The name of the workload group.
- description String
- (String) The description of the workload group.
- expression
Jsons List<WorkloadGroups Expression Json> - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- group
Id Integer - (Number) A unique identifier assigned to the workload group.
- name String
- (String) The name of the workload group.
- description string
- (String) The description of the workload group.
- expression
Jsons WorkloadGroups Expression Json[] - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- group
Id number - (Number) A unique identifier assigned to the workload group.
- name string
- (String) The name of the workload group.
- description str
- (String) The description of the workload group.
- expression_
jsons Sequence[WorkloadGroups Expression Json Args] - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- group_
id int - (Number) A unique identifier assigned to the workload group.
- name str
- (String) The name of the workload group.
- description String
- (String) The description of the workload group.
- expression
Jsons List<Property Map> - (List) The workload group expression containing tag types, tags, and their relationships represented in a JSON format.
- group
Id Number - (Number) A unique identifier assigned to the workload group.
- name String
- (String) The name of the workload group.
Supporting Types
WorkloadGroupsExpressionJson, WorkloadGroupsExpressionJsonArgs
- Expression
Containers List<zscaler.Pulumi Package. Zia. Inputs. Workload Groups Expression Json Expression Container> - (List) Contains one or more tag types (and associated tags) combined using logical operators within a workload group.
- Expression
Containers []WorkloadGroups Expression Json Expression Container - (List) Contains one or more tag types (and associated tags) combined using logical operators within a workload group.
- expression
Containers List<WorkloadGroups Expression Json Expression Container> - (List) Contains one or more tag types (and associated tags) combined using logical operators within a workload group.
- expression
Containers WorkloadGroups Expression Json Expression Container[] - (List) Contains one or more tag types (and associated tags) combined using logical operators within a workload group.
- expression_
containers Sequence[WorkloadGroups Expression Json Expression Container] - (List) Contains one or more tag types (and associated tags) combined using logical operators within a workload group.
- expression
Containers List<Property Map> - (List) Contains one or more tag types (and associated tags) combined using logical operators within a workload group.
WorkloadGroupsExpressionJsonExpressionContainer, WorkloadGroupsExpressionJsonExpressionContainerArgs
- Operator string
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. - Tag
Containers List<zscaler.Pulumi Package. Zia. Inputs. Workload Groups Expression Json Expression Container Tag Container> - (List) Contains one or more tags and the logical operator used to combine the tags within a tag type.
- Tag
Type string - (String) The tag type selected from a predefined list. Returned values are:
ANY,VPC,SUBNET,VM,ENI,ATTR.
- Operator string
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. - Tag
Containers []WorkloadGroups Expression Json Expression Container Tag Container - (List) Contains one or more tags and the logical operator used to combine the tags within a tag type.
- Tag
Type string - (String) The tag type selected from a predefined list. Returned values are:
ANY,VPC,SUBNET,VM,ENI,ATTR.
- operator String
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. - tag
Containers List<WorkloadGroups Expression Json Expression Container Tag Container> - (List) Contains one or more tags and the logical operator used to combine the tags within a tag type.
- tag
Type String - (String) The tag type selected from a predefined list. Returned values are:
ANY,VPC,SUBNET,VM,ENI,ATTR.
- operator string
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. - tag
Containers WorkloadGroups Expression Json Expression Container Tag Container[] - (List) Contains one or more tags and the logical operator used to combine the tags within a tag type.
- tag
Type string - (String) The tag type selected from a predefined list. Returned values are:
ANY,VPC,SUBNET,VM,ENI,ATTR.
- operator str
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. - tag_
containers Sequence[WorkloadGroups Expression Json Expression Container Tag Container] - (List) Contains one or more tags and the logical operator used to combine the tags within a tag type.
- tag_
type str - (String) The tag type selected from a predefined list. Returned values are:
ANY,VPC,SUBNET,VM,ENI,ATTR.
- operator String
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. - tag
Containers List<Property Map> - (List) Contains one or more tags and the logical operator used to combine the tags within a tag type.
- tag
Type String - (String) The tag type selected from a predefined list. Returned values are:
ANY,VPC,SUBNET,VM,ENI,ATTR.
WorkloadGroupsExpressionJsonExpressionContainerTagContainer, WorkloadGroupsExpressionJsonExpressionContainerTagContainerArgs
- Operator string
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. -
List<zscaler.
Pulumi Package. Zia. Inputs. Workload Groups Expression Json Expression Container Tag Container Tag> - (List) One or more tags, each consisting of a key-value pair, selected within a tag type. If multiple tags are present within a tag type, they are combined using a logical operator. Note: A maximum of 8 tags can be added to a workload group, irrespective of the number of tag types present.
- Operator string
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. -
[]Workload
Groups Expression Json Expression Container Tag Container Tag - (List) One or more tags, each consisting of a key-value pair, selected within a tag type. If multiple tags are present within a tag type, they are combined using a logical operator. Note: A maximum of 8 tags can be added to a workload group, irrespective of the number of tag types present.
- operator String
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. -
List<Workload
Groups Expression Json Expression Container Tag Container Tag> - (List) One or more tags, each consisting of a key-value pair, selected within a tag type. If multiple tags are present within a tag type, they are combined using a logical operator. Note: A maximum of 8 tags can be added to a workload group, irrespective of the number of tag types present.
- operator string
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. -
Workload
Groups Expression Json Expression Container Tag Container Tag[] - (List) One or more tags, each consisting of a key-value pair, selected within a tag type. If multiple tags are present within a tag type, they are combined using a logical operator. Note: A maximum of 8 tags can be added to a workload group, irrespective of the number of tag types present.
- operator str
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. -
Sequence[Workload
Groups Expression Json Expression Container Tag Container Tag] - (List) One or more tags, each consisting of a key-value pair, selected within a tag type. If multiple tags are present within a tag type, they are combined using a logical operator. Note: A maximum of 8 tags can be added to a workload group, irrespective of the number of tag types present.
- operator String
- (String) The logical operator (either AND or OR) used to combine the tags within a tag type. Returned values are:
AND,OR. - List<Property Map>
- (List) One or more tags, each consisting of a key-value pair, selected within a tag type. If multiple tags are present within a tag type, they are combined using a logical operator. Note: A maximum of 8 tags can be added to a workload group, irrespective of the number of tag types present.
WorkloadGroupsExpressionJsonExpressionContainerTagContainerTag, WorkloadGroupsExpressionJsonExpressionContainerTagContainerTagArgs
Import
Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZIA configurations into Terraform-compliant HashiCorp Configuration Language. Visit
zia_workload_groups can be imported by using <GROUP_ID> or <GROUP_NAME> as the import ID.
For example:
$ pulumi import zia:index/workloadGroups:WorkloadGroups example <group_id>
or
$ pulumi import zia:index/workloadGroups:WorkloadGroups example <group_name>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- zia zscaler/pulumi-zia
- License
- MIT
- Notes
- This Pulumi package is based on the
ziaTerraform Provider.
