alicloud logo
Alibaba Cloud v3.38.0, Jun 2 23

alicloud.oos.DefaultPatchBaseline

Explore with Pulumi AI

Provides a Oos Default Patch Baseline resource.

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

NOTE: Available in v1.203.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultPatchBaseline = new AliCloud.Oos.PatchBaseline("defaultPatchBaseline", new()
    {
        OperationSystem = "Windows",
        PatchBaselineName = "terraform-example",
        Description = "terraform-example",
        ApprovalRules = "{\"PatchRules\":[{\"PatchFilterGroup\":[{\"Key\":\"PatchSet\",\"Values\":[\"OS\"]},{\"Key\":\"ProductFamily\",\"Values\":[\"Windows\"]},{\"Key\":\"Product\",\"Values\":[\"Windows 10\",\"Windows 7\"]},{\"Key\":\"Classification\",\"Values\":[\"Security Updates\",\"Updates\",\"Update Rollups\",\"Critical Updates\"]},{\"Key\":\"Severity\",\"Values\":[\"Critical\",\"Important\",\"Moderate\"]}],\"ApproveAfterDays\":7,\"EnableNonSecurity\":true,\"ComplianceLevel\":\"Medium\"}]}",
    });

    var defaultDefaultPatchBaseline = new AliCloud.Oos.DefaultPatchBaseline("defaultDefaultPatchBaseline", new()
    {
        PatchBaselineName = defaultPatchBaseline.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oos"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultPatchBaseline, err := oos.NewPatchBaseline(ctx, "defaultPatchBaseline", &oos.PatchBaselineArgs{
			OperationSystem:   pulumi.String("Windows"),
			PatchBaselineName: pulumi.String("terraform-example"),
			Description:       pulumi.String("terraform-example"),
			ApprovalRules:     pulumi.String("{\"PatchRules\":[{\"PatchFilterGroup\":[{\"Key\":\"PatchSet\",\"Values\":[\"OS\"]},{\"Key\":\"ProductFamily\",\"Values\":[\"Windows\"]},{\"Key\":\"Product\",\"Values\":[\"Windows 10\",\"Windows 7\"]},{\"Key\":\"Classification\",\"Values\":[\"Security Updates\",\"Updates\",\"Update Rollups\",\"Critical Updates\"]},{\"Key\":\"Severity\",\"Values\":[\"Critical\",\"Important\",\"Moderate\"]}],\"ApproveAfterDays\":7,\"EnableNonSecurity\":true,\"ComplianceLevel\":\"Medium\"}]}"),
		})
		if err != nil {
			return err
		}
		_, err = oos.NewDefaultPatchBaseline(ctx, "defaultDefaultPatchBaseline", &oos.DefaultPatchBaselineArgs{
			PatchBaselineName: defaultPatchBaseline.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 com.pulumi.alicloud.oos.DefaultPatchBaseline;
import com.pulumi.alicloud.oos.DefaultPatchBaselineArgs;
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 defaultPatchBaseline = new PatchBaseline("defaultPatchBaseline", PatchBaselineArgs.builder()        
            .operationSystem("Windows")
            .patchBaselineName("terraform-example")
            .description("terraform-example")
            .approvalRules("{\"PatchRules\":[{\"PatchFilterGroup\":[{\"Key\":\"PatchSet\",\"Values\":[\"OS\"]},{\"Key\":\"ProductFamily\",\"Values\":[\"Windows\"]},{\"Key\":\"Product\",\"Values\":[\"Windows 10\",\"Windows 7\"]},{\"Key\":\"Classification\",\"Values\":[\"Security Updates\",\"Updates\",\"Update Rollups\",\"Critical Updates\"]},{\"Key\":\"Severity\",\"Values\":[\"Critical\",\"Important\",\"Moderate\"]}],\"ApproveAfterDays\":7,\"EnableNonSecurity\":true,\"ComplianceLevel\":\"Medium\"}]}")
            .build());

        var defaultDefaultPatchBaseline = new DefaultPatchBaseline("defaultDefaultPatchBaseline", DefaultPatchBaselineArgs.builder()        
            .patchBaselineName(defaultPatchBaseline.id())
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_patch_baseline = alicloud.oos.PatchBaseline("defaultPatchBaseline",
    operation_system="Windows",
    patch_baseline_name="terraform-example",
    description="terraform-example",
    approval_rules="{\"PatchRules\":[{\"PatchFilterGroup\":[{\"Key\":\"PatchSet\",\"Values\":[\"OS\"]},{\"Key\":\"ProductFamily\",\"Values\":[\"Windows\"]},{\"Key\":\"Product\",\"Values\":[\"Windows 10\",\"Windows 7\"]},{\"Key\":\"Classification\",\"Values\":[\"Security Updates\",\"Updates\",\"Update Rollups\",\"Critical Updates\"]},{\"Key\":\"Severity\",\"Values\":[\"Critical\",\"Important\",\"Moderate\"]}],\"ApproveAfterDays\":7,\"EnableNonSecurity\":true,\"ComplianceLevel\":\"Medium\"}]}")
default_default_patch_baseline = alicloud.oos.DefaultPatchBaseline("defaultDefaultPatchBaseline", patch_baseline_name=default_patch_baseline.id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultPatchBaseline = new alicloud.oos.PatchBaseline("defaultPatchBaseline", {
    operationSystem: "Windows",
    patchBaselineName: "terraform-example",
    description: "terraform-example",
    approvalRules: "{\"PatchRules\":[{\"PatchFilterGroup\":[{\"Key\":\"PatchSet\",\"Values\":[\"OS\"]},{\"Key\":\"ProductFamily\",\"Values\":[\"Windows\"]},{\"Key\":\"Product\",\"Values\":[\"Windows 10\",\"Windows 7\"]},{\"Key\":\"Classification\",\"Values\":[\"Security Updates\",\"Updates\",\"Update Rollups\",\"Critical Updates\"]},{\"Key\":\"Severity\",\"Values\":[\"Critical\",\"Important\",\"Moderate\"]}],\"ApproveAfterDays\":7,\"EnableNonSecurity\":true,\"ComplianceLevel\":\"Medium\"}]}",
});
const defaultDefaultPatchBaseline = new alicloud.oos.DefaultPatchBaseline("defaultDefaultPatchBaseline", {patchBaselineName: defaultPatchBaseline.id});
resources:
  defaultPatchBaseline:
    type: alicloud:oos:PatchBaseline
    properties:
      operationSystem: Windows
      patchBaselineName: terraform-example
      description: terraform-example
      approvalRules: '{"PatchRules":[{"PatchFilterGroup":[{"Key":"PatchSet","Values":["OS"]},{"Key":"ProductFamily","Values":["Windows"]},{"Key":"Product","Values":["Windows 10","Windows 7"]},{"Key":"Classification","Values":["Security Updates","Updates","Update Rollups","Critical Updates"]},{"Key":"Severity","Values":["Critical","Important","Moderate"]}],"ApproveAfterDays":7,"EnableNonSecurity":true,"ComplianceLevel":"Medium"}]}'
  defaultDefaultPatchBaseline:
    type: alicloud:oos:DefaultPatchBaseline
    properties:
      patchBaselineName: ${defaultPatchBaseline.id}

Create DefaultPatchBaseline Resource

new DefaultPatchBaseline(name: string, args: DefaultPatchBaselineArgs, opts?: CustomResourceOptions);
@overload
def DefaultPatchBaseline(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         patch_baseline_name: Optional[str] = None)
@overload
def DefaultPatchBaseline(resource_name: str,
                         args: DefaultPatchBaselineArgs,
                         opts: Optional[ResourceOptions] = None)
func NewDefaultPatchBaseline(ctx *Context, name string, args DefaultPatchBaselineArgs, opts ...ResourceOption) (*DefaultPatchBaseline, error)
public DefaultPatchBaseline(string name, DefaultPatchBaselineArgs args, CustomResourceOptions? opts = null)
public DefaultPatchBaseline(String name, DefaultPatchBaselineArgs args)
public DefaultPatchBaseline(String name, DefaultPatchBaselineArgs args, CustomResourceOptions options)
type: alicloud:oos:DefaultPatchBaseline
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DefaultPatchBaselineArgs
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 DefaultPatchBaselineArgs
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 DefaultPatchBaselineArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DefaultPatchBaselineArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DefaultPatchBaselineArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

DefaultPatchBaseline 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 DefaultPatchBaseline resource accepts the following input properties:

PatchBaselineName string

The name of the patch baseline.

PatchBaselineName string

The name of the patch baseline.

patchBaselineName String

The name of the patch baseline.

patchBaselineName string

The name of the patch baseline.

patch_baseline_name str

The name of the patch baseline.

patchBaselineName String

The name of the patch baseline.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

PatchBaselineId string

The ID of the patch baseline.

Id string

The provider-assigned unique ID for this managed resource.

PatchBaselineId string

The ID of the patch baseline.

id String

The provider-assigned unique ID for this managed resource.

patchBaselineId String

The ID of the patch baseline.

id string

The provider-assigned unique ID for this managed resource.

patchBaselineId string

The ID of the patch baseline.

id str

The provider-assigned unique ID for this managed resource.

patch_baseline_id str

The ID of the patch baseline.

id String

The provider-assigned unique ID for this managed resource.

patchBaselineId String

The ID of the patch baseline.

Look up Existing DefaultPatchBaseline Resource

Get an existing DefaultPatchBaseline 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?: DefaultPatchBaselineState, opts?: CustomResourceOptions): DefaultPatchBaseline
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        patch_baseline_id: Optional[str] = None,
        patch_baseline_name: Optional[str] = None) -> DefaultPatchBaseline
func GetDefaultPatchBaseline(ctx *Context, name string, id IDInput, state *DefaultPatchBaselineState, opts ...ResourceOption) (*DefaultPatchBaseline, error)
public static DefaultPatchBaseline Get(string name, Input<string> id, DefaultPatchBaselineState? state, CustomResourceOptions? opts = null)
public static DefaultPatchBaseline get(String name, Output<String> id, DefaultPatchBaselineState 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:
PatchBaselineId string

The ID of the patch baseline.

PatchBaselineName string

The name of the patch baseline.

PatchBaselineId string

The ID of the patch baseline.

PatchBaselineName string

The name of the patch baseline.

patchBaselineId String

The ID of the patch baseline.

patchBaselineName String

The name of the patch baseline.

patchBaselineId string

The ID of the patch baseline.

patchBaselineName string

The name of the patch baseline.

patch_baseline_id str

The ID of the patch baseline.

patch_baseline_name str

The name of the patch baseline.

patchBaselineId String

The ID of the patch baseline.

patchBaselineName String

The name of the patch baseline.

Import

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

 $ pulumi import alicloud:oos/defaultPatchBaseline:DefaultPatchBaseline 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.