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.alicloud.oos.kotlin.PatchBaselineArgs.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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.alicloud.oos.kotlin
import com.pulumi.alicloud.oos.PatchBaselineArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Provides a OOS Patch Baseline resource.
* For information about OOS Patch Baseline and how to use it, see [What is Patch Baseline](https://www.alibabacloud.com/help/en/operation-orchestration-service/latest/patch-manager-overview).
* > **NOTE:** Available since v1.146.0.
* ## Example Usage
* Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as alicloud from "@pulumi/alicloud";
* const config = new pulumi.Config();
* const name = config.get("name") || "terraform-example";
* const _default = new alicloud.oos.PatchBaseline("default", {
* patchBaselineName: name,
* operationSystem: "Windows",
* approvalRules: "{\"PatchRules\":[{\"EnableNonSecurity\":true,\"PatchFilterGroup\":[{\"Values\":[\"*\"],\"Key\":\"Product\"},{\"Values\":[\"Security\",\"Bugfix\"],\"Key\":\"Classification\"},{\"Values\":[\"Critical\",\"Important\"],\"Key\":\"Severity\"}],\"ApproveAfterDays\":7,\"ComplianceLevel\":\"Unspecified\"}]}",
* });
* ```
* ```python
* import pulumi
* import pulumi_alicloud as alicloud
* config = pulumi.Config()
* name = config.get("name")
* if name is None:
* name = "terraform-example"
* default = alicloud.oos.PatchBaseline("default",
* patch_baseline_name=name,
* operation_system="Windows",
* approval_rules="{\"PatchRules\":[{\"EnableNonSecurity\":true,\"PatchFilterGroup\":[{\"Values\":[\"*\"],\"Key\":\"Product\"},{\"Values\":[\"Security\",\"Bugfix\"],\"Key\":\"Classification\"},{\"Values\":[\"Critical\",\"Important\"],\"Key\":\"Severity\"}],\"ApproveAfterDays\":7,\"ComplianceLevel\":\"Unspecified\"}]}")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AliCloud = Pulumi.AliCloud;
* return await Deployment.RunAsync(() =>
* {
* var config = new Config();
* var name = config.Get("name") ?? "terraform-example";
* var @default = new AliCloud.Oos.PatchBaseline("default", new()
* {
* PatchBaselineName = name,
* OperationSystem = "Windows",
* ApprovalRules = "{\"PatchRules\":[{\"EnableNonSecurity\":true,\"PatchFilterGroup\":[{\"Values\":[\"*\"],\"Key\":\"Product\"},{\"Values\":[\"Security\",\"Bugfix\"],\"Key\":\"Classification\"},{\"Values\":[\"Critical\",\"Important\"],\"Key\":\"Severity\"}],\"ApproveAfterDays\":7,\"ComplianceLevel\":\"Unspecified\"}]}",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oos"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* cfg := config.New(ctx, "")
* name := "terraform-example"
* if param := cfg.Get("name"); param != "" {
* name = param
* }
* _, err := oos.NewPatchBaseline(ctx, "default", &oos.PatchBaselineArgs{
* PatchBaselineName: pulumi.String(name),
* OperationSystem: pulumi.String("Windows"),
* ApprovalRules: pulumi.String("{\"PatchRules\":[{\"EnableNonSecurity\":true,\"PatchFilterGroup\":[{\"Values\":[\"*\"],\"Key\":\"Product\"},{\"Values\":[\"Security\",\"Bugfix\"],\"Key\":\"Classification\"},{\"Values\":[\"Critical\",\"Important\"],\"Key\":\"Severity\"}],\"ApproveAfterDays\":7,\"ComplianceLevel\":\"Unspecified\"}]}"),
* })
* 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.alicloud.oos.PatchBaseline;
* import com.pulumi.alicloud.oos.PatchBaselineArgs;
* 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) {
* final var config = ctx.config();
* final var name = config.get("name").orElse("terraform-example");
* var default_ = new PatchBaseline("default", PatchBaselineArgs.builder()
* .patchBaselineName(name)
* .operationSystem("Windows")
* .approvalRules("{\"PatchRules\":[{\"EnableNonSecurity\":true,\"PatchFilterGroup\":[{\"Values\":[\"*\"],\"Key\":\"Product\"},{\"Values\":[\"Security\",\"Bugfix\"],\"Key\":\"Classification\"},{\"Values\":[\"Critical\",\"Important\"],\"Key\":\"Severity\"}],\"ApproveAfterDays\":7,\"ComplianceLevel\":\"Unspecified\"}]}")
* .build());
* }
* }
* ```
* ```yaml
* configuration:
* name:
* type: string
* default: terraform-example
* resources:
* default:
* type: alicloud:oos:PatchBaseline
* properties:
* patchBaselineName: ${name}
* operationSystem: Windows
* approvalRules: '{"PatchRules":[{"EnableNonSecurity":true,"PatchFilterGroup":[{"Values":["*"],"Key":"Product"},{"Values":["Security","Bugfix"],"Key":"Classification"},{"Values":["Critical","Important"],"Key":"Severity"}],"ApproveAfterDays":7,"ComplianceLevel":"Unspecified"}]}'
* ```
*
* ## Import
* OOS Patch Baseline can be imported using the id, e.g.
* ```sh
* $ pulumi import alicloud:oos/patchBaseline:PatchBaseline example
* ```
* @property approvalRules Accept the rules. This value follows the json format. For more details, see the description of [ApprovalRules in the Request parameters table for details](https://www.alibabacloud.com/help/zh/operation-orchestration-service/latest/api-oos-2019-06-01-createpatchbaseline).
* @property approvedPatches Approved Patch.
* @property approvedPatchesEnableNonSecurity ApprovedPatchesEnableNonSecurity.
* @property description Patches baseline description information.
* @property operationSystem Operating system type. Valid values: `AliyunLinux`, `Anolis`, `CentOS`, `Debian`, `RedhatEnterpriseLinux`, `Ubuntu`, `Windows`, `AlmaLinux`.
* @property patchBaselineName The name of the patch baseline.
* @property rejectedPatches Reject patches.
* @property rejectedPatchesAction Rejected patches action. Valid values: `ALLOW_AS_DEPENDENCY`, `BLOCK`.
* @property resourceGroupId The ID of the resource group.
* @property sources Source.
* @property tags Label.
*/
public data class PatchBaselineArgs(
public val approvalRules: Output? = null,
public val approvedPatches: Output>? = null,
public val approvedPatchesEnableNonSecurity: Output? = null,
public val description: Output? = null,
public val operationSystem: Output? = null,
public val patchBaselineName: Output? = null,
public val rejectedPatches: Output>? = null,
public val rejectedPatchesAction: Output? = null,
public val resourceGroupId: Output? = null,
public val sources: Output>? = null,
public val tags: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.alicloud.oos.PatchBaselineArgs =
com.pulumi.alicloud.oos.PatchBaselineArgs.builder()
.approvalRules(approvalRules?.applyValue({ args0 -> args0 }))
.approvedPatches(approvedPatches?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.approvedPatchesEnableNonSecurity(approvedPatchesEnableNonSecurity?.applyValue({ args0 -> args0 }))
.description(description?.applyValue({ args0 -> args0 }))
.operationSystem(operationSystem?.applyValue({ args0 -> args0 }))
.patchBaselineName(patchBaselineName?.applyValue({ args0 -> args0 }))
.rejectedPatches(rejectedPatches?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.rejectedPatchesAction(rejectedPatchesAction?.applyValue({ args0 -> args0 }))
.resourceGroupId(resourceGroupId?.applyValue({ args0 -> args0 }))
.sources(sources?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.tags(
tags?.applyValue({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
}),
).build()
}
/**
* Builder for [PatchBaselineArgs].
*/
@PulumiTagMarker
public class PatchBaselineArgsBuilder internal constructor() {
private var approvalRules: Output? = null
private var approvedPatches: Output>? = null
private var approvedPatchesEnableNonSecurity: Output? = null
private var description: Output? = null
private var operationSystem: Output? = null
private var patchBaselineName: Output? = null
private var rejectedPatches: Output>? = null
private var rejectedPatchesAction: Output? = null
private var resourceGroupId: Output? = null
private var sources: Output>? = null
private var tags: Output>? = null
/**
* @param value Accept the rules. This value follows the json format. For more details, see the description of [ApprovalRules in the Request parameters table for details](https://www.alibabacloud.com/help/zh/operation-orchestration-service/latest/api-oos-2019-06-01-createpatchbaseline).
*/
@JvmName("andaxyygrxywmvuh")
public suspend fun approvalRules(`value`: Output) {
this.approvalRules = value
}
/**
* @param value Approved Patch.
*/
@JvmName("ihrnqmpxavvcyebh")
public suspend fun approvedPatches(`value`: Output>) {
this.approvedPatches = value
}
@JvmName("asipajdthmnrbjnr")
public suspend fun approvedPatches(vararg values: Output) {
this.approvedPatches = Output.all(values.asList())
}
/**
* @param values Approved Patch.
*/
@JvmName("hkuocavkxjhxyxwb")
public suspend fun approvedPatches(values: List>) {
this.approvedPatches = Output.all(values)
}
/**
* @param value ApprovedPatchesEnableNonSecurity.
*/
@JvmName("sitnljxpgtllsmrd")
public suspend fun approvedPatchesEnableNonSecurity(`value`: Output) {
this.approvedPatchesEnableNonSecurity = value
}
/**
* @param value Patches baseline description information.
*/
@JvmName("fmlmohlsfwmfsios")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value Operating system type. Valid values: `AliyunLinux`, `Anolis`, `CentOS`, `Debian`, `RedhatEnterpriseLinux`, `Ubuntu`, `Windows`, `AlmaLinux`.
*/
@JvmName("mnaqeyxtxsyuhlcy")
public suspend fun operationSystem(`value`: Output) {
this.operationSystem = value
}
/**
* @param value The name of the patch baseline.
*/
@JvmName("mxeoveliiqubvmlv")
public suspend fun patchBaselineName(`value`: Output) {
this.patchBaselineName = value
}
/**
* @param value Reject patches.
*/
@JvmName("csbbwrkylyhulpfr")
public suspend fun rejectedPatches(`value`: Output>) {
this.rejectedPatches = value
}
@JvmName("vmhkwvdnfcsopiji")
public suspend fun rejectedPatches(vararg values: Output) {
this.rejectedPatches = Output.all(values.asList())
}
/**
* @param values Reject patches.
*/
@JvmName("sgpiafmjcvkxemda")
public suspend fun rejectedPatches(values: List>) {
this.rejectedPatches = Output.all(values)
}
/**
* @param value Rejected patches action. Valid values: `ALLOW_AS_DEPENDENCY`, `BLOCK`.
*/
@JvmName("sdmbotdkaquoinbv")
public suspend fun rejectedPatchesAction(`value`: Output) {
this.rejectedPatchesAction = value
}
/**
* @param value The ID of the resource group.
*/
@JvmName("balvsrjxbqlbfyfj")
public suspend fun resourceGroupId(`value`: Output) {
this.resourceGroupId = value
}
/**
* @param value Source.
*/
@JvmName("dnxdsdxmplmfvjim")
public suspend fun sources(`value`: Output>) {
this.sources = value
}
@JvmName("mhitnnupppicbyyk")
public suspend fun sources(vararg values: Output) {
this.sources = Output.all(values.asList())
}
/**
* @param values Source.
*/
@JvmName("cvcfkpoyltleqakg")
public suspend fun sources(values: List>) {
this.sources = Output.all(values)
}
/**
* @param value Label.
*/
@JvmName("efaqbgcdkefusnhe")
public suspend fun tags(`value`: Output>) {
this.tags = value
}
/**
* @param value Accept the rules. This value follows the json format. For more details, see the description of [ApprovalRules in the Request parameters table for details](https://www.alibabacloud.com/help/zh/operation-orchestration-service/latest/api-oos-2019-06-01-createpatchbaseline).
*/
@JvmName("oqeipknmytwmytwl")
public suspend fun approvalRules(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.approvalRules = mapped
}
/**
* @param value Approved Patch.
*/
@JvmName("rembmvkamuhiueus")
public suspend fun approvedPatches(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.approvedPatches = mapped
}
/**
* @param values Approved Patch.
*/
@JvmName("jfqcrjyxhngpfupf")
public suspend fun approvedPatches(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.approvedPatches = mapped
}
/**
* @param value ApprovedPatchesEnableNonSecurity.
*/
@JvmName("syllyftqoixqhwse")
public suspend fun approvedPatchesEnableNonSecurity(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.approvedPatchesEnableNonSecurity = mapped
}
/**
* @param value Patches baseline description information.
*/
@JvmName("hjxlnbvuseiwjgbe")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value Operating system type. Valid values: `AliyunLinux`, `Anolis`, `CentOS`, `Debian`, `RedhatEnterpriseLinux`, `Ubuntu`, `Windows`, `AlmaLinux`.
*/
@JvmName("obfnabwmchsatmbq")
public suspend fun operationSystem(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.operationSystem = mapped
}
/**
* @param value The name of the patch baseline.
*/
@JvmName("quqjyxvadkrwkpgh")
public suspend fun patchBaselineName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.patchBaselineName = mapped
}
/**
* @param value Reject patches.
*/
@JvmName("dkoatxxqwwoialch")
public suspend fun rejectedPatches(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.rejectedPatches = mapped
}
/**
* @param values Reject patches.
*/
@JvmName("ubmnybpbskuagxhi")
public suspend fun rejectedPatches(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.rejectedPatches = mapped
}
/**
* @param value Rejected patches action. Valid values: `ALLOW_AS_DEPENDENCY`, `BLOCK`.
*/
@JvmName("xkdiacbglshjdfdp")
public suspend fun rejectedPatchesAction(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.rejectedPatchesAction = mapped
}
/**
* @param value The ID of the resource group.
*/
@JvmName("aylkwkhuegycbido")
public suspend fun resourceGroupId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupId = mapped
}
/**
* @param value Source.
*/
@JvmName("jdtirlrgidvuighr")
public suspend fun sources(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sources = mapped
}
/**
* @param values Source.
*/
@JvmName("ckxgrfvdpurhpvgb")
public suspend fun sources(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.sources = mapped
}
/**
* @param value Label.
*/
@JvmName("kjpppuabkkdjvjbc")
public suspend fun tags(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.tags = mapped
}
/**
* @param values Label.
*/
@JvmName("wdvsrfpjhdduqfyy")
public fun tags(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.tags = mapped
}
internal fun build(): PatchBaselineArgs = PatchBaselineArgs(
approvalRules = approvalRules,
approvedPatches = approvedPatches,
approvedPatchesEnableNonSecurity = approvedPatchesEnableNonSecurity,
description = description,
operationSystem = operationSystem,
patchBaselineName = patchBaselineName,
rejectedPatches = rejectedPatches,
rejectedPatchesAction = rejectedPatchesAction,
resourceGroupId = resourceGroupId,
sources = sources,
tags = tags,
)
}