Policy

Allows management of Organization policies for a Google Organization. For more information see the official documentation and API.

Create a Policy Resource

new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);
def Policy(resource_name, opts=None, boolean_policy=None, constraint=None, list_policy=None, org_id=None, restore_policy=None, version=None, __props__=None);
func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)
public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Policy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Policy resource accepts the following input properties:

Constraint string

The name of the Constraint the Policy is configuring, for example, serviceuser.services. Check out the complete list of available constraints.

OrgId string

The numeric ID of the organization to set the policy for.

BooleanPolicy PolicyBooleanPolicyArgs

A boolean policy is a constraint that is either enforced or not. Structure is documented below.

ListPolicy PolicyListPolicyArgs

A policy that can define specific values that are allowed or denied for the given constraint. It can also be used to allow or deny all values. Structure is documented below.

RestorePolicy PolicyRestorePolicyArgs

A restore policy is a constraint to restore the default policy. Structure is documented below.

Version int

Version of the Policy. Default version is 0.

Constraint string

The name of the Constraint the Policy is configuring, for example, serviceuser.services. Check out the complete list of available constraints.

OrgId string

The numeric ID of the organization to set the policy for.

BooleanPolicy PolicyBooleanPolicy

A boolean policy is a constraint that is either enforced or not. Structure is documented below.

ListPolicy PolicyListPolicy

A policy that can define specific values that are allowed or denied for the given constraint. It can also be used to allow or deny all values. Structure is documented below.

RestorePolicy PolicyRestorePolicy

A restore policy is a constraint to restore the default policy. Structure is documented below.

Version int

Version of the Policy. Default version is 0.

constraint string

The name of the Constraint the Policy is configuring, for example, serviceuser.services. Check out the complete list of available constraints.

orgId string

The numeric ID of the organization to set the policy for.

booleanPolicy PolicyBooleanPolicy

A boolean policy is a constraint that is either enforced or not. Structure is documented below.

listPolicy PolicyListPolicy

A policy that can define specific values that are allowed or denied for the given constraint. It can also be used to allow or deny all values. Structure is documented below.

restorePolicy PolicyRestorePolicy

A restore policy is a constraint to restore the default policy. Structure is documented below.

version number

Version of the Policy. Default version is 0.

constraint str

The name of the Constraint the Policy is configuring, for example, serviceuser.services. Check out the complete list of available constraints.

org_id str

The numeric ID of the organization to set the policy for.

boolean_policy Dict[PolicyBooleanPolicy]

A boolean policy is a constraint that is either enforced or not. Structure is documented below.

list_policy Dict[PolicyListPolicy]

A policy that can define specific values that are allowed or denied for the given constraint. It can also be used to allow or deny all values. Structure is documented below.

restore_policy Dict[PolicyRestorePolicy]

A restore policy is a constraint to restore the default policy. Structure is documented below.

version float

Version of the Policy. Default version is 0.

Outputs

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

Etag string

(Computed) The etag of the organization policy. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.

Id string
The provider-assigned unique ID for this managed resource.
UpdateTime string

(Computed) The timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds, representing when the variable was last updated. Example: “2016-10-09T12:33:37.578138407Z”.

Etag string

(Computed) The etag of the organization policy. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.

Id string
The provider-assigned unique ID for this managed resource.
UpdateTime string

(Computed) The timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds, representing when the variable was last updated. Example: “2016-10-09T12:33:37.578138407Z”.

etag string

(Computed) The etag of the organization policy. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.

id string
The provider-assigned unique ID for this managed resource.
updateTime string

(Computed) The timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds, representing when the variable was last updated. Example: “2016-10-09T12:33:37.578138407Z”.

etag str

(Computed) The etag of the organization policy. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.

id str
The provider-assigned unique ID for this managed resource.
update_time str

(Computed) The timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds, representing when the variable was last updated. Example: “2016-10-09T12:33:37.578138407Z”.

Look up an Existing Policy Resource

Get an existing Policy 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?: PolicyState, opts?: CustomResourceOptions): Policy
static get(resource_name, id, opts=None, boolean_policy=None, constraint=None, etag=None, list_policy=None, org_id=None, restore_policy=None, update_time=None, version=None, __props__=None);
func GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)
public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

BooleanPolicy PolicyBooleanPolicyArgs

A boolean policy is a constraint that is either enforced or not. Structure is documented below.

Constraint string

The name of the Constraint the Policy is configuring, for example, serviceuser.services. Check out the complete list of available constraints.

Etag string

(Computed) The etag of the organization policy. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.

ListPolicy PolicyListPolicyArgs

A policy that can define specific values that are allowed or denied for the given constraint. It can also be used to allow or deny all values. Structure is documented below.

OrgId string

The numeric ID of the organization to set the policy for.

RestorePolicy PolicyRestorePolicyArgs

A restore policy is a constraint to restore the default policy. Structure is documented below.

UpdateTime string

(Computed) The timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds, representing when the variable was last updated. Example: “2016-10-09T12:33:37.578138407Z”.

Version int

Version of the Policy. Default version is 0.

BooleanPolicy PolicyBooleanPolicy

A boolean policy is a constraint that is either enforced or not. Structure is documented below.

Constraint string

The name of the Constraint the Policy is configuring, for example, serviceuser.services. Check out the complete list of available constraints.

Etag string

(Computed) The etag of the organization policy. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.

ListPolicy PolicyListPolicy

A policy that can define specific values that are allowed or denied for the given constraint. It can also be used to allow or deny all values. Structure is documented below.

OrgId string

The numeric ID of the organization to set the policy for.

RestorePolicy PolicyRestorePolicy

A restore policy is a constraint to restore the default policy. Structure is documented below.

UpdateTime string

(Computed) The timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds, representing when the variable was last updated. Example: “2016-10-09T12:33:37.578138407Z”.

Version int

Version of the Policy. Default version is 0.

booleanPolicy PolicyBooleanPolicy

A boolean policy is a constraint that is either enforced or not. Structure is documented below.

constraint string

The name of the Constraint the Policy is configuring, for example, serviceuser.services. Check out the complete list of available constraints.

etag string

(Computed) The etag of the organization policy. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.

listPolicy PolicyListPolicy

A policy that can define specific values that are allowed or denied for the given constraint. It can also be used to allow or deny all values. Structure is documented below.

orgId string

The numeric ID of the organization to set the policy for.

restorePolicy PolicyRestorePolicy

A restore policy is a constraint to restore the default policy. Structure is documented below.

updateTime string

(Computed) The timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds, representing when the variable was last updated. Example: “2016-10-09T12:33:37.578138407Z”.

version number

Version of the Policy. Default version is 0.

boolean_policy Dict[PolicyBooleanPolicy]

A boolean policy is a constraint that is either enforced or not. Structure is documented below.

constraint str

The name of the Constraint the Policy is configuring, for example, serviceuser.services. Check out the complete list of available constraints.

etag str

(Computed) The etag of the organization policy. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.

list_policy Dict[PolicyListPolicy]

A policy that can define specific values that are allowed or denied for the given constraint. It can also be used to allow or deny all values. Structure is documented below.

org_id str

The numeric ID of the organization to set the policy for.

restore_policy Dict[PolicyRestorePolicy]

A restore policy is a constraint to restore the default policy. Structure is documented below.

update_time str

(Computed) The timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds, representing when the variable was last updated. Example: “2016-10-09T12:33:37.578138407Z”.

version float

Version of the Policy. Default version is 0.

Supporting Types

PolicyBooleanPolicy

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Enforced bool

If true, then the Policy is enforced. If false, then any configuration is acceptable.

Enforced bool

If true, then the Policy is enforced. If false, then any configuration is acceptable.

enforced boolean

If true, then the Policy is enforced. If false, then any configuration is acceptable.

enforced bool

If true, then the Policy is enforced. If false, then any configuration is acceptable.

PolicyListPolicy

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Allow PolicyListPolicyAllowArgs

or deny - (Optional) One or the other must be set.

Deny PolicyListPolicyDenyArgs
InheritFromParent bool

If set to true, the values from the effective Policy of the parent resource are inherited, meaning the values set in this Policy are added to the values inherited up the hierarchy.

SuggestedValue string

The Google Cloud Console will try to default to a configuration that matches the value specified in this field.

Allow PolicyListPolicyAllow

or deny - (Optional) One or the other must be set.

Deny PolicyListPolicyDeny
InheritFromParent bool

If set to true, the values from the effective Policy of the parent resource are inherited, meaning the values set in this Policy are added to the values inherited up the hierarchy.

SuggestedValue string

The Google Cloud Console will try to default to a configuration that matches the value specified in this field.

allow PolicyListPolicyAllow

or deny - (Optional) One or the other must be set.

deny PolicyListPolicyDeny
inheritFromParent boolean

If set to true, the values from the effective Policy of the parent resource are inherited, meaning the values set in this Policy are added to the values inherited up the hierarchy.

suggestedValue string

The Google Cloud Console will try to default to a configuration that matches the value specified in this field.

allow Dict[PolicyListPolicyAllow]

or deny - (Optional) One or the other must be set.

deny Dict[PolicyListPolicyDeny]
inheritFromParent bool

If set to true, the values from the effective Policy of the parent resource are inherited, meaning the values set in this Policy are added to the values inherited up the hierarchy.

suggestedValue str

The Google Cloud Console will try to default to a configuration that matches the value specified in this field.

PolicyListPolicyAllow

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

All bool

The policy allows or denies all values.

Values List<string>

The policy can define specific values that are allowed or denied.

All bool

The policy allows or denies all values.

Values []string

The policy can define specific values that are allowed or denied.

all boolean

The policy allows or denies all values.

values string[]

The policy can define specific values that are allowed or denied.

all bool

The policy allows or denies all values.

values List[str]

The policy can define specific values that are allowed or denied.

PolicyListPolicyDeny

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

All bool

The policy allows or denies all values.

Values List<string>

The policy can define specific values that are allowed or denied.

All bool

The policy allows or denies all values.

Values []string

The policy can define specific values that are allowed or denied.

all boolean

The policy allows or denies all values.

values string[]

The policy can define specific values that are allowed or denied.

all bool

The policy allows or denies all values.

values List[str]

The policy can define specific values that are allowed or denied.

PolicyRestorePolicy

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Default bool

May only be set to true. If set, then the default Policy is restored.

Default bool

May only be set to true. If set, then the default Policy is restored.

default boolean

May only be set to true. If set, then the default Policy is restored.

default bool

May only be set to true. If set, then the default Policy is restored.

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.