1. Packages
  2. Googleworkspace Provider
  3. API Docs
  4. ChromePolicy
googleworkspace 0.7.0 published on Wednesday, Jan 15, 2025 by hashicorp

googleworkspace.ChromePolicy

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as googleworkspace from "@pulumi/googleworkspace";

const exampleOrgUnit = new googleworkspace.OrgUnit("exampleOrgUnit", {parentOrgUnitPath: "/"});
const exampleChromePolicy = new googleworkspace.ChromePolicy("exampleChromePolicy", {
    orgUnitId: googleworkspace_org_unit.test.id,
    policies: [{
        schemaName: "chrome.users.MaxConnectionsPerProxy",
        schemaValues: {
            maxConnectionsPerProxy: JSON.stringify(34),
        },
    }],
});
Copy
import pulumi
import json
import pulumi_googleworkspace as googleworkspace

example_org_unit = googleworkspace.OrgUnit("exampleOrgUnit", parent_org_unit_path="/")
example_chrome_policy = googleworkspace.ChromePolicy("exampleChromePolicy",
    org_unit_id=googleworkspace_org_unit["test"]["id"],
    policies=[{
        "schema_name": "chrome.users.MaxConnectionsPerProxy",
        "schema_values": {
            "maxConnectionsPerProxy": json.dumps(34),
        },
    }])
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-terraform-provider/sdks/go/googleworkspace/googleworkspace"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := googleworkspace.NewOrgUnit(ctx, "exampleOrgUnit", &googleworkspace.OrgUnitArgs{
			ParentOrgUnitPath: pulumi.String("/"),
		})
		if err != nil {
			return err
		}
		tmpJSON0, err := json.Marshal(34)
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = googleworkspace.NewChromePolicy(ctx, "exampleChromePolicy", &googleworkspace.ChromePolicyArgs{
			OrgUnitId: pulumi.Any(googleworkspace_org_unit.Test.Id),
			Policies: googleworkspace.ChromePolicyPolicyArray{
				&googleworkspace.ChromePolicyPolicyArgs{
					SchemaName: pulumi.String("chrome.users.MaxConnectionsPerProxy"),
					SchemaValues: pulumi.StringMap{
						"maxConnectionsPerProxy": pulumi.String(json0),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Googleworkspace = Pulumi.Googleworkspace;

return await Deployment.RunAsync(() => 
{
    var exampleOrgUnit = new Googleworkspace.OrgUnit("exampleOrgUnit", new()
    {
        ParentOrgUnitPath = "/",
    });

    var exampleChromePolicy = new Googleworkspace.ChromePolicy("exampleChromePolicy", new()
    {
        OrgUnitId = googleworkspace_org_unit.Test.Id,
        Policies = new[]
        {
            new Googleworkspace.Inputs.ChromePolicyPolicyArgs
            {
                SchemaName = "chrome.users.MaxConnectionsPerProxy",
                SchemaValues = 
                {
                    { "maxConnectionsPerProxy", JsonSerializer.Serialize(34) },
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.googleworkspace.OrgUnit;
import com.pulumi.googleworkspace.OrgUnitArgs;
import com.pulumi.googleworkspace.ChromePolicy;
import com.pulumi.googleworkspace.ChromePolicyArgs;
import com.pulumi.googleworkspace.inputs.ChromePolicyPolicyArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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) {
        var exampleOrgUnit = new OrgUnit("exampleOrgUnit", OrgUnitArgs.builder()
            .parentOrgUnitPath("/")
            .build());

        var exampleChromePolicy = new ChromePolicy("exampleChromePolicy", ChromePolicyArgs.builder()
            .orgUnitId(googleworkspace_org_unit.test().id())
            .policies(ChromePolicyPolicyArgs.builder()
                .schemaName("chrome.users.MaxConnectionsPerProxy")
                .schemaValues(Map.of("maxConnectionsPerProxy", serializeJson(
                    34)))
                .build())
            .build());

    }
}
Copy
resources:
  exampleOrgUnit:
    type: googleworkspace:OrgUnit
    properties:
      parentOrgUnitPath: /
  exampleChromePolicy:
    type: googleworkspace:ChromePolicy
    properties:
      orgUnitId: ${googleworkspace_org_unit.test.id}
      policies:
        - schemaName: chrome.users.MaxConnectionsPerProxy
          schemaValues:
            maxConnectionsPerProxy:
              fn::toJSON: 34
Copy

Create ChromePolicy Resource

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

Constructor syntax

new ChromePolicy(name: string, args: ChromePolicyArgs, opts?: CustomResourceOptions);
@overload
def ChromePolicy(resource_name: str,
                 args: ChromePolicyArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def ChromePolicy(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 org_unit_id: Optional[str] = None,
                 policies: Optional[Sequence[ChromePolicyPolicyArgs]] = None,
                 chrome_policy_id: Optional[str] = None)
func NewChromePolicy(ctx *Context, name string, args ChromePolicyArgs, opts ...ResourceOption) (*ChromePolicy, error)
public ChromePolicy(string name, ChromePolicyArgs args, CustomResourceOptions? opts = null)
public ChromePolicy(String name, ChromePolicyArgs args)
public ChromePolicy(String name, ChromePolicyArgs args, CustomResourceOptions options)
type: googleworkspace:ChromePolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ChromePolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ChromePolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ChromePolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ChromePolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ChromePolicyArgs
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 chromePolicyResource = new Googleworkspace.ChromePolicy("chromePolicyResource", new()
{
    OrgUnitId = "string",
    Policies = new[]
    {
        new Googleworkspace.Inputs.ChromePolicyPolicyArgs
        {
            SchemaName = "string",
            SchemaValues = 
            {
                { "string", "string" },
            },
        },
    },
    ChromePolicyId = "string",
});
Copy
example, err := googleworkspace.NewChromePolicy(ctx, "chromePolicyResource", &googleworkspace.ChromePolicyArgs{
OrgUnitId: pulumi.String("string"),
Policies: .ChromePolicyPolicyArray{
&.ChromePolicyPolicyArgs{
SchemaName: pulumi.String("string"),
SchemaValues: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
},
ChromePolicyId: pulumi.String("string"),
})
Copy
var chromePolicyResource = new ChromePolicy("chromePolicyResource", ChromePolicyArgs.builder()
    .orgUnitId("string")
    .policies(ChromePolicyPolicyArgs.builder()
        .schemaName("string")
        .schemaValues(Map.of("string", "string"))
        .build())
    .chromePolicyId("string")
    .build());
Copy
chrome_policy_resource = googleworkspace.ChromePolicy("chromePolicyResource",
    org_unit_id="string",
    policies=[{
        "schema_name": "string",
        "schema_values": {
            "string": "string",
        },
    }],
    chrome_policy_id="string")
Copy
const chromePolicyResource = new googleworkspace.ChromePolicy("chromePolicyResource", {
    orgUnitId: "string",
    policies: [{
        schemaName: "string",
        schemaValues: {
            string: "string",
        },
    }],
    chromePolicyId: "string",
});
Copy
type: googleworkspace:ChromePolicy
properties:
    chromePolicyId: string
    orgUnitId: string
    policies:
        - schemaName: string
          schemaValues:
            string: string
Copy

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

OrgUnitId This property is required. string
The target org unit on which this policy is applied.
Policies This property is required. List<ChromePolicyPolicy>
Policies to set for the org unit
ChromePolicyId string
The ID of this resource.
OrgUnitId This property is required. string
The target org unit on which this policy is applied.
Policies This property is required. []ChromePolicyPolicyArgs
Policies to set for the org unit
ChromePolicyId string
The ID of this resource.
orgUnitId This property is required. String
The target org unit on which this policy is applied.
policies This property is required. List<ChromePolicyPolicy>
Policies to set for the org unit
chromePolicyId String
The ID of this resource.
orgUnitId This property is required. string
The target org unit on which this policy is applied.
policies This property is required. ChromePolicyPolicy[]
Policies to set for the org unit
chromePolicyId string
The ID of this resource.
org_unit_id This property is required. str
The target org unit on which this policy is applied.
policies This property is required. Sequence[ChromePolicyPolicyArgs]
Policies to set for the org unit
chrome_policy_id str
The ID of this resource.
orgUnitId This property is required. String
The target org unit on which this policy is applied.
policies This property is required. List<Property Map>
Policies to set for the org unit
chromePolicyId String
The ID of this resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the ChromePolicy 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.

Look up Existing ChromePolicy Resource

Get an existing ChromePolicy 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?: ChromePolicyState, opts?: CustomResourceOptions): ChromePolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        chrome_policy_id: Optional[str] = None,
        org_unit_id: Optional[str] = None,
        policies: Optional[Sequence[ChromePolicyPolicyArgs]] = None) -> ChromePolicy
func GetChromePolicy(ctx *Context, name string, id IDInput, state *ChromePolicyState, opts ...ResourceOption) (*ChromePolicy, error)
public static ChromePolicy Get(string name, Input<string> id, ChromePolicyState? state, CustomResourceOptions? opts = null)
public static ChromePolicy get(String name, Output<String> id, ChromePolicyState state, CustomResourceOptions options)
resources:  _:    type: googleworkspace:ChromePolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ChromePolicyId string
The ID of this resource.
OrgUnitId string
The target org unit on which this policy is applied.
Policies List<ChromePolicyPolicy>
Policies to set for the org unit
ChromePolicyId string
The ID of this resource.
OrgUnitId string
The target org unit on which this policy is applied.
Policies []ChromePolicyPolicyArgs
Policies to set for the org unit
chromePolicyId String
The ID of this resource.
orgUnitId String
The target org unit on which this policy is applied.
policies List<ChromePolicyPolicy>
Policies to set for the org unit
chromePolicyId string
The ID of this resource.
orgUnitId string
The target org unit on which this policy is applied.
policies ChromePolicyPolicy[]
Policies to set for the org unit
chrome_policy_id str
The ID of this resource.
org_unit_id str
The target org unit on which this policy is applied.
policies Sequence[ChromePolicyPolicyArgs]
Policies to set for the org unit
chromePolicyId String
The ID of this resource.
orgUnitId String
The target org unit on which this policy is applied.
policies List<Property Map>
Policies to set for the org unit

Supporting Types

ChromePolicyPolicy
, ChromePolicyPolicyArgs

SchemaName This property is required. string
The full qualified name of the policy schema.
SchemaValues This property is required. Dictionary<string, string>
JSON encoded map that represents key/value pairs that correspond to the given schema.
SchemaName This property is required. string
The full qualified name of the policy schema.
SchemaValues This property is required. map[string]string
JSON encoded map that represents key/value pairs that correspond to the given schema.
schemaName This property is required. String
The full qualified name of the policy schema.
schemaValues This property is required. Map<String,String>
JSON encoded map that represents key/value pairs that correspond to the given schema.
schemaName This property is required. string
The full qualified name of the policy schema.
schemaValues This property is required. {[key: string]: string}
JSON encoded map that represents key/value pairs that correspond to the given schema.
schema_name This property is required. str
The full qualified name of the policy schema.
schema_values This property is required. Mapping[str, str]
JSON encoded map that represents key/value pairs that correspond to the given schema.
schemaName This property is required. String
The full qualified name of the policy schema.
schemaValues This property is required. Map<String>
JSON encoded map that represents key/value pairs that correspond to the given schema.

Package Details

Repository
googleworkspace hashicorp/terraform-provider-googleworkspace
License
Notes
This Pulumi package is based on the googleworkspace Terraform Provider.