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.- Org
Id string The numeric ID of the organization to set the policy for.
- Boolean
Policy PolicyBoolean Policy Args A boolean policy is a constraint that is either enforced or not. Structure is documented below.
- List
Policy PolicyList Policy Args 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 PolicyRestore Policy Args 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.- Org
Id string The numeric ID of the organization to set the policy for.
- Boolean
Policy PolicyBoolean Policy A boolean policy is a constraint that is either enforced or not. Structure is documented below.
- List
Policy PolicyList Policy 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 PolicyRestore Policy 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.- org
Id string The numeric ID of the organization to set the policy for.
- boolean
Policy PolicyBoolean Policy A boolean policy is a constraint that is either enforced or not. Structure is documented below.
- list
Policy PolicyList Policy 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 PolicyRestore Policy 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[PolicyBoolean Policy] A boolean policy is a constraint that is either enforced or not. Structure is documented below.
- list_
policy Dict[PolicyList Policy] 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[PolicyRestore Policy] 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.
etagis 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.
- Update
Time 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.
etagis 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.
- Update
Time 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.
etagis 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.
- update
Time 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.
etagis 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): Policystatic 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:
- Boolean
Policy PolicyBoolean Policy Args 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.
etagis used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.- List
Policy PolicyList Policy Args 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 string The numeric ID of the organization to set the policy for.
- Restore
Policy PolicyRestore Policy Args A restore policy is a constraint to restore the default policy. Structure is documented below.
- Update
Time 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.
- Boolean
Policy PolicyBoolean Policy 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.
etagis used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.- List
Policy PolicyList Policy 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 string The numeric ID of the organization to set the policy for.
- Restore
Policy PolicyRestore Policy A restore policy is a constraint to restore the default policy. Structure is documented below.
- Update
Time 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.
- boolean
Policy PolicyBoolean Policy 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.
etagis used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.- list
Policy PolicyList Policy 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 string The numeric ID of the organization to set the policy for.
- restore
Policy PolicyRestore Policy A restore policy is a constraint to restore the default policy. Structure is documented below.
- update
Time 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[PolicyBoolean Policy] 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.
etagis used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.- list_
policy Dict[PolicyList Policy] 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[PolicyRestore Policy] 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
PolicyListPolicy
- Allow
Policy
List Policy Allow Args or
deny- (Optional) One or the other must be set.- Deny
Policy
List Policy Deny Args - Inherit
From boolParent 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.
- Suggested
Value string The Google Cloud Console will try to default to a configuration that matches the value specified in this field.
- Allow
Policy
List Policy Allow or
deny- (Optional) One or the other must be set.- Deny
Policy
List Policy Deny - Inherit
From boolParent 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.
- Suggested
Value string The Google Cloud Console will try to default to a configuration that matches the value specified in this field.
- allow
Policy
List Policy Allow or
deny- (Optional) One or the other must be set.- deny
Policy
List Policy Deny - inherit
From booleanParent 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.
- suggested
Value string The Google Cloud Console will try to default to a configuration that matches the value specified in this field.
- allow
Dict[Policy
List Policy Allow] or
deny- (Optional) One or the other must be set.- deny
Dict[Policy
List Policy Deny] - inherit
From boolParent 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.
- suggested
Value str The Google Cloud Console will try to default to a configuration that matches the value specified in this field.
PolicyListPolicyAllow
- All bool
The policy allows or denies all values.
- Values List<string>
The policy can define specific values that are allowed or denied.
PolicyListPolicyDeny
- All bool
The policy allows or denies all values.
- Values List<string>
The policy can define specific values that are allowed or denied.
PolicyRestorePolicy
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.