OrganizationPolicy

class OrganizationPolicy : KotlinCustomResource

Allows management of Organization Policies for a Google Cloud Project.

Warning: This resource has been superseded by gcp.orgpolicy.Policy. gcp.orgpolicy.Policy uses Organization Policy API V2 instead of Cloud Resource Manager API V1 and it supports additional features such as tags and conditions. To get more information about Organization Policies, see:

Example Usage

To set policy with a boolean constraint:

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.projects.OrganizationPolicy;
import com.pulumi.gcp.projects.OrganizationPolicyArgs;
import com.pulumi.gcp.projects.inputs.OrganizationPolicyBooleanPolicyArgs;
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 serialPortPolicy = new OrganizationPolicy("serialPortPolicy", OrganizationPolicyArgs.builder()
.booleanPolicy(OrganizationPolicyBooleanPolicyArgs.builder()
.enforced(true)
.build())
.constraint("compute.disableSerialPortAccess")
.project("your-project-id")
.build());
}
}

Import

Project organization policies can be imported using any of the follow formats

$ pulumi import gcp:projects/organizationPolicy:OrganizationPolicy policy projects/test-project:constraints/serviceuser.services
$ pulumi import gcp:projects/organizationPolicy:OrganizationPolicy policy test-project:constraints/serviceuser.services
$ pulumi import gcp:projects/organizationPolicy:OrganizationPolicy policy test-project:serviceuser.services

Properties

Link copied to clipboard

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

Link copied to clipboard
val constraint: Output<String>

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

Link copied to clipboard
val etag: Output<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.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

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.

Link copied to clipboard
val project: Output<String>

The project id of the project to set the policy for.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard
val updateTime: Output<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".

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val version: Output<Int>

Version of the Policy. Default version is 0.