alicloud.oos.PatchBaseline
Explore with Pulumi AI
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: "{\"PatchRules\":[{\"EnableNonSecurity\":true,\"PatchFilterGroup\":[{\"Values\":[\"*\"],\"Key\":\"Product\"},{\"Values\":[\"Security\",\"Bugfix\"],\"Key\":\"Classification\"},{\"Values\":[\"Critical\",\"Important\"],\"Key\":\"Severity\"}],\"ApproveAfterDays\":7,\"ComplianceLevel\":\"Unspecified\"}]}",
});
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\"}]}")
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
})
}
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\"}]}",
});
});
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());
}
}
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"}]}'
Create PatchBaseline Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PatchBaseline(name: string, args: PatchBaselineArgs, opts?: CustomResourceOptions);
@overload
def PatchBaseline(resource_name: str,
args: PatchBaselineArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PatchBaseline(resource_name: str,
opts: Optional[ResourceOptions] = None,
approval_rules: Optional[str] = None,
operation_system: Optional[str] = None,
patch_baseline_name: Optional[str] = None,
approved_patches: Optional[Sequence[str]] = None,
approved_patches_enable_non_security: Optional[bool] = None,
description: 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, str]] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var patchBaselineResource = new AliCloud.Oos.PatchBaseline("patchBaselineResource", new()
{
ApprovalRules = "string",
OperationSystem = "string",
PatchBaselineName = "string",
ApprovedPatches = new[]
{
"string",
},
ApprovedPatchesEnableNonSecurity = false,
Description = "string",
RejectedPatches = new[]
{
"string",
},
RejectedPatchesAction = "string",
ResourceGroupId = "string",
Sources = new[]
{
"string",
},
Tags =
{
{ "string", "string" },
},
});
example, err := oos.NewPatchBaseline(ctx, "patchBaselineResource", &oos.PatchBaselineArgs{
ApprovalRules: pulumi.String("string"),
OperationSystem: pulumi.String("string"),
PatchBaselineName: pulumi.String("string"),
ApprovedPatches: pulumi.StringArray{
pulumi.String("string"),
},
ApprovedPatchesEnableNonSecurity: pulumi.Bool(false),
Description: pulumi.String("string"),
RejectedPatches: pulumi.StringArray{
pulumi.String("string"),
},
RejectedPatchesAction: pulumi.String("string"),
ResourceGroupId: pulumi.String("string"),
Sources: pulumi.StringArray{
pulumi.String("string"),
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var patchBaselineResource = new PatchBaseline("patchBaselineResource", PatchBaselineArgs.builder()
.approvalRules("string")
.operationSystem("string")
.patchBaselineName("string")
.approvedPatches("string")
.approvedPatchesEnableNonSecurity(false)
.description("string")
.rejectedPatches("string")
.rejectedPatchesAction("string")
.resourceGroupId("string")
.sources("string")
.tags(Map.of("string", "string"))
.build());
patch_baseline_resource = alicloud.oos.PatchBaseline("patchBaselineResource",
approval_rules="string",
operation_system="string",
patch_baseline_name="string",
approved_patches=["string"],
approved_patches_enable_non_security=False,
description="string",
rejected_patches=["string"],
rejected_patches_action="string",
resource_group_id="string",
sources=["string"],
tags={
"string": "string",
})
const patchBaselineResource = new alicloud.oos.PatchBaseline("patchBaselineResource", {
approvalRules: "string",
operationSystem: "string",
patchBaselineName: "string",
approvedPatches: ["string"],
approvedPatchesEnableNonSecurity: false,
description: "string",
rejectedPatches: ["string"],
rejectedPatchesAction: "string",
resourceGroupId: "string",
sources: ["string"],
tags: {
string: "string",
},
});
type: alicloud:oos:PatchBaseline
properties:
approvalRules: string
approvedPatches:
- string
approvedPatchesEnableNonSecurity: false
description: string
operationSystem: string
patchBaselineName: string
rejectedPatches:
- string
rejectedPatchesAction: string
resourceGroupId: string
sources:
- string
tags:
string: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The PatchBaseline resource accepts the following input properties:
- Approval
Rules 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.
- Operation
System string - Operating system type. Valid values:
AliyunLinux
,Anolis
,CentOS
,Debian
,RedhatEnterpriseLinux
,Ubuntu
,Windows
,AlmaLinux
. - Patch
Baseline stringName - The name of the patch baseline.
- Approved
Patches List<string> - Approved Patch.
- Approved
Patches boolEnable Non Security - ApprovedPatchesEnableNonSecurity.
- Description string
- Patches baseline description information.
- Rejected
Patches List<string> - Reject patches.
- Rejected
Patches stringAction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - Resource
Group stringId - The ID of the resource group.
- Sources List<string>
- Source.
- Dictionary<string, string>
- Label.
- Approval
Rules 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.
- Operation
System string - Operating system type. Valid values:
AliyunLinux
,Anolis
,CentOS
,Debian
,RedhatEnterpriseLinux
,Ubuntu
,Windows
,AlmaLinux
. - Patch
Baseline stringName - The name of the patch baseline.
- Approved
Patches []string - Approved Patch.
- Approved
Patches boolEnable Non Security - ApprovedPatchesEnableNonSecurity.
- Description string
- Patches baseline description information.
- Rejected
Patches []string - Reject patches.
- Rejected
Patches stringAction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - Resource
Group stringId - The ID of the resource group.
- Sources []string
- Source.
- map[string]string
- Label.
- approval
Rules 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.
- operation
System String - Operating system type. Valid values:
AliyunLinux
,Anolis
,CentOS
,Debian
,RedhatEnterpriseLinux
,Ubuntu
,Windows
,AlmaLinux
. - patch
Baseline StringName - The name of the patch baseline.
- approved
Patches List<String> - Approved Patch.
- approved
Patches BooleanEnable Non Security - ApprovedPatchesEnableNonSecurity.
- description String
- Patches baseline description information.
- rejected
Patches List<String> - Reject patches.
- rejected
Patches StringAction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - resource
Group StringId - The ID of the resource group.
- sources List<String>
- Source.
- Map<String,String>
- Label.
- approval
Rules 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.
- operation
System string - Operating system type. Valid values:
AliyunLinux
,Anolis
,CentOS
,Debian
,RedhatEnterpriseLinux
,Ubuntu
,Windows
,AlmaLinux
. - patch
Baseline stringName - The name of the patch baseline.
- approved
Patches string[] - Approved Patch.
- approved
Patches booleanEnable Non Security - ApprovedPatchesEnableNonSecurity.
- description string
- Patches baseline description information.
- rejected
Patches string[] - Reject patches.
- rejected
Patches stringAction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - resource
Group stringId - The ID of the resource group.
- sources string[]
- Source.
- {[key: string]: string}
- 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_ strname - The name of the patch baseline.
- approved_
patches Sequence[str] - Approved Patch.
- approved_
patches_ boolenable_ non_ security - ApprovedPatchesEnableNonSecurity.
- description str
- Patches baseline description information.
- rejected_
patches Sequence[str] - Reject patches.
- rejected_
patches_ straction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - resource_
group_ strid - The ID of the resource group.
- sources Sequence[str]
- Source.
- Mapping[str, str]
- Label.
- approval
Rules 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.
- operation
System String - Operating system type. Valid values:
AliyunLinux
,Anolis
,CentOS
,Debian
,RedhatEnterpriseLinux
,Ubuntu
,Windows
,AlmaLinux
. - patch
Baseline StringName - The name of the patch baseline.
- approved
Patches List<String> - Approved Patch.
- approved
Patches BooleanEnable Non Security - ApprovedPatchesEnableNonSecurity.
- description String
- Patches baseline description information.
- rejected
Patches List<String> - Reject patches.
- rejected
Patches StringAction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - resource
Group StringId - The ID of the resource group.
- sources List<String>
- Source.
- Map<String>
- Label.
Outputs
All input properties are implicitly available as output properties. Additionally, the PatchBaseline resource produces the following output properties:
- Create
Time string - Creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Create
Time string - Creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- create
Time String - Creation time.
- id String
- The provider-assigned unique ID for this managed resource.
- create
Time 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.
- create
Time 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, str]] = 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.
- Approval
Rules 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.
- Approved
Patches List<string> - Approved Patch.
- Approved
Patches boolEnable Non Security - ApprovedPatchesEnableNonSecurity.
- Create
Time string - Creation time.
- Description string
- Patches baseline description information.
- Operation
System string - Operating system type. Valid values:
AliyunLinux
,Anolis
,CentOS
,Debian
,RedhatEnterpriseLinux
,Ubuntu
,Windows
,AlmaLinux
. - Patch
Baseline stringName - The name of the patch baseline.
- Rejected
Patches List<string> - Reject patches.
- Rejected
Patches stringAction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - Resource
Group stringId - The ID of the resource group.
- Sources List<string>
- Source.
- Dictionary<string, string>
- Label.
- Approval
Rules 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.
- Approved
Patches []string - Approved Patch.
- Approved
Patches boolEnable Non Security - ApprovedPatchesEnableNonSecurity.
- Create
Time string - Creation time.
- Description string
- Patches baseline description information.
- Operation
System string - Operating system type. Valid values:
AliyunLinux
,Anolis
,CentOS
,Debian
,RedhatEnterpriseLinux
,Ubuntu
,Windows
,AlmaLinux
. - Patch
Baseline stringName - The name of the patch baseline.
- Rejected
Patches []string - Reject patches.
- Rejected
Patches stringAction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - Resource
Group stringId - The ID of the resource group.
- Sources []string
- Source.
- map[string]string
- Label.
- approval
Rules 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.
- approved
Patches List<String> - Approved Patch.
- approved
Patches BooleanEnable Non Security - ApprovedPatchesEnableNonSecurity.
- create
Time String - Creation time.
- description String
- Patches baseline description information.
- operation
System String - Operating system type. Valid values:
AliyunLinux
,Anolis
,CentOS
,Debian
,RedhatEnterpriseLinux
,Ubuntu
,Windows
,AlmaLinux
. - patch
Baseline StringName - The name of the patch baseline.
- rejected
Patches List<String> - Reject patches.
- rejected
Patches StringAction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - resource
Group StringId - The ID of the resource group.
- sources List<String>
- Source.
- Map<String,String>
- Label.
- approval
Rules 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.
- approved
Patches string[] - Approved Patch.
- approved
Patches booleanEnable Non Security - ApprovedPatchesEnableNonSecurity.
- create
Time string - Creation time.
- description string
- Patches baseline description information.
- operation
System string - Operating system type. Valid values:
AliyunLinux
,Anolis
,CentOS
,Debian
,RedhatEnterpriseLinux
,Ubuntu
,Windows
,AlmaLinux
. - patch
Baseline stringName - The name of the patch baseline.
- rejected
Patches string[] - Reject patches.
- rejected
Patches stringAction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - resource
Group stringId - The ID of the resource group.
- sources string[]
- Source.
- {[key: string]: string}
- 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_ boolenable_ non_ security - 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_ strname - The name of the patch baseline.
- rejected_
patches Sequence[str] - Reject patches.
- rejected_
patches_ straction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - resource_
group_ strid - The ID of the resource group.
- sources Sequence[str]
- Source.
- Mapping[str, str]
- Label.
- approval
Rules 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.
- approved
Patches List<String> - Approved Patch.
- approved
Patches BooleanEnable Non Security - ApprovedPatchesEnableNonSecurity.
- create
Time String - Creation time.
- description String
- Patches baseline description information.
- operation
System String - Operating system type. Valid values:
AliyunLinux
,Anolis
,CentOS
,Debian
,RedhatEnterpriseLinux
,Ubuntu
,Windows
,AlmaLinux
. - patch
Baseline StringName - The name of the patch baseline.
- rejected
Patches List<String> - Reject patches.
- rejected
Patches StringAction - Rejected patches action. Valid values:
ALLOW_AS_DEPENDENCY
,BLOCK
. - resource
Group StringId - The ID of the resource group.
- sources List<String>
- Source.
- Map<String>
- Label.
Import
OOS Patch Baseline can be imported using the id, e.g.
$ pulumi import alicloud:oos/patchBaseline:PatchBaseline example <id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.