1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. oos
  5. PatchBaseline
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.oos.PatchBaseline

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    Provides a OOS Patch Baseline resource.

    For information about OOS Patch Baseline and how to use it, see What is Patch Baseline.

    NOTE: Available since v1.146.0.

    Example Usage

    Basic Usage

    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: JSON.stringify({
            PatchRules: [{
                EnableNonSecurity: true,
                PatchFilterGroup: [
                    {
                        Values: ["*"],
                        Key: "Product",
                    },
                    {
                        Values: [
                            "Security",
                            "Bugfix",
                        ],
                        Key: "Classification",
                    },
                    {
                        Values: [
                            "Critical",
                            "Important",
                        ],
                        Key: "Severity",
                    },
                ],
                ApproveAfterDays: 7,
                ComplianceLevel: "Unspecified",
            }],
        }),
    });
    
    import pulumi
    import json
    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=json.dumps({
            "PatchRules": [{
                "EnableNonSecurity": True,
                "PatchFilterGroup": [
                    {
                        "Values": ["*"],
                        "Key": "Product",
                    },
                    {
                        "Values": [
                            "Security",
                            "Bugfix",
                        ],
                        "Key": "Classification",
                    },
                    {
                        "Values": [
                            "Critical",
                            "Important",
                        ],
                        "Key": "Severity",
                    },
                ],
                "ApproveAfterDays": 7,
                "ComplianceLevel": "Unspecified",
            }],
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"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
    		}
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"PatchRules": []map[string]interface{}{
    				map[string]interface{}{
    					"EnableNonSecurity": true,
    					"PatchFilterGroup": []map[string]interface{}{
    						map[string]interface{}{
    							"Values": []string{
    								"*",
    							},
    							"Key": "Product",
    						},
    						map[string]interface{}{
    							"Values": []string{
    								"Security",
    								"Bugfix",
    							},
    							"Key": "Classification",
    						},
    						map[string]interface{}{
    							"Values": []string{
    								"Critical",
    								"Important",
    							},
    							"Key": "Severity",
    						},
    					},
    					"ApproveAfterDays": 7,
    					"ComplianceLevel":  "Unspecified",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = oos.NewPatchBaseline(ctx, "default", &oos.PatchBaselineArgs{
    			PatchBaselineName: pulumi.String(name),
    			OperationSystem:   pulumi.String("Windows"),
    			ApprovalRules:     pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    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 = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["PatchRules"] = new[]
                {
                    new Dictionary<string, object?>
                    {
                        ["EnableNonSecurity"] = true,
                        ["PatchFilterGroup"] = new[]
                        {
                            new Dictionary<string, object?>
                            {
                                ["Values"] = new[]
                                {
                                    "*",
                                },
                                ["Key"] = "Product",
                            },
                            new Dictionary<string, object?>
                            {
                                ["Values"] = new[]
                                {
                                    "Security",
                                    "Bugfix",
                                },
                                ["Key"] = "Classification",
                            },
                            new Dictionary<string, object?>
                            {
                                ["Values"] = new[]
                                {
                                    "Critical",
                                    "Important",
                                },
                                ["Key"] = "Severity",
                            },
                        },
                        ["ApproveAfterDays"] = 7,
                        ["ComplianceLevel"] = "Unspecified",
                    },
                },
            }),
        });
    
    });
    
    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 static com.pulumi.codegen.internal.Serialization.*;
    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(serializeJson(
                    jsonObject(
                        jsonProperty("PatchRules", jsonArray(jsonObject(
                            jsonProperty("EnableNonSecurity", true),
                            jsonProperty("PatchFilterGroup", jsonArray(
                                jsonObject(
                                    jsonProperty("Values", jsonArray("*")),
                                    jsonProperty("Key", "Product")
                                ), 
                                jsonObject(
                                    jsonProperty("Values", jsonArray(
                                        "Security", 
                                        "Bugfix"
                                    )),
                                    jsonProperty("Key", "Classification")
                                ), 
                                jsonObject(
                                    jsonProperty("Values", jsonArray(
                                        "Critical", 
                                        "Important"
                                    )),
                                    jsonProperty("Key", "Severity")
                                )
                            )),
                            jsonProperty("ApproveAfterDays", 7),
                            jsonProperty("ComplianceLevel", "Unspecified")
                        )))
                    )))
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:oos:PatchBaseline
        properties:
          patchBaselineName: ${name}
          operationSystem: Windows
          approvalRules:
            fn::toJSON:
              PatchRules:
                - EnableNonSecurity: true
                  PatchFilterGroup:
                    - Values:
                        - '*'
                      Key: Product
                    - Values:
                        - Security
                        - Bugfix
                      Key: Classification
                    - Values:
                        - Critical
                        - Important
                      Key: Severity
                  ApproveAfterDays: 7
                  ComplianceLevel: Unspecified
    

    Create PatchBaseline Resource

    new PatchBaseline(name: string, args: PatchBaselineArgs, opts?: CustomResourceOptions);
    @overload
    def PatchBaseline(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      approval_rules: Optional[str] = None,
                      approved_patches: Optional[Sequence[str]] = None,
                      approved_patches_enable_non_security: Optional[bool] = None,
                      description: Optional[str] = None,
                      operation_system: Optional[str] = None,
                      patch_baseline_name: Optional[str] = None,
                      rejected_patches: Optional[Sequence[str]] = None,
                      rejected_patches_action: Optional[str] = None,
                      resource_group_id: Optional[str] = None,
                      sources: Optional[Sequence[str]] = None,
                      tags: Optional[Mapping[str, Any]] = None)
    @overload
    def PatchBaseline(resource_name: str,
                      args: PatchBaselineArgs,
                      opts: Optional[ResourceOptions] = None)
    func NewPatchBaseline(ctx *Context, name string, args PatchBaselineArgs, opts ...ResourceOption) (*PatchBaseline, error)
    public PatchBaseline(string name, PatchBaselineArgs args, CustomResourceOptions? opts = null)
    public PatchBaseline(String name, PatchBaselineArgs args)
    public PatchBaseline(String name, PatchBaselineArgs args, CustomResourceOptions options)
    
    type: alicloud:oos:PatchBaseline
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args PatchBaselineArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PatchBaselineArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PatchBaselineArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PatchBaselineArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PatchBaselineArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    PatchBaseline Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The PatchBaseline resource accepts the following input properties:

    ApprovalRules string
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    OperationSystem string
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    PatchBaselineName string
    The name of the patch baseline.
    ApprovedPatches List<string>
    Approved Patch.
    ApprovedPatchesEnableNonSecurity bool
    ApprovedPatchesEnableNonSecurity.
    Description string
    Patches baseline description information.
    RejectedPatches List<string>
    Reject patches.
    RejectedPatchesAction string
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    ResourceGroupId string
    The ID of the resource group.
    Sources List<string>
    Source.
    Tags Dictionary<string, object>
    Label.
    ApprovalRules string
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    OperationSystem string
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    PatchBaselineName string
    The name of the patch baseline.
    ApprovedPatches []string
    Approved Patch.
    ApprovedPatchesEnableNonSecurity bool
    ApprovedPatchesEnableNonSecurity.
    Description string
    Patches baseline description information.
    RejectedPatches []string
    Reject patches.
    RejectedPatchesAction string
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    ResourceGroupId string
    The ID of the resource group.
    Sources []string
    Source.
    Tags map[string]interface{}
    Label.
    approvalRules String
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    operationSystem String
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    patchBaselineName String
    The name of the patch baseline.
    approvedPatches List<String>
    Approved Patch.
    approvedPatchesEnableNonSecurity Boolean
    ApprovedPatchesEnableNonSecurity.
    description String
    Patches baseline description information.
    rejectedPatches List<String>
    Reject patches.
    rejectedPatchesAction String
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    resourceGroupId String
    The ID of the resource group.
    sources List<String>
    Source.
    tags Map<String,Object>
    Label.
    approvalRules string
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    operationSystem string
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    patchBaselineName string
    The name of the patch baseline.
    approvedPatches string[]
    Approved Patch.
    approvedPatchesEnableNonSecurity boolean
    ApprovedPatchesEnableNonSecurity.
    description string
    Patches baseline description information.
    rejectedPatches string[]
    Reject patches.
    rejectedPatchesAction string
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    resourceGroupId string
    The ID of the resource group.
    sources string[]
    Source.
    tags {[key: string]: any}
    Label.
    approval_rules str
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    operation_system str
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    patch_baseline_name str
    The name of the patch baseline.
    approved_patches Sequence[str]
    Approved Patch.
    approved_patches_enable_non_security bool
    ApprovedPatchesEnableNonSecurity.
    description str
    Patches baseline description information.
    rejected_patches Sequence[str]
    Reject patches.
    rejected_patches_action str
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    resource_group_id str
    The ID of the resource group.
    sources Sequence[str]
    Source.
    tags Mapping[str, Any]
    Label.
    approvalRules String
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    operationSystem String
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    patchBaselineName String
    The name of the patch baseline.
    approvedPatches List<String>
    Approved Patch.
    approvedPatchesEnableNonSecurity Boolean
    ApprovedPatchesEnableNonSecurity.
    description String
    Patches baseline description information.
    rejectedPatches List<String>
    Reject patches.
    rejectedPatchesAction String
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    resourceGroupId String
    The ID of the resource group.
    sources List<String>
    Source.
    tags Map<Any>
    Label.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PatchBaseline resource produces the following output properties:

    CreateTime string
    Creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    CreateTime string
    Creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    createTime String
    Creation time.
    id String
    The provider-assigned unique ID for this managed resource.
    createTime string
    Creation time.
    id string
    The provider-assigned unique ID for this managed resource.
    create_time str
    Creation time.
    id str
    The provider-assigned unique ID for this managed resource.
    createTime String
    Creation time.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PatchBaseline Resource

    Get an existing PatchBaseline resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: PatchBaselineState, opts?: CustomResourceOptions): PatchBaseline
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            approval_rules: Optional[str] = None,
            approved_patches: Optional[Sequence[str]] = None,
            approved_patches_enable_non_security: Optional[bool] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            operation_system: Optional[str] = None,
            patch_baseline_name: Optional[str] = None,
            rejected_patches: Optional[Sequence[str]] = None,
            rejected_patches_action: Optional[str] = None,
            resource_group_id: Optional[str] = None,
            sources: Optional[Sequence[str]] = None,
            tags: Optional[Mapping[str, Any]] = None) -> PatchBaseline
    func GetPatchBaseline(ctx *Context, name string, id IDInput, state *PatchBaselineState, opts ...ResourceOption) (*PatchBaseline, error)
    public static PatchBaseline Get(string name, Input<string> id, PatchBaselineState? state, CustomResourceOptions? opts = null)
    public static PatchBaseline get(String name, Output<String> id, PatchBaselineState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ApprovalRules string
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    ApprovedPatches List<string>
    Approved Patch.
    ApprovedPatchesEnableNonSecurity bool
    ApprovedPatchesEnableNonSecurity.
    CreateTime string
    Creation time.
    Description string
    Patches baseline description information.
    OperationSystem string
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    PatchBaselineName string
    The name of the patch baseline.
    RejectedPatches List<string>
    Reject patches.
    RejectedPatchesAction string
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    ResourceGroupId string
    The ID of the resource group.
    Sources List<string>
    Source.
    Tags Dictionary<string, object>
    Label.
    ApprovalRules string
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    ApprovedPatches []string
    Approved Patch.
    ApprovedPatchesEnableNonSecurity bool
    ApprovedPatchesEnableNonSecurity.
    CreateTime string
    Creation time.
    Description string
    Patches baseline description information.
    OperationSystem string
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    PatchBaselineName string
    The name of the patch baseline.
    RejectedPatches []string
    Reject patches.
    RejectedPatchesAction string
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    ResourceGroupId string
    The ID of the resource group.
    Sources []string
    Source.
    Tags map[string]interface{}
    Label.
    approvalRules String
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    approvedPatches List<String>
    Approved Patch.
    approvedPatchesEnableNonSecurity Boolean
    ApprovedPatchesEnableNonSecurity.
    createTime String
    Creation time.
    description String
    Patches baseline description information.
    operationSystem String
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    patchBaselineName String
    The name of the patch baseline.
    rejectedPatches List<String>
    Reject patches.
    rejectedPatchesAction String
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    resourceGroupId String
    The ID of the resource group.
    sources List<String>
    Source.
    tags Map<String,Object>
    Label.
    approvalRules string
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    approvedPatches string[]
    Approved Patch.
    approvedPatchesEnableNonSecurity boolean
    ApprovedPatchesEnableNonSecurity.
    createTime string
    Creation time.
    description string
    Patches baseline description information.
    operationSystem string
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    patchBaselineName string
    The name of the patch baseline.
    rejectedPatches string[]
    Reject patches.
    rejectedPatchesAction string
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    resourceGroupId string
    The ID of the resource group.
    sources string[]
    Source.
    tags {[key: string]: any}
    Label.
    approval_rules str
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    approved_patches Sequence[str]
    Approved Patch.
    approved_patches_enable_non_security bool
    ApprovedPatchesEnableNonSecurity.
    create_time str
    Creation time.
    description str
    Patches baseline description information.
    operation_system str
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    patch_baseline_name str
    The name of the patch baseline.
    rejected_patches Sequence[str]
    Reject patches.
    rejected_patches_action str
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    resource_group_id str
    The ID of the resource group.
    sources Sequence[str]
    Source.
    tags Mapping[str, Any]
    Label.
    approvalRules String
    Accept the rules. This value follows the json format. For more details, see the description of ApprovalRules in the Request parameters table for details.
    approvedPatches List<String>
    Approved Patch.
    approvedPatchesEnableNonSecurity Boolean
    ApprovedPatchesEnableNonSecurity.
    createTime String
    Creation time.
    description String
    Patches baseline description information.
    operationSystem String
    Operating system type. Valid values: AliyunLinux, Anolis, CentOS, Debian, RedhatEnterpriseLinux, Ubuntu, Windows, AlmaLinux.
    patchBaselineName String
    The name of the patch baseline.
    rejectedPatches List<String>
    Reject patches.
    rejectedPatchesAction String
    Rejected patches action. Valid values: ALLOW_AS_DEPENDENCY, BLOCK.
    resourceGroupId String
    The ID of the resource group.
    sources List<String>
    Source.
    tags Map<Any>
    Label.

    Import

    OOS Patch Baseline can be imported using the id, e.g.

    $ pulumi import alicloud:oos/patchBaseline:PatchBaseline example <id>
    

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi