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

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

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

aws.ssm.getMaintenanceWindows

Explore with Pulumi AI

aws logo

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

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

    Use this data source to get the window IDs of SSM maintenance windows.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ssm.getMaintenanceWindows({
        filters: [{
            name: "Enabled",
            values: ["true"],
        }],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ssm.get_maintenance_windows(filters=[aws.ssm.GetMaintenanceWindowsFilterArgs(
        name="Enabled",
        values=["true"],
    )])
    
    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 {
    		_, err := ssm.GetMaintenanceWindows(ctx, &ssm.GetMaintenanceWindowsArgs{
    			Filters: []ssm.GetMaintenanceWindowsFilter{
    				{
    					Name: "Enabled",
    					Values: []string{
    						"true",
    					},
    				},
    			},
    		}, nil)
    		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 example = Aws.Ssm.GetMaintenanceWindows.Invoke(new()
        {
            Filters = new[]
            {
                new Aws.Ssm.Inputs.GetMaintenanceWindowsFilterInputArgs
                {
                    Name = "Enabled",
                    Values = new[]
                    {
                        "true",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ssm.SsmFunctions;
    import com.pulumi.aws.ssm.inputs.GetMaintenanceWindowsArgs;
    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 example = SsmFunctions.getMaintenanceWindows(GetMaintenanceWindowsArgs.builder()
                .filters(GetMaintenanceWindowsFilterArgs.builder()
                    .name("Enabled")
                    .values("true")
                    .build())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:ssm:getMaintenanceWindows
          Arguments:
            filters:
              - name: Enabled
                values:
                  - 'true'
    

    Using getMaintenanceWindows

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getMaintenanceWindows(args: GetMaintenanceWindowsArgs, opts?: InvokeOptions): Promise<GetMaintenanceWindowsResult>
    function getMaintenanceWindowsOutput(args: GetMaintenanceWindowsOutputArgs, opts?: InvokeOptions): Output<GetMaintenanceWindowsResult>
    def get_maintenance_windows(filters: Optional[Sequence[GetMaintenanceWindowsFilter]] = None,
                                opts: Optional[InvokeOptions] = None) -> GetMaintenanceWindowsResult
    def get_maintenance_windows_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetMaintenanceWindowsFilterArgs]]]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetMaintenanceWindowsResult]
    func GetMaintenanceWindows(ctx *Context, args *GetMaintenanceWindowsArgs, opts ...InvokeOption) (*GetMaintenanceWindowsResult, error)
    func GetMaintenanceWindowsOutput(ctx *Context, args *GetMaintenanceWindowsOutputArgs, opts ...InvokeOption) GetMaintenanceWindowsResultOutput

    > Note: This function is named GetMaintenanceWindows in the Go SDK.

    public static class GetMaintenanceWindows 
    {
        public static Task<GetMaintenanceWindowsResult> InvokeAsync(GetMaintenanceWindowsArgs args, InvokeOptions? opts = null)
        public static Output<GetMaintenanceWindowsResult> Invoke(GetMaintenanceWindowsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMaintenanceWindowsResult> getMaintenanceWindows(GetMaintenanceWindowsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ssm/getMaintenanceWindows:getMaintenanceWindows
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetMaintenanceWindowsFilter>
    Configuration block(s) for filtering. Detailed below.
    Filters []GetMaintenanceWindowsFilter
    Configuration block(s) for filtering. Detailed below.
    filters List<GetMaintenanceWindowsFilter>
    Configuration block(s) for filtering. Detailed below.
    filters GetMaintenanceWindowsFilter[]
    Configuration block(s) for filtering. Detailed below.
    filters Sequence[GetMaintenanceWindowsFilter]
    Configuration block(s) for filtering. Detailed below.
    filters List<Property Map>
    Configuration block(s) for filtering. Detailed below.

    getMaintenanceWindows Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    List of window IDs of the matched SSM maintenance windows.
    Filters List<GetMaintenanceWindowsFilter>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    List of window IDs of the matched SSM maintenance windows.
    Filters []GetMaintenanceWindowsFilter
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    List of window IDs of the matched SSM maintenance windows.
    filters List<GetMaintenanceWindowsFilter>
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    List of window IDs of the matched SSM maintenance windows.
    filters GetMaintenanceWindowsFilter[]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    List of window IDs of the matched SSM maintenance windows.
    filters Sequence[GetMaintenanceWindowsFilter]
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    List of window IDs of the matched SSM maintenance windows.
    filters List<Property Map>

    Supporting Types

    GetMaintenanceWindowsFilter

    Name string
    Name of the filter field. Valid values can be found in the SSM DescribeMaintenanceWindows API Reference.
    Values List<string>
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
    Name string
    Name of the filter field. Valid values can be found in the SSM DescribeMaintenanceWindows API Reference.
    Values []string
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
    name String
    Name of the filter field. Valid values can be found in the SSM DescribeMaintenanceWindows API Reference.
    values List<String>
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
    name string
    Name of the filter field. Valid values can be found in the SSM DescribeMaintenanceWindows API Reference.
    values string[]
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
    name str
    Name of the filter field. Valid values can be found in the SSM DescribeMaintenanceWindows API Reference.
    values Sequence[str]
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
    name String
    Name of the filter field. Valid values can be found in the SSM DescribeMaintenanceWindows API Reference.
    values List<String>
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

    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.28.1 published on Thursday, Mar 28, 2024 by Pulumi