1. Packages
  2. AWS Classic
  3. API Docs
  4. ssm
  5. DefaultPatchBaseline

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.ssm.DefaultPatchBaseline

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Resource for registering an AWS Systems Manager Default Patch Baseline.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const examplePatchBaseline = new aws.ssm.PatchBaseline("example", {
        name: "example",
        approvedPatches: ["KB123456"],
    });
    const example = new aws.ssm.DefaultPatchBaseline("example", {
        baselineId: examplePatchBaseline.id,
        operatingSystem: examplePatchBaseline.operatingSystem,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example_patch_baseline = aws.ssm.PatchBaseline("example",
        name="example",
        approved_patches=["KB123456"])
    example = aws.ssm.DefaultPatchBaseline("example",
        baseline_id=example_patch_baseline.id,
        operating_system=example_patch_baseline.operating_system)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/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, "example", &ssm.PatchBaselineArgs{
    			Name: pulumi.String("example"),
    			ApprovedPatches: pulumi.StringArray{
    				pulumi.String("KB123456"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ssm.NewDefaultPatchBaseline(ctx, "example", &ssm.DefaultPatchBaselineArgs{
    			BaselineId:      examplePatchBaseline.ID(),
    			OperatingSystem: examplePatchBaseline.OperatingSystem,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var examplePatchBaseline = new Aws.Ssm.PatchBaseline("example", new()
        {
            Name = "example",
            ApprovedPatches = new[]
            {
                "KB123456",
            },
        });
    
        var example = new Aws.Ssm.DefaultPatchBaseline("example", new()
        {
            BaselineId = examplePatchBaseline.Id,
            OperatingSystem = examplePatchBaseline.OperatingSystem,
        });
    
    });
    
    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()
                .name("example")
                .approvedPatches("KB123456")
                .build());
    
            var example = new DefaultPatchBaseline("example", DefaultPatchBaselineArgs.builder()
                .baselineId(examplePatchBaseline.id())
                .operatingSystem(examplePatchBaseline.operatingSystem())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ssm:DefaultPatchBaseline
        properties:
          baselineId: ${examplePatchBaseline.id}
          operatingSystem: ${examplePatchBaseline.operatingSystem}
      examplePatchBaseline:
        type: aws:ssm:PatchBaseline
        name: example
        properties:
          name: example
          approvedPatches:
            - KB123456
    

    Create DefaultPatchBaseline Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

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

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var defaultPatchBaselineResource = new Aws.Ssm.DefaultPatchBaseline("defaultPatchBaselineResource", new()
    {
        BaselineId = "string",
        OperatingSystem = "string",
    });
    
    example, err := ssm.NewDefaultPatchBaseline(ctx, "defaultPatchBaselineResource", &ssm.DefaultPatchBaselineArgs{
    	BaselineId:      pulumi.String("string"),
    	OperatingSystem: pulumi.String("string"),
    })
    
    var defaultPatchBaselineResource = new DefaultPatchBaseline("defaultPatchBaselineResource", DefaultPatchBaselineArgs.builder()
        .baselineId("string")
        .operatingSystem("string")
        .build());
    
    default_patch_baseline_resource = aws.ssm.DefaultPatchBaseline("defaultPatchBaselineResource",
        baseline_id="string",
        operating_system="string")
    
    const defaultPatchBaselineResource = new aws.ssm.DefaultPatchBaseline("defaultPatchBaselineResource", {
        baselineId: "string",
        operatingSystem: "string",
    });
    
    type: aws:ssm:DefaultPatchBaseline
    properties:
        baselineId: string
        operatingSystem: string
    

    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

    Using the patch baseline ARN:

    Using the operating system value:

    Using pulumi import to import the Systems Manager Default Patch Baseline using the patch baseline ID, patch baseline ARN, or the operating system value. For example:

    Using the patch baseline ID:

    $ pulumi import aws:ssm/defaultPatchBaseline:DefaultPatchBaseline example pb-1234567890abcdef1
    

    Using the patch baseline ARN:

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

    Using the operating system value:

    $ pulumi import aws:ssm/defaultPatchBaseline:DefaultPatchBaseline example CENTOS
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi