Organization Policy Args
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
Constructors
Properties
A boolean policy is a constraint that is either enforced or not. Structure is documented below.
The name of the Constraint the Policy is configuring, for example, serviceuser.services
. Check out the complete list of available constraints.
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.
A restore policy is a constraint to restore the default policy. Structure is documented below.