Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.kubernetes.flowcontrol.v1.inputs.ResourcePolicyRuleArgs Maven / Gradle / Ivy
Go to download
A Pulumi package for creating and managing Kubernetes resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.kubernetes.flowcontrol.v1.inputs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* ResourcePolicyRule is a predicate that matches some resource requests, testing the request's verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) either (d1) the request does not specify a namespace (i.e., `Namespace==""`) and clusterScope is true or (d2) the request specifies a namespace and least one member of namespaces matches the request's namespace.
*
*/
public final class ResourcePolicyRuleArgs extends com.pulumi.resources.ResourceArgs {
public static final ResourcePolicyRuleArgs Empty = new ResourcePolicyRuleArgs();
/**
* `apiGroups` is a list of matching API groups and may not be empty. "*" matches all API groups and, if present, must be the only entry. Required.
*
*/
@Import(name="apiGroups", required=true)
private Output> apiGroups;
/**
* @return `apiGroups` is a list of matching API groups and may not be empty. "*" matches all API groups and, if present, must be the only entry. Required.
*
*/
public Output> apiGroups() {
return this.apiGroups;
}
/**
* `clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.
*
*/
@Import(name="clusterScope")
private @Nullable Output clusterScope;
/**
* @return `clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.
*
*/
public Optional> clusterScope() {
return Optional.ofNullable(this.clusterScope);
}
/**
* `namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains "*". Note that "*" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.
*
*/
@Import(name="namespaces")
private @Nullable Output> namespaces;
/**
* @return `namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains "*". Note that "*" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.
*
*/
public Optional>> namespaces() {
return Optional.ofNullable(this.namespaces);
}
/**
* `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ "services", "nodes/status" ]. This list may not be empty. "*" matches all resources and, if present, must be the only entry. Required.
*
*/
@Import(name="resources", required=true)
private Output> resources;
/**
* @return `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ "services", "nodes/status" ]. This list may not be empty. "*" matches all resources and, if present, must be the only entry. Required.
*
*/
public Output> resources() {
return this.resources;
}
/**
* `verbs` is a list of matching verbs and may not be empty. "*" matches all verbs and, if present, must be the only entry. Required.
*
*/
@Import(name="verbs", required=true)
private Output> verbs;
/**
* @return `verbs` is a list of matching verbs and may not be empty. "*" matches all verbs and, if present, must be the only entry. Required.
*
*/
public Output> verbs() {
return this.verbs;
}
private ResourcePolicyRuleArgs() {}
private ResourcePolicyRuleArgs(ResourcePolicyRuleArgs $) {
this.apiGroups = $.apiGroups;
this.clusterScope = $.clusterScope;
this.namespaces = $.namespaces;
this.resources = $.resources;
this.verbs = $.verbs;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(ResourcePolicyRuleArgs defaults) {
return new Builder(defaults);
}
public static final class Builder {
private ResourcePolicyRuleArgs $;
public Builder() {
$ = new ResourcePolicyRuleArgs();
}
public Builder(ResourcePolicyRuleArgs defaults) {
$ = new ResourcePolicyRuleArgs(Objects.requireNonNull(defaults));
}
/**
* @param apiGroups `apiGroups` is a list of matching API groups and may not be empty. "*" matches all API groups and, if present, must be the only entry. Required.
*
* @return builder
*
*/
public Builder apiGroups(Output> apiGroups) {
$.apiGroups = apiGroups;
return this;
}
/**
* @param apiGroups `apiGroups` is a list of matching API groups and may not be empty. "*" matches all API groups and, if present, must be the only entry. Required.
*
* @return builder
*
*/
public Builder apiGroups(List apiGroups) {
return apiGroups(Output.of(apiGroups));
}
/**
* @param apiGroups `apiGroups` is a list of matching API groups and may not be empty. "*" matches all API groups and, if present, must be the only entry. Required.
*
* @return builder
*
*/
public Builder apiGroups(String... apiGroups) {
return apiGroups(List.of(apiGroups));
}
/**
* @param clusterScope `clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.
*
* @return builder
*
*/
public Builder clusterScope(@Nullable Output clusterScope) {
$.clusterScope = clusterScope;
return this;
}
/**
* @param clusterScope `clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.
*
* @return builder
*
*/
public Builder clusterScope(Boolean clusterScope) {
return clusterScope(Output.of(clusterScope));
}
/**
* @param namespaces `namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains "*". Note that "*" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.
*
* @return builder
*
*/
public Builder namespaces(@Nullable Output> namespaces) {
$.namespaces = namespaces;
return this;
}
/**
* @param namespaces `namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains "*". Note that "*" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.
*
* @return builder
*
*/
public Builder namespaces(List namespaces) {
return namespaces(Output.of(namespaces));
}
/**
* @param namespaces `namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains "*". Note that "*" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.
*
* @return builder
*
*/
public Builder namespaces(String... namespaces) {
return namespaces(List.of(namespaces));
}
/**
* @param resources `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ "services", "nodes/status" ]. This list may not be empty. "*" matches all resources and, if present, must be the only entry. Required.
*
* @return builder
*
*/
public Builder resources(Output> resources) {
$.resources = resources;
return this;
}
/**
* @param resources `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ "services", "nodes/status" ]. This list may not be empty. "*" matches all resources and, if present, must be the only entry. Required.
*
* @return builder
*
*/
public Builder resources(List resources) {
return resources(Output.of(resources));
}
/**
* @param resources `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ "services", "nodes/status" ]. This list may not be empty. "*" matches all resources and, if present, must be the only entry. Required.
*
* @return builder
*
*/
public Builder resources(String... resources) {
return resources(List.of(resources));
}
/**
* @param verbs `verbs` is a list of matching verbs and may not be empty. "*" matches all verbs and, if present, must be the only entry. Required.
*
* @return builder
*
*/
public Builder verbs(Output> verbs) {
$.verbs = verbs;
return this;
}
/**
* @param verbs `verbs` is a list of matching verbs and may not be empty. "*" matches all verbs and, if present, must be the only entry. Required.
*
* @return builder
*
*/
public Builder verbs(List verbs) {
return verbs(Output.of(verbs));
}
/**
* @param verbs `verbs` is a list of matching verbs and may not be empty. "*" matches all verbs and, if present, must be the only entry. Required.
*
* @return builder
*
*/
public Builder verbs(String... verbs) {
return verbs(List.of(verbs));
}
public ResourcePolicyRuleArgs build() {
if ($.apiGroups == null) {
throw new MissingRequiredPropertyException("ResourcePolicyRuleArgs", "apiGroups");
}
if ($.resources == null) {
throw new MissingRequiredPropertyException("ResourcePolicyRuleArgs", "resources");
}
if ($.verbs == null) {
throw new MissingRequiredPropertyException("ResourcePolicyRuleArgs", "verbs");
}
return $;
}
}
}