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

com.pulumi.gcp.osconfig.kotlin.OsPolicyAssignmentArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.osconfig.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.osconfig.OsPolicyAssignmentArgs.builder
import com.pulumi.gcp.osconfig.kotlin.inputs.OsPolicyAssignmentInstanceFilterArgs
import com.pulumi.gcp.osconfig.kotlin.inputs.OsPolicyAssignmentInstanceFilterArgsBuilder
import com.pulumi.gcp.osconfig.kotlin.inputs.OsPolicyAssignmentOsPolicyArgs
import com.pulumi.gcp.osconfig.kotlin.inputs.OsPolicyAssignmentOsPolicyArgsBuilder
import com.pulumi.gcp.osconfig.kotlin.inputs.OsPolicyAssignmentRolloutArgs
import com.pulumi.gcp.osconfig.kotlin.inputs.OsPolicyAssignmentRolloutArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * OS policy assignment is an API resource that is used to apply a set of OS
 * policies to a dynamically targeted group of Compute Engine VM instances. An OS
 * policy is used to define the desired state configuration for a Compute Engine VM
 * instance through a set of configuration resources that provide capabilities such
 * as installing or removing software packages, or executing a script. For more
 * information about the OS policy resource definitions and examples, see
 * [OS policy and OS policy assignment](https://cloud.google.com/compute/docs/os-configuration-management/working-with-os-policies).
 * To get more information about OSPolicyAssignment, see:
 * *   [API documentation](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments)
 * *   How-to Guides
 *     *   [Official Documentation](https://cloud.google.com/compute/docs/os-configuration-management/create-os-policy-assignment)
 * ## Example Usage
 * ### Os Config Os Policy Assignment Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const primary = new gcp.osconfig.OsPolicyAssignment("primary", {
 *     instanceFilter: {
 *         all: false,
 *         exclusionLabels: [{
 *             labels: {
 *                 "label-two": "value-two",
 *             },
 *         }],
 *         inclusionLabels: [{
 *             labels: {
 *                 "label-one": "value-one",
 *             },
 *         }],
 *         inventories: [{
 *             osShortName: "centos",
 *             osVersion: "8.*",
 *         }],
 *     },
 *     location: "us-central1-a",
 *     name: "policy-assignment",
 *     osPolicies: [{
 *         id: "policy",
 *         mode: "VALIDATION",
 *         resourceGroups: [{
 *             resources: [
 *                 {
 *                     id: "apt-to-yum",
 *                     repository: {
 *                         apt: {
 *                             archiveType: "DEB",
 *                             components: ["doc"],
 *                             distribution: "debian",
 *                             uri: "https://atl.mirrors.clouvider.net/debian",
 *                             gpgKey: ".gnupg/pubring.kbx",
 *                         },
 *                     },
 *                 },
 *                 {
 *                     id: "exec1",
 *                     exec: {
 *                         validate: {
 *                             interpreter: "SHELL",
 *                             args: ["arg1"],
 *                             file: {
 *                                 localPath: "$HOME/script.sh",
 *                             },
 *                             outputFilePath: "$HOME/out",
 *                         },
 *                         enforce: {
 *                             interpreter: "SHELL",
 *                             args: ["arg1"],
 *                             file: {
 *                                 allowInsecure: true,
 *                                 remote: {
 *                                     uri: "https://www.example.com/script.sh",
 *                                     sha256Checksum: "c7938fed83afdccbb0e86a2a2e4cad7d5035012ca3214b4a61268393635c3063",
 *                                 },
 *                             },
 *                             outputFilePath: "$HOME/out",
 *                         },
 *                     },
 *                 },
 *             ],
 *             inventoryFilters: [{
 *                 osShortName: "centos",
 *                 osVersion: "8.*",
 *             }],
 *         }],
 *         allowNoResourceGroupMatch: false,
 *         description: "A test os policy",
 *     }],
 *     rollout: {
 *         disruptionBudget: {
 *             percent: 100,
 *         },
 *         minWaitDuration: "3s",
 *     },
 *     description: "A test os policy assignment",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * primary = gcp.osconfig.OsPolicyAssignment("primary",
 *     instance_filter=gcp.osconfig.OsPolicyAssignmentInstanceFilterArgs(
 *         all=False,
 *         exclusion_labels=[gcp.osconfig.OsPolicyAssignmentInstanceFilterExclusionLabelArgs(
 *             labels={
 *                 "label-two": "value-two",
 *             },
 *         )],
 *         inclusion_labels=[gcp.osconfig.OsPolicyAssignmentInstanceFilterInclusionLabelArgs(
 *             labels={
 *                 "label-one": "value-one",
 *             },
 *         )],
 *         inventories=[gcp.osconfig.OsPolicyAssignmentInstanceFilterInventoryArgs(
 *             os_short_name="centos",
 *             os_version="8.*",
 *         )],
 *     ),
 *     location="us-central1-a",
 *     name="policy-assignment",
 *     os_policies=[gcp.osconfig.OsPolicyAssignmentOsPolicyArgs(
 *         id="policy",
 *         mode="VALIDATION",
 *         resource_groups=[gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupArgs(
 *             resources=[
 *                 gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceArgs(
 *                     id="apt-to-yum",
 *                     repository=gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryArgs(
 *                         apt=gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryAptArgs(
 *                             archive_type="DEB",
 *                             components=["doc"],
 *                             distribution="debian",
 *                             uri="https://atl.mirrors.clouvider.net/debian",
 *                             gpg_key=".gnupg/pubring.kbx",
 *                         ),
 *                     ),
 *                 ),
 *                 gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceArgs(
 *                     id="exec1",
 *                     exec_=gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecArgs(
 *                         validate=gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecValidateArgs(
 *                             interpreter="SHELL",
 *                             args=["arg1"],
 *                             file=gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecValidateFileArgs(
 *                                 local_path="$HOME/script.sh",
 *                             ),
 *                             output_file_path="$HOME/out",
 *                         ),
 *                         enforce=gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceArgs(
 *                             interpreter="SHELL",
 *                             args=["arg1"],
 *                             file=gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceFileArgs(
 *                                 allow_insecure=True,
 *                                 remote=gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceFileRemoteArgs(
 *                                     uri="https://www.example.com/script.sh",
 *                                     sha256_checksum="c7938fed83afdccbb0e86a2a2e4cad7d5035012ca3214b4a61268393635c3063",
 *                                 ),
 *                             ),
 *                             output_file_path="$HOME/out",
 *                         ),
 *                     ),
 *                 ),
 *             ],
 *             inventory_filters=[gcp.osconfig.OsPolicyAssignmentOsPolicyResourceGroupInventoryFilterArgs(
 *                 os_short_name="centos",
 *                 os_version="8.*",
 *             )],
 *         )],
 *         allow_no_resource_group_match=False,
 *         description="A test os policy",
 *     )],
 *     rollout=gcp.osconfig.OsPolicyAssignmentRolloutArgs(
 *         disruption_budget=gcp.osconfig.OsPolicyAssignmentRolloutDisruptionBudgetArgs(
 *             percent=100,
 *         ),
 *         min_wait_duration="3s",
 *     ),
 *     description="A test os policy assignment")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var primary = new Gcp.OsConfig.OsPolicyAssignment("primary", new()
 *     {
 *         InstanceFilter = new Gcp.OsConfig.Inputs.OsPolicyAssignmentInstanceFilterArgs
 *         {
 *             All = false,
 *             ExclusionLabels = new[]
 *             {
 *                 new Gcp.OsConfig.Inputs.OsPolicyAssignmentInstanceFilterExclusionLabelArgs
 *                 {
 *                     Labels =
 *                     {
 *                         { "label-two", "value-two" },
 *                     },
 *                 },
 *             },
 *             InclusionLabels = new[]
 *             {
 *                 new Gcp.OsConfig.Inputs.OsPolicyAssignmentInstanceFilterInclusionLabelArgs
 *                 {
 *                     Labels =
 *                     {
 *                         { "label-one", "value-one" },
 *                     },
 *                 },
 *             },
 *             Inventories = new[]
 *             {
 *                 new Gcp.OsConfig.Inputs.OsPolicyAssignmentInstanceFilterInventoryArgs
 *                 {
 *                     OsShortName = "centos",
 *                     OsVersion = "8.*",
 *                 },
 *             },
 *         },
 *         Location = "us-central1-a",
 *         Name = "policy-assignment",
 *         OsPolicies = new[]
 *         {
 *             new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyArgs
 *             {
 *                 Id = "policy",
 *                 Mode = "VALIDATION",
 *                 ResourceGroups = new[]
 *                 {
 *                     new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupArgs
 *                     {
 *                         Resources = new[]
 *                         {
 *                             new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupResourceArgs
 *                             {
 *                                 Id = "apt-to-yum",
 *                                 Repository = new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryArgs
 *                                 {
 *                                     Apt = new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryAptArgs
 *                                     {
 *                                         ArchiveType = "DEB",
 *                                         Components = new[]
 *                                         {
 *                                             "doc",
 *                                         },
 *                                         Distribution = "debian",
 *                                         Uri = "https://atl.mirrors.clouvider.net/debian",
 *                                         GpgKey = ".gnupg/pubring.kbx",
 *                                     },
 *                                 },
 *                             },
 *                             new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupResourceArgs
 *                             {
 *                                 Id = "exec1",
 *                                 Exec = new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupResourceExecArgs
 *                                 {
 *                                     Validate = new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupResourceExecValidateArgs
 *                                     {
 *                                         Interpreter = "SHELL",
 *                                         Args = new[]
 *                                         {
 *                                             "arg1",
 *                                         },
 *                                         File = new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupResourceExecValidateFileArgs
 *                                         {
 *                                             LocalPath = "$HOME/script.sh",
 *                                         },
 *                                         OutputFilePath = "$HOME/out",
 *                                     },
 *                                     Enforce = new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceArgs
 *                                     {
 *                                         Interpreter = "SHELL",
 *                                         Args = new[]
 *                                         {
 *                                             "arg1",
 *                                         },
 *                                         File = new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceFileArgs
 *                                         {
 *                                             AllowInsecure = true,
 *                                             Remote = new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceFileRemoteArgs
 *                                             {
 *                                                 Uri = "https://www.example.com/script.sh",
 *                                                 Sha256Checksum = "c7938fed83afdccbb0e86a2a2e4cad7d5035012ca3214b4a61268393635c3063",
 *                                             },
 *                                         },
 *                                         OutputFilePath = "$HOME/out",
 *                                     },
 *                                 },
 *                             },
 *                         },
 *                         InventoryFilters = new[]
 *                         {
 *                             new Gcp.OsConfig.Inputs.OsPolicyAssignmentOsPolicyResourceGroupInventoryFilterArgs
 *                             {
 *                                 OsShortName = "centos",
 *                                 OsVersion = "8.*",
 *                             },
 *                         },
 *                     },
 *                 },
 *                 AllowNoResourceGroupMatch = false,
 *                 Description = "A test os policy",
 *             },
 *         },
 *         Rollout = new Gcp.OsConfig.Inputs.OsPolicyAssignmentRolloutArgs
 *         {
 *             DisruptionBudget = new Gcp.OsConfig.Inputs.OsPolicyAssignmentRolloutDisruptionBudgetArgs
 *             {
 *                 Percent = 100,
 *             },
 *             MinWaitDuration = "3s",
 *         },
 *         Description = "A test os policy assignment",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/osconfig"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := osconfig.NewOsPolicyAssignment(ctx, "primary", &osconfig.OsPolicyAssignmentArgs{
 * 			InstanceFilter: &osconfig.OsPolicyAssignmentInstanceFilterArgs{
 * 				All: pulumi.Bool(false),
 * 				ExclusionLabels: osconfig.OsPolicyAssignmentInstanceFilterExclusionLabelArray{
 * 					&osconfig.OsPolicyAssignmentInstanceFilterExclusionLabelArgs{
 * 						Labels: pulumi.StringMap{
 * 							"label-two": pulumi.String("value-two"),
 * 						},
 * 					},
 * 				},
 * 				InclusionLabels: osconfig.OsPolicyAssignmentInstanceFilterInclusionLabelArray{
 * 					&osconfig.OsPolicyAssignmentInstanceFilterInclusionLabelArgs{
 * 						Labels: pulumi.StringMap{
 * 							"label-one": pulumi.String("value-one"),
 * 						},
 * 					},
 * 				},
 * 				Inventories: osconfig.OsPolicyAssignmentInstanceFilterInventoryArray{
 * 					&osconfig.OsPolicyAssignmentInstanceFilterInventoryArgs{
 * 						OsShortName: pulumi.String("centos"),
 * 						OsVersion:   pulumi.String("8.*"),
 * 					},
 * 				},
 * 			},
 * 			Location: pulumi.String("us-central1-a"),
 * 			Name:     pulumi.String("policy-assignment"),
 * 			OsPolicies: osconfig.OsPolicyAssignmentOsPolicyArray{
 * 				&osconfig.OsPolicyAssignmentOsPolicyArgs{
 * 					Id:   pulumi.String("policy"),
 * 					Mode: pulumi.String("VALIDATION"),
 * 					ResourceGroups: osconfig.OsPolicyAssignmentOsPolicyResourceGroupArray{
 * 						&osconfig.OsPolicyAssignmentOsPolicyResourceGroupArgs{
 * 							Resources: osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceArray{
 * 								&osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceArgs{
 * 									Id: pulumi.String("apt-to-yum"),
 * 									Repository: &osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryArgs{
 * 										Apt: &osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryAptArgs{
 * 											ArchiveType: pulumi.String("DEB"),
 * 											Components: pulumi.StringArray{
 * 												pulumi.String("doc"),
 * 											},
 * 											Distribution: pulumi.String("debian"),
 * 											Uri:          pulumi.String("https://atl.mirrors.clouvider.net/debian"),
 * 											GpgKey:       pulumi.String(".gnupg/pubring.kbx"),
 * 										},
 * 									},
 * 								},
 * 								&osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceArgs{
 * 									Id: pulumi.String("exec1"),
 * 									Exec: &osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecArgs{
 * 										Validate: &osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecValidateArgs{
 * 											Interpreter: pulumi.String("SHELL"),
 * 											Args: pulumi.StringArray{
 * 												pulumi.String("arg1"),
 * 											},
 * 											File: &osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecValidateFileArgs{
 * 												LocalPath: pulumi.String("$HOME/script.sh"),
 * 											},
 * 											OutputFilePath: pulumi.String("$HOME/out"),
 * 										},
 * 										Enforce: &osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceArgs{
 * 											Interpreter: pulumi.String("SHELL"),
 * 											Args: pulumi.StringArray{
 * 												pulumi.String("arg1"),
 * 											},
 * 											File: &osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceFileArgs{
 * 												AllowInsecure: pulumi.Bool(true),
 * 												Remote: &osconfig.OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceFileRemoteArgs{
 * 													Uri:            pulumi.String("https://www.example.com/script.sh"),
 * 													Sha256Checksum: pulumi.String("c7938fed83afdccbb0e86a2a2e4cad7d5035012ca3214b4a61268393635c3063"),
 * 												},
 * 											},
 * 											OutputFilePath: pulumi.String("$HOME/out"),
 * 										},
 * 									},
 * 								},
 * 							},
 * 							InventoryFilters: osconfig.OsPolicyAssignmentOsPolicyResourceGroupInventoryFilterArray{
 * 								&osconfig.OsPolicyAssignmentOsPolicyResourceGroupInventoryFilterArgs{
 * 									OsShortName: pulumi.String("centos"),
 * 									OsVersion:   pulumi.String("8.*"),
 * 								},
 * 							},
 * 						},
 * 					},
 * 					AllowNoResourceGroupMatch: pulumi.Bool(false),
 * 					Description:               pulumi.String("A test os policy"),
 * 				},
 * 			},
 * 			Rollout: &osconfig.OsPolicyAssignmentRolloutArgs{
 * 				DisruptionBudget: &osconfig.OsPolicyAssignmentRolloutDisruptionBudgetArgs{
 * 					Percent: pulumi.Int(100),
 * 				},
 * 				MinWaitDuration: pulumi.String("3s"),
 * 			},
 * 			Description: pulumi.String("A test os policy assignment"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.osconfig.OsPolicyAssignment;
 * import com.pulumi.gcp.osconfig.OsPolicyAssignmentArgs;
 * import com.pulumi.gcp.osconfig.inputs.OsPolicyAssignmentInstanceFilterArgs;
 * import com.pulumi.gcp.osconfig.inputs.OsPolicyAssignmentOsPolicyArgs;
 * import com.pulumi.gcp.osconfig.inputs.OsPolicyAssignmentRolloutArgs;
 * import com.pulumi.gcp.osconfig.inputs.OsPolicyAssignmentRolloutDisruptionBudgetArgs;
 * 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 primary = new OsPolicyAssignment("primary", OsPolicyAssignmentArgs.builder()
 *             .instanceFilter(OsPolicyAssignmentInstanceFilterArgs.builder()
 *                 .all(false)
 *                 .exclusionLabels(OsPolicyAssignmentInstanceFilterExclusionLabelArgs.builder()
 *                     .labels(Map.of("label-two", "value-two"))
 *                     .build())
 *                 .inclusionLabels(OsPolicyAssignmentInstanceFilterInclusionLabelArgs.builder()
 *                     .labels(Map.of("label-one", "value-one"))
 *                     .build())
 *                 .inventories(OsPolicyAssignmentInstanceFilterInventoryArgs.builder()
 *                     .osShortName("centos")
 *                     .osVersion("8.*")
 *                     .build())
 *                 .build())
 *             .location("us-central1-a")
 *             .name("policy-assignment")
 *             .osPolicies(OsPolicyAssignmentOsPolicyArgs.builder()
 *                 .id("policy")
 *                 .mode("VALIDATION")
 *                 .resourceGroups(OsPolicyAssignmentOsPolicyResourceGroupArgs.builder()
 *                     .resources(
 *                         OsPolicyAssignmentOsPolicyResourceGroupResourceArgs.builder()
 *                             .id("apt-to-yum")
 *                             .repository(OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryArgs.builder()
 *                                 .apt(OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryAptArgs.builder()
 *                                     .archiveType("DEB")
 *                                     .components("doc")
 *                                     .distribution("debian")
 *                                     .uri("https://atl.mirrors.clouvider.net/debian")
 *                                     .gpgKey(".gnupg/pubring.kbx")
 *                                     .build())
 *                                 .build())
 *                             .build(),
 *                         OsPolicyAssignmentOsPolicyResourceGroupResourceArgs.builder()
 *                             .id("exec1")
 *                             .exec(OsPolicyAssignmentOsPolicyResourceGroupResourceExecArgs.builder()
 *                                 .validate(OsPolicyAssignmentOsPolicyResourceGroupResourceExecValidateArgs.builder()
 *                                     .interpreter("SHELL")
 *                                     .args("arg1")
 *                                     .file(OsPolicyAssignmentOsPolicyResourceGroupResourceExecValidateFileArgs.builder()
 *                                         .localPath("$HOME/script.sh")
 *                                         .build())
 *                                     .outputFilePath("$HOME/out")
 *                                     .build())
 *                                 .enforce(OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceArgs.builder()
 *                                     .interpreter("SHELL")
 *                                     .args("arg1")
 *                                     .file(OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceFileArgs.builder()
 *                                         .allowInsecure(true)
 *                                         .remote(OsPolicyAssignmentOsPolicyResourceGroupResourceExecEnforceFileRemoteArgs.builder()
 *                                             .uri("https://www.example.com/script.sh")
 *                                             .sha256Checksum("c7938fed83afdccbb0e86a2a2e4cad7d5035012ca3214b4a61268393635c3063")
 *                                             .build())
 *                                         .build())
 *                                     .outputFilePath("$HOME/out")
 *                                     .build())
 *                                 .build())
 *                             .build())
 *                     .inventoryFilters(OsPolicyAssignmentOsPolicyResourceGroupInventoryFilterArgs.builder()
 *                         .osShortName("centos")
 *                         .osVersion("8.*")
 *                         .build())
 *                     .build())
 *                 .allowNoResourceGroupMatch(false)
 *                 .description("A test os policy")
 *                 .build())
 *             .rollout(OsPolicyAssignmentRolloutArgs.builder()
 *                 .disruptionBudget(OsPolicyAssignmentRolloutDisruptionBudgetArgs.builder()
 *                     .percent(100)
 *                     .build())
 *                 .minWaitDuration("3s")
 *                 .build())
 *             .description("A test os policy assignment")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   primary:
 *     type: gcp:osconfig:OsPolicyAssignment
 *     properties:
 *       instanceFilter:
 *         all: false
 *         exclusionLabels:
 *           - labels:
 *               label-two: value-two
 *         inclusionLabels:
 *           - labels:
 *               label-one: value-one
 *         inventories:
 *           - osShortName: centos
 *             osVersion: 8.*
 *       location: us-central1-a
 *       name: policy-assignment
 *       osPolicies:
 *         - id: policy
 *           mode: VALIDATION
 *           resourceGroups:
 *             - resources:
 *                 - id: apt-to-yum
 *                   repository:
 *                     apt:
 *                       archiveType: DEB
 *                       components:
 *                         - doc
 *                       distribution: debian
 *                       uri: https://atl.mirrors.clouvider.net/debian
 *                       gpgKey: .gnupg/pubring.kbx
 *                 - id: exec1
 *                   exec:
 *                     validate:
 *                       interpreter: SHELL
 *                       args:
 *                         - arg1
 *                       file:
 *                         localPath: $HOME/script.sh
 *                       outputFilePath: $HOME/out
 *                     enforce:
 *                       interpreter: SHELL
 *                       args:
 *                         - arg1
 *                       file:
 *                         allowInsecure: true
 *                         remote:
 *                           uri: https://www.example.com/script.sh
 *                           sha256Checksum: c7938fed83afdccbb0e86a2a2e4cad7d5035012ca3214b4a61268393635c3063
 *                       outputFilePath: $HOME/out
 *               inventoryFilters:
 *                 - osShortName: centos
 *                   osVersion: 8.*
 *           allowNoResourceGroupMatch: false
 *           description: A test os policy
 *       rollout:
 *         disruptionBudget:
 *           percent: 100
 *         minWaitDuration: 3s
 *       description: A test os policy assignment
 * ```
 * 
 * ## Import
 * OSPolicyAssignment can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/osPolicyAssignments/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, OSPolicyAssignment can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:osconfig/osPolicyAssignment:OsPolicyAssignment default projects/{{project}}/locations/{{location}}/osPolicyAssignments/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:osconfig/osPolicyAssignment:OsPolicyAssignment default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:osconfig/osPolicyAssignment:OsPolicyAssignment default {{location}}/{{name}}
 * ```
 * @property description OS policy assignment description. Length of the description is limited to 1024 characters.
 * @property instanceFilter Filter to select VMs. Structure is
 * documented below.
 * @property location The location for the resource
 * @property name Resource name.
 * @property osPolicies List of OS policies to be applied to the VMs.
 * Structure is documented below.
 * @property project The project for the resource
 * @property rollout Rollout to deploy the OS policy assignment. A rollout
 * is triggered in the following situations: 1) OSPolicyAssignment is created.
 * 2) OSPolicyAssignment is updated and the update contains changes to one of
 * the following fields: - instance_filter - os_policies 3) OSPolicyAssignment
 * is deleted. Structure is documented below.
 * @property skipAwaitRollout Set to true to skip awaiting rollout during resource creation and update.
 */
public data class OsPolicyAssignmentArgs(
    public val description: Output? = null,
    public val instanceFilter: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val osPolicies: Output>? = null,
    public val project: Output? = null,
    public val rollout: Output? = null,
    public val skipAwaitRollout: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.osconfig.OsPolicyAssignmentArgs =
        com.pulumi.gcp.osconfig.OsPolicyAssignmentArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .instanceFilter(instanceFilter?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .osPolicies(
                osPolicies?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .project(project?.applyValue({ args0 -> args0 }))
            .rollout(rollout?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .skipAwaitRollout(skipAwaitRollout?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [OsPolicyAssignmentArgs].
 */
@PulumiTagMarker
public class OsPolicyAssignmentArgsBuilder internal constructor() {
    private var description: Output? = null

    private var instanceFilter: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var osPolicies: Output>? = null

    private var project: Output? = null

    private var rollout: Output? = null

    private var skipAwaitRollout: Output? = null

    /**
     * @param value OS policy assignment description. Length of the description is limited to 1024 characters.
     */
    @JvmName("tfdkthclqushqojh")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Filter to select VMs. Structure is
     * documented below.
     */
    @JvmName("xpyksfyhfnwqussw")
    public suspend fun instanceFilter(`value`: Output) {
        this.instanceFilter = value
    }

    /**
     * @param value The location for the resource
     */
    @JvmName("jihwdrowkqvfiyrr")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Resource name.
     */
    @JvmName("arfgeuvcxqcjvdas")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value List of OS policies to be applied to the VMs.
     * Structure is documented below.
     */
    @JvmName("igfsyutkgenwxuih")
    public suspend fun osPolicies(`value`: Output>) {
        this.osPolicies = value
    }

    @JvmName("xeublurgnexnybiu")
    public suspend fun osPolicies(vararg values: Output) {
        this.osPolicies = Output.all(values.asList())
    }

    /**
     * @param values List of OS policies to be applied to the VMs.
     * Structure is documented below.
     */
    @JvmName("hqwfaiusguycdbcp")
    public suspend fun osPolicies(values: List>) {
        this.osPolicies = Output.all(values)
    }

    /**
     * @param value The project for the resource
     */
    @JvmName("hkckgxqfjnawgixq")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Rollout to deploy the OS policy assignment. A rollout
     * is triggered in the following situations: 1) OSPolicyAssignment is created.
     * 2) OSPolicyAssignment is updated and the update contains changes to one of
     * the following fields: - instance_filter - os_policies 3) OSPolicyAssignment
     * is deleted. Structure is documented below.
     */
    @JvmName("mshhkovoatmqyech")
    public suspend fun rollout(`value`: Output) {
        this.rollout = value
    }

    /**
     * @param value Set to true to skip awaiting rollout during resource creation and update.
     */
    @JvmName("iusfovkutysjshgq")
    public suspend fun skipAwaitRollout(`value`: Output) {
        this.skipAwaitRollout = value
    }

    /**
     * @param value OS policy assignment description. Length of the description is limited to 1024 characters.
     */
    @JvmName("awmeivpqhclgggby")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Filter to select VMs. Structure is
     * documented below.
     */
    @JvmName("wojtmvwluikwknhv")
    public suspend fun instanceFilter(`value`: OsPolicyAssignmentInstanceFilterArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceFilter = mapped
    }

    /**
     * @param argument Filter to select VMs. Structure is
     * documented below.
     */
    @JvmName("ipykytxnynhwgifr")
    public suspend fun instanceFilter(argument: suspend OsPolicyAssignmentInstanceFilterArgsBuilder.() -> Unit) {
        val toBeMapped = OsPolicyAssignmentInstanceFilterArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.instanceFilter = mapped
    }

    /**
     * @param value The location for the resource
     */
    @JvmName("ogmodecdjkodduds")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Resource name.
     */
    @JvmName("bfmxouacercykiet")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value List of OS policies to be applied to the VMs.
     * Structure is documented below.
     */
    @JvmName("lcnglnrsvwnksodx")
    public suspend fun osPolicies(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.osPolicies = mapped
    }

    /**
     * @param argument List of OS policies to be applied to the VMs.
     * Structure is documented below.
     */
    @JvmName("ssfouswxenvmavuf")
    public suspend fun osPolicies(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            OsPolicyAssignmentOsPolicyArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.osPolicies = mapped
    }

    /**
     * @param argument List of OS policies to be applied to the VMs.
     * Structure is documented below.
     */
    @JvmName("ghuqcgasabqcmkag")
    public suspend fun osPolicies(vararg argument: suspend OsPolicyAssignmentOsPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            OsPolicyAssignmentOsPolicyArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.osPolicies = mapped
    }

    /**
     * @param argument List of OS policies to be applied to the VMs.
     * Structure is documented below.
     */
    @JvmName("kgqsevjvlbfswjbo")
    public suspend fun osPolicies(argument: suspend OsPolicyAssignmentOsPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            OsPolicyAssignmentOsPolicyArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.osPolicies = mapped
    }

    /**
     * @param values List of OS policies to be applied to the VMs.
     * Structure is documented below.
     */
    @JvmName("mtnvbxamkulxwxqi")
    public suspend fun osPolicies(vararg values: OsPolicyAssignmentOsPolicyArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.osPolicies = mapped
    }

    /**
     * @param value The project for the resource
     */
    @JvmName("gicipfednkgdecbx")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Rollout to deploy the OS policy assignment. A rollout
     * is triggered in the following situations: 1) OSPolicyAssignment is created.
     * 2) OSPolicyAssignment is updated and the update contains changes to one of
     * the following fields: - instance_filter - os_policies 3) OSPolicyAssignment
     * is deleted. Structure is documented below.
     */
    @JvmName("pkuvhuncnpwetmha")
    public suspend fun rollout(`value`: OsPolicyAssignmentRolloutArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rollout = mapped
    }

    /**
     * @param argument Rollout to deploy the OS policy assignment. A rollout
     * is triggered in the following situations: 1) OSPolicyAssignment is created.
     * 2) OSPolicyAssignment is updated and the update contains changes to one of
     * the following fields: - instance_filter - os_policies 3) OSPolicyAssignment
     * is deleted. Structure is documented below.
     */
    @JvmName("ogvobfnmaqksinob")
    public suspend fun rollout(argument: suspend OsPolicyAssignmentRolloutArgsBuilder.() -> Unit) {
        val toBeMapped = OsPolicyAssignmentRolloutArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.rollout = mapped
    }

    /**
     * @param value Set to true to skip awaiting rollout during resource creation and update.
     */
    @JvmName("uwmqbvtcletskgdv")
    public suspend fun skipAwaitRollout(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.skipAwaitRollout = mapped
    }

    internal fun build(): OsPolicyAssignmentArgs = OsPolicyAssignmentArgs(
        description = description,
        instanceFilter = instanceFilter,
        location = location,
        name = name,
        osPolicies = osPolicies,
        project = project,
        rollout = rollout,
        skipAwaitRollout = skipAwaitRollout,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy