Google Cloud Native is in preview. Google Cloud Classic is fully supported.
google-native.orgpolicy/v2.getCustomConstraint
Explore with Pulumi AI
Google Cloud Native is in preview. Google Cloud Classic is fully supported.
Gets a custom constraint. Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the custom constraint does not exist.
Using getCustomConstraint
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCustomConstraint(args: GetCustomConstraintArgs, opts?: InvokeOptions): Promise<GetCustomConstraintResult>
function getCustomConstraintOutput(args: GetCustomConstraintOutputArgs, opts?: InvokeOptions): Output<GetCustomConstraintResult>
def get_custom_constraint(custom_constraint_id: Optional[str] = None,
organization_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCustomConstraintResult
def get_custom_constraint_output(custom_constraint_id: Optional[pulumi.Input[str]] = None,
organization_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetCustomConstraintResult]
func LookupCustomConstraint(ctx *Context, args *LookupCustomConstraintArgs, opts ...InvokeOption) (*LookupCustomConstraintResult, error)
func LookupCustomConstraintOutput(ctx *Context, args *LookupCustomConstraintOutputArgs, opts ...InvokeOption) LookupCustomConstraintResultOutput
> Note: This function is named LookupCustomConstraint
in the Go SDK.
public static class GetCustomConstraint
{
public static Task<GetCustomConstraintResult> InvokeAsync(GetCustomConstraintArgs args, InvokeOptions? opts = null)
public static Output<GetCustomConstraintResult> Invoke(GetCustomConstraintInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetCustomConstraintResult> getCustomConstraint(GetCustomConstraintArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: google-native:orgpolicy/v2:getCustomConstraint
arguments:
# arguments dictionary
The following arguments are supported:
- Custom
Constraint stringId - Organization
Id string
- Custom
Constraint stringId - Organization
Id string
- custom
Constraint StringId - organization
Id String
- custom
Constraint stringId - organization
Id string
- custom
Constraint StringId - organization
Id String
getCustomConstraint Result
The following output properties are available:
- Action
Type string - Allow or deny type.
- Condition string
- Org policy condition/expression. For example:
resource.instanceName.matches("[production|test]_.*_(\d)+")
or,resource.management.auto_upgrade == true
The max length of the condition is 1000 characters. - Description string
- Detailed information about this custom policy constraint. The max length of the description is 2000 characters.
- Display
Name string - One line display name for the UI. The max length of the display_name is 200 characters.
- Method
Types List<string> - All the operations being applied for this constraint.
- Name string
- Immutable. Name of the constraint. This is unique within the organization. Format of the name should be *
organizations/{organization_id}/customConstraints/{custom_constraint_id}
Example:organizations/123/customConstraints/custom.createOnlyE2TypeVms
The max length is 70 characters and the minimum length is 1. Note that the prefixorganizations/{organization_id}/customConstraints/
is not counted. - Resource
Types List<string> - Immutable. The resource instance type on which this policy applies. Format will be of the form :
/
Example: *compute.googleapis.com/Instance
. - Update
Time string - The last time this custom constraint was updated. This represents the last time that the
CreateCustomConstraint
orUpdateCustomConstraint
RPC was called
- Action
Type string - Allow or deny type.
- Condition string
- Org policy condition/expression. For example:
resource.instanceName.matches("[production|test]_.*_(\d)+")
or,resource.management.auto_upgrade == true
The max length of the condition is 1000 characters. - Description string
- Detailed information about this custom policy constraint. The max length of the description is 2000 characters.
- Display
Name string - One line display name for the UI. The max length of the display_name is 200 characters.
- Method
Types []string - All the operations being applied for this constraint.
- Name string
- Immutable. Name of the constraint. This is unique within the organization. Format of the name should be *
organizations/{organization_id}/customConstraints/{custom_constraint_id}
Example:organizations/123/customConstraints/custom.createOnlyE2TypeVms
The max length is 70 characters and the minimum length is 1. Note that the prefixorganizations/{organization_id}/customConstraints/
is not counted. - Resource
Types []string - Immutable. The resource instance type on which this policy applies. Format will be of the form :
/
Example: *compute.googleapis.com/Instance
. - Update
Time string - The last time this custom constraint was updated. This represents the last time that the
CreateCustomConstraint
orUpdateCustomConstraint
RPC was called
- action
Type String - Allow or deny type.
- condition String
- Org policy condition/expression. For example:
resource.instanceName.matches("[production|test]_.*_(\d)+")
or,resource.management.auto_upgrade == true
The max length of the condition is 1000 characters. - description String
- Detailed information about this custom policy constraint. The max length of the description is 2000 characters.
- display
Name String - One line display name for the UI. The max length of the display_name is 200 characters.
- method
Types List<String> - All the operations being applied for this constraint.
- name String
- Immutable. Name of the constraint. This is unique within the organization. Format of the name should be *
organizations/{organization_id}/customConstraints/{custom_constraint_id}
Example:organizations/123/customConstraints/custom.createOnlyE2TypeVms
The max length is 70 characters and the minimum length is 1. Note that the prefixorganizations/{organization_id}/customConstraints/
is not counted. - resource
Types List<String> - Immutable. The resource instance type on which this policy applies. Format will be of the form :
/
Example: *compute.googleapis.com/Instance
. - update
Time String - The last time this custom constraint was updated. This represents the last time that the
CreateCustomConstraint
orUpdateCustomConstraint
RPC was called
- action
Type string - Allow or deny type.
- condition string
- Org policy condition/expression. For example:
resource.instanceName.matches("[production|test]_.*_(\d)+")
or,resource.management.auto_upgrade == true
The max length of the condition is 1000 characters. - description string
- Detailed information about this custom policy constraint. The max length of the description is 2000 characters.
- display
Name string - One line display name for the UI. The max length of the display_name is 200 characters.
- method
Types string[] - All the operations being applied for this constraint.
- name string
- Immutable. Name of the constraint. This is unique within the organization. Format of the name should be *
organizations/{organization_id}/customConstraints/{custom_constraint_id}
Example:organizations/123/customConstraints/custom.createOnlyE2TypeVms
The max length is 70 characters and the minimum length is 1. Note that the prefixorganizations/{organization_id}/customConstraints/
is not counted. - resource
Types string[] - Immutable. The resource instance type on which this policy applies. Format will be of the form :
/
Example: *compute.googleapis.com/Instance
. - update
Time string - The last time this custom constraint was updated. This represents the last time that the
CreateCustomConstraint
orUpdateCustomConstraint
RPC was called
- action_
type str - Allow or deny type.
- condition str
- Org policy condition/expression. For example:
resource.instanceName.matches("[production|test]_.*_(\d)+")
or,resource.management.auto_upgrade == true
The max length of the condition is 1000 characters. - description str
- Detailed information about this custom policy constraint. The max length of the description is 2000 characters.
- display_
name str - One line display name for the UI. The max length of the display_name is 200 characters.
- method_
types Sequence[str] - All the operations being applied for this constraint.
- name str
- Immutable. Name of the constraint. This is unique within the organization. Format of the name should be *
organizations/{organization_id}/customConstraints/{custom_constraint_id}
Example:organizations/123/customConstraints/custom.createOnlyE2TypeVms
The max length is 70 characters and the minimum length is 1. Note that the prefixorganizations/{organization_id}/customConstraints/
is not counted. - resource_
types Sequence[str] - Immutable. The resource instance type on which this policy applies. Format will be of the form :
/
Example: *compute.googleapis.com/Instance
. - update_
time str - The last time this custom constraint was updated. This represents the last time that the
CreateCustomConstraint
orUpdateCustomConstraint
RPC was called
- action
Type String - Allow or deny type.
- condition String
- Org policy condition/expression. For example:
resource.instanceName.matches("[production|test]_.*_(\d)+")
or,resource.management.auto_upgrade == true
The max length of the condition is 1000 characters. - description String
- Detailed information about this custom policy constraint. The max length of the description is 2000 characters.
- display
Name String - One line display name for the UI. The max length of the display_name is 200 characters.
- method
Types List<String> - All the operations being applied for this constraint.
- name String
- Immutable. Name of the constraint. This is unique within the organization. Format of the name should be *
organizations/{organization_id}/customConstraints/{custom_constraint_id}
Example:organizations/123/customConstraints/custom.createOnlyE2TypeVms
The max length is 70 characters and the minimum length is 1. Note that the prefixorganizations/{organization_id}/customConstraints/
is not counted. - resource
Types List<String> - Immutable. The resource instance type on which this policy applies. Format will be of the form :
/
Example: *compute.googleapis.com/Instance
. - update
Time String - The last time this custom constraint was updated. This represents the last time that the
CreateCustomConstraint
orUpdateCustomConstraint
RPC was called
Package Details
- Repository
- Google Cloud Native pulumi/pulumi-google-native
- License
- Apache-2.0
Google Cloud Native is in preview. Google Cloud Classic is fully supported.