aws logo
AWS Classic v5.41.0, May 15 23

aws.ssm.DefaultPatchBaseline

Explore with Pulumi AI

Resource for registering an AWS Systems Manager Default Patch Baseline.

Example Usage

Basic Usage

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

return await Deployment.RunAsync(() => 
{
    var examplePatchBaseline = new Aws.Ssm.PatchBaseline("examplePatchBaseline", new()
    {
        ApprovedPatches = new[]
        {
            "KB123456",
        },
    });

    var exampleDefaultPatchBaseline = new Aws.Ssm.DefaultPatchBaseline("exampleDefaultPatchBaseline", new()
    {
        BaselineId = examplePatchBaseline.Id,
        OperatingSystem = examplePatchBaseline.OperatingSystem,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ssm"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		examplePatchBaseline, err := ssm.NewPatchBaseline(ctx, "examplePatchBaseline", &ssm.PatchBaselineArgs{
			ApprovedPatches: pulumi.StringArray{
				pulumi.String("KB123456"),
			},
		})
		if err != nil {
			return err
		}
		_, err = ssm.NewDefaultPatchBaseline(ctx, "exampleDefaultPatchBaseline", &ssm.DefaultPatchBaselineArgs{
			BaselineId:      examplePatchBaseline.ID(),
			OperatingSystem: examplePatchBaseline.OperatingSystem,
		})
		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.aws.ssm.PatchBaseline;
import com.pulumi.aws.ssm.PatchBaselineArgs;
import com.pulumi.aws.ssm.DefaultPatchBaseline;
import com.pulumi.aws.ssm.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 examplePatchBaseline = new PatchBaseline("examplePatchBaseline", PatchBaselineArgs.builder()        
            .approvedPatches("KB123456")
            .build());

        var exampleDefaultPatchBaseline = new DefaultPatchBaseline("exampleDefaultPatchBaseline", DefaultPatchBaselineArgs.builder()        
            .baselineId(examplePatchBaseline.id())
            .operatingSystem(examplePatchBaseline.operatingSystem())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example_patch_baseline = aws.ssm.PatchBaseline("examplePatchBaseline", approved_patches=["KB123456"])
example_default_patch_baseline = aws.ssm.DefaultPatchBaseline("exampleDefaultPatchBaseline",
    baseline_id=example_patch_baseline.id,
    operating_system=example_patch_baseline.operating_system)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const examplePatchBaseline = new aws.ssm.PatchBaseline("examplePatchBaseline", {approvedPatches: ["KB123456"]});
const exampleDefaultPatchBaseline = new aws.ssm.DefaultPatchBaseline("exampleDefaultPatchBaseline", {
    baselineId: examplePatchBaseline.id,
    operatingSystem: examplePatchBaseline.operatingSystem,
});
resources:
  exampleDefaultPatchBaseline:
    type: aws:ssm:DefaultPatchBaseline
    properties:
      baselineId: ${examplePatchBaseline.id}
      operatingSystem: ${examplePatchBaseline.operatingSystem}
  examplePatchBaseline:
    type: aws:ssm:PatchBaseline
    properties:
      approvedPatches:
        - KB123456

Create DefaultPatchBaseline Resource

new DefaultPatchBaseline(name: string, args: DefaultPatchBaselineArgs, opts?: CustomResourceOptions);
@overload
def DefaultPatchBaseline(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         baseline_id: Optional[str] = None,
                         operating_system: 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: aws:ssm: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:

BaselineId string

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

OperatingSystem string

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

BaselineId string

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

OperatingSystem string

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

baselineId String

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

operatingSystem String

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

baselineId string

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

operatingSystem string

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

baseline_id str

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

operating_system str

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

baselineId String

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

operatingSystem String

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

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.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

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,
        baseline_id: Optional[str] = None,
        operating_system: 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:
BaselineId string

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

OperatingSystem string

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

BaselineId string

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

OperatingSystem string

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

baselineId String

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

operatingSystem String

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

baselineId string

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

operatingSystem string

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

baseline_id str

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

operating_system str

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

baselineId String

ID of the patch baseline. Can be an ID or an ARN. When specifying an AWS-provided patch baseline, must be the ARN.

operatingSystem String

The operating system the patch baseline applies to. Valid values are AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, CENTOS, DEBIAN, MACOS, ORACLE_LINUX, RASPBIAN, REDHAT_ENTERPRISE_LINUX, ROCKY_LINUX, SUSE, UBUNTU, and WINDOWS.

Import

The Systems Manager Default Patch Baseline can be imported using the patch baseline ID, patch baseline ARN, or the operating system value, e.g.,

 $ pulumi import aws:ssm/defaultPatchBaseline:DefaultPatchBaseline example pb-1234567890abcdef1
 $ pulumi import aws:ssm/defaultPatchBaseline:DefaultPatchBaseline example arn:aws:ssm:us-west-2:123456789012:patchbaseline/pb-1234567890abcdef1
 $ pulumi import aws:ssm/defaultPatchBaseline:DefaultPatchBaseline example CENTOS

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.