All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.googlenative.osconfig.v1beta.inputs.AssignmentArgs Maven / Gradle / Ivy

// *** 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.googlenative.osconfig.v1beta.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.googlenative.osconfig.v1beta.inputs.AssignmentGroupLabelArgs;
import com.pulumi.googlenative.osconfig.v1beta.inputs.AssignmentOsTypeArgs;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * An assignment represents the group or groups of VM instances that the policy applies to. If an assignment is empty, it applies to all VM instances. Otherwise, the targeted VM instances must meet all the criteria specified. So if both labels and zones are specified, the policy applies to VM instances with those labels and in those zones.
 * 
 */
public final class AssignmentArgs extends com.pulumi.resources.ResourceArgs {

    public static final AssignmentArgs Empty = new AssignmentArgs();

    /**
     * Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example "env=prod or env=staging".
     * 
     */
    @Import(name="groupLabels")
    private @Nullable Output> groupLabels;

    /**
     * @return Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example "env=prod or env=staging".
     * 
     */
    public Optional>> groupLabels() {
        return Optional.ofNullable(this.groupLabels);
    }

    /**
     * Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix="prod-". Only supported for project-level policies.
     * 
     */
    @Import(name="instanceNamePrefixes")
    private @Nullable Output> instanceNamePrefixes;

    /**
     * @return Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix="prod-". Only supported for project-level policies.
     * 
     */
    public Optional>> instanceNamePrefixes() {
        return Optional.ofNullable(this.instanceNamePrefixes);
    }

    /**
     * Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project.
     * 
     */
    @Import(name="instances")
    private @Nullable Output> instances;

    /**
     * @return Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project.
     * 
     */
    public Optional>> instances() {
        return Optional.ofNullable(this.instances);
    }

    /**
     * Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included.
     * 
     */
    @Import(name="osTypes")
    private @Nullable Output> osTypes;

    /**
     * @return Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included.
     * 
     */
    public Optional>> osTypes() {
        return Optional.ofNullable(this.osTypes);
    }

    /**
     * Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.
     * 
     */
    @Import(name="zones")
    private @Nullable Output> zones;

    /**
     * @return Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.
     * 
     */
    public Optional>> zones() {
        return Optional.ofNullable(this.zones);
    }

    private AssignmentArgs() {}

    private AssignmentArgs(AssignmentArgs $) {
        this.groupLabels = $.groupLabels;
        this.instanceNamePrefixes = $.instanceNamePrefixes;
        this.instances = $.instances;
        this.osTypes = $.osTypes;
        this.zones = $.zones;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(AssignmentArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private AssignmentArgs $;

        public Builder() {
            $ = new AssignmentArgs();
        }

        public Builder(AssignmentArgs defaults) {
            $ = new AssignmentArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param groupLabels Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example "env=prod or env=staging".
         * 
         * @return builder
         * 
         */
        public Builder groupLabels(@Nullable Output> groupLabels) {
            $.groupLabels = groupLabels;
            return this;
        }

        /**
         * @param groupLabels Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example "env=prod or env=staging".
         * 
         * @return builder
         * 
         */
        public Builder groupLabels(List groupLabels) {
            return groupLabels(Output.of(groupLabels));
        }

        /**
         * @param groupLabels Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example "env=prod or env=staging".
         * 
         * @return builder
         * 
         */
        public Builder groupLabels(AssignmentGroupLabelArgs... groupLabels) {
            return groupLabels(List.of(groupLabels));
        }

        /**
         * @param instanceNamePrefixes Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix="prod-". Only supported for project-level policies.
         * 
         * @return builder
         * 
         */
        public Builder instanceNamePrefixes(@Nullable Output> instanceNamePrefixes) {
            $.instanceNamePrefixes = instanceNamePrefixes;
            return this;
        }

        /**
         * @param instanceNamePrefixes Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix="prod-". Only supported for project-level policies.
         * 
         * @return builder
         * 
         */
        public Builder instanceNamePrefixes(List instanceNamePrefixes) {
            return instanceNamePrefixes(Output.of(instanceNamePrefixes));
        }

        /**
         * @param instanceNamePrefixes Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix="prod-". Only supported for project-level policies.
         * 
         * @return builder
         * 
         */
        public Builder instanceNamePrefixes(String... instanceNamePrefixes) {
            return instanceNamePrefixes(List.of(instanceNamePrefixes));
        }

        /**
         * @param instances Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project.
         * 
         * @return builder
         * 
         */
        public Builder instances(@Nullable Output> instances) {
            $.instances = instances;
            return this;
        }

        /**
         * @param instances Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project.
         * 
         * @return builder
         * 
         */
        public Builder instances(List instances) {
            return instances(Output.of(instances));
        }

        /**
         * @param instances Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project.
         * 
         * @return builder
         * 
         */
        public Builder instances(String... instances) {
            return instances(List.of(instances));
        }

        /**
         * @param osTypes Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included.
         * 
         * @return builder
         * 
         */
        public Builder osTypes(@Nullable Output> osTypes) {
            $.osTypes = osTypes;
            return this;
        }

        /**
         * @param osTypes Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included.
         * 
         * @return builder
         * 
         */
        public Builder osTypes(List osTypes) {
            return osTypes(Output.of(osTypes));
        }

        /**
         * @param osTypes Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included.
         * 
         * @return builder
         * 
         */
        public Builder osTypes(AssignmentOsTypeArgs... osTypes) {
            return osTypes(List.of(osTypes));
        }

        /**
         * @param zones Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.
         * 
         * @return builder
         * 
         */
        public Builder zones(@Nullable Output> zones) {
            $.zones = zones;
            return this;
        }

        /**
         * @param zones Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.
         * 
         * @return builder
         * 
         */
        public Builder zones(List zones) {
            return zones(Output.of(zones));
        }

        /**
         * @param zones Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.
         * 
         * @return builder
         * 
         */
        public Builder zones(String... zones) {
            return zones(List.of(zones));
        }

        public AssignmentArgs build() {
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy