MaintenanceWindowTarget

Provides an SSM Maintenance Window Target resource

Instance Target Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const window = new aws.ssm.MaintenanceWindow("window", {
    cutoff: 1,
    duration: 3,
    schedule: "cron(0 16 ? * TUE *)",
});
const target1 = new aws.ssm.MaintenanceWindowTarget("target1", {
    description: "This is a maintenance window target",
    resourceType: "INSTANCE",
    targets: [{
        key: "tag:Name",
        values: ["acceptance_test"],
    }],
    windowId: window.id,
});
import pulumi
import pulumi_aws as aws

window = aws.ssm.MaintenanceWindow("window",
    cutoff=1,
    duration=3,
    schedule="cron(0 16 ? * TUE *)")
target1 = aws.ssm.MaintenanceWindowTarget("target1",
    description="This is a maintenance window target",
    resource_type="INSTANCE",
    targets=[{
        "key": "tag:Name",
        "values": ["acceptance_test"],
    }],
    window_id=window.id)
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var window = new Aws.Ssm.MaintenanceWindow("window", new Aws.Ssm.MaintenanceWindowArgs
        {
            Cutoff = 1,
            Duration = 3,
            Schedule = "cron(0 16 ? * TUE *)",
        });
        var target1 = new Aws.Ssm.MaintenanceWindowTarget("target1", new Aws.Ssm.MaintenanceWindowTargetArgs
        {
            Description = "This is a maintenance window target",
            ResourceType = "INSTANCE",
            Targets = 
            {
                new Aws.Ssm.Inputs.MaintenanceWindowTargetTargetArgs
                {
                    Key = "tag:Name",
                    Values = 
                    {
                        "acceptance_test",
                    },
                },
            },
            WindowId = window.Id,
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		window, err := ssm.NewMaintenanceWindow(ctx, "window", &ssm.MaintenanceWindowArgs{
			Cutoff:   pulumi.Int(1),
			Duration: pulumi.Int(3),
			Schedule: pulumi.String("cron(0 16 ? * TUE *)"),
		})
		if err != nil {
			return err
		}
		_, err = ssm.NewMaintenanceWindowTarget(ctx, "target1", &ssm.MaintenanceWindowTargetArgs{
			Description:  pulumi.String("This is a maintenance window target"),
			ResourceType: pulumi.String("INSTANCE"),
			Targets: ssm.MaintenanceWindowTargetTargetArray{
				&ssm.MaintenanceWindowTargetTargetArgs{
					Key: pulumi.String("tag:Name"),
					Values: pulumi.StringArray{
						pulumi.String("acceptance_test"),
					},
				},
			},
			WindowId: window.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Resource Group Target Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const window = new aws.ssm.MaintenanceWindow("window", {
    cutoff: 1,
    duration: 3,
    schedule: "cron(0 16 ? * TUE *)",
});
const target1 = new aws.ssm.MaintenanceWindowTarget("target1", {
    description: "This is a maintenance window target",
    resourceType: "RESOURCE_GROUP",
    targets: [{
        key: "resource-groups:ResourceTypeFilters",
        values: [
            "AWS::EC2::INSTANCE",
            "AWS::EC2::VPC",
        ],
    }],
    windowId: window.id,
});
import pulumi
import pulumi_aws as aws

window = aws.ssm.MaintenanceWindow("window",
    cutoff=1,
    duration=3,
    schedule="cron(0 16 ? * TUE *)")
target1 = aws.ssm.MaintenanceWindowTarget("target1",
    description="This is a maintenance window target",
    resource_type="RESOURCE_GROUP",
    targets=[{
        "key": "resource-groups:ResourceTypeFilters",
        "values": [
            "AWS::EC2::INSTANCE",
            "AWS::EC2::VPC",
        ],
    }],
    window_id=window.id)
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var window = new Aws.Ssm.MaintenanceWindow("window", new Aws.Ssm.MaintenanceWindowArgs
        {
            Cutoff = 1,
            Duration = 3,
            Schedule = "cron(0 16 ? * TUE *)",
        });
        var target1 = new Aws.Ssm.MaintenanceWindowTarget("target1", new Aws.Ssm.MaintenanceWindowTargetArgs
        {
            Description = "This is a maintenance window target",
            ResourceType = "RESOURCE_GROUP",
            Targets = 
            {
                new Aws.Ssm.Inputs.MaintenanceWindowTargetTargetArgs
                {
                    Key = "resource-groups:ResourceTypeFilters",
                    Values = 
                    {
                        "AWS::EC2::INSTANCE",
                        "AWS::EC2::VPC",
                    },
                },
            },
            WindowId = window.Id,
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		window, err := ssm.NewMaintenanceWindow(ctx, "window", &ssm.MaintenanceWindowArgs{
			Cutoff:   pulumi.Int(1),
			Duration: pulumi.Int(3),
			Schedule: pulumi.String("cron(0 16 ? * TUE *)"),
		})
		if err != nil {
			return err
		}
		_, err = ssm.NewMaintenanceWindowTarget(ctx, "target1", &ssm.MaintenanceWindowTargetArgs{
			Description:  pulumi.String("This is a maintenance window target"),
			ResourceType: pulumi.String("RESOURCE_GROUP"),
			Targets: ssm.MaintenanceWindowTargetTargetArray{
				&ssm.MaintenanceWindowTargetTargetArgs{
					Key: pulumi.String("resource-groups:ResourceTypeFilters"),
					Values: pulumi.StringArray{
						pulumi.String("AWS::EC2::INSTANCE"),
						pulumi.String("AWS::EC2::VPC"),
					},
				},
			},
			WindowId: window.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Create a MaintenanceWindowTarget Resource

def MaintenanceWindowTarget(resource_name, opts=None, description=None, name=None, owner_information=None, resource_type=None, targets=None, window_id=None, __props__=None);
name string
The unique name of the resource.
args MaintenanceWindowTargetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args MaintenanceWindowTargetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MaintenanceWindowTargetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

MaintenanceWindowTarget Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The MaintenanceWindowTarget resource accepts the following input properties:

ResourceType string

The type of target being registered with the Maintenance Window. Possible values are INSTANCE and RESOURCE_GROUP.

Targets List<MaintenanceWindowTargetTargetArgs>

The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs. You can specify targets using instance IDs, resource group names, or tags that have been applied to instances. For more information about these examples formats see (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)

WindowId string

The Id of the maintenance window to register the target with.

Description string

The description of the maintenance window target.

Name string

The name of the maintenance window target.

OwnerInformation string

User-provided value that will be included in any CloudWatch events raised while running tasks for these targets in this Maintenance Window.

ResourceType string

The type of target being registered with the Maintenance Window. Possible values are INSTANCE and RESOURCE_GROUP.

Targets []MaintenanceWindowTargetTarget

The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs. You can specify targets using instance IDs, resource group names, or tags that have been applied to instances. For more information about these examples formats see (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)

WindowId string

The Id of the maintenance window to register the target with.

Description string

The description of the maintenance window target.

Name string

The name of the maintenance window target.

OwnerInformation string

User-provided value that will be included in any CloudWatch events raised while running tasks for these targets in this Maintenance Window.

resourceType string

The type of target being registered with the Maintenance Window. Possible values are INSTANCE and RESOURCE_GROUP.

targets MaintenanceWindowTargetTarget[]

The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs. You can specify targets using instance IDs, resource group names, or tags that have been applied to instances. For more information about these examples formats see (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)

windowId string

The Id of the maintenance window to register the target with.

description string

The description of the maintenance window target.

name string

The name of the maintenance window target.

ownerInformation string

User-provided value that will be included in any CloudWatch events raised while running tasks for these targets in this Maintenance Window.

resource_type str

The type of target being registered with the Maintenance Window. Possible values are INSTANCE and RESOURCE_GROUP.

targets List[MaintenanceWindowTargetTarget]

The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs. You can specify targets using instance IDs, resource group names, or tags that have been applied to instances. For more information about these examples formats see (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)

window_id str

The Id of the maintenance window to register the target with.

description str

The description of the maintenance window target.

name str

The name of the maintenance window target.

owner_information str

User-provided value that will be included in any CloudWatch events raised while running tasks for these targets in this Maintenance Window.

Outputs

All input properties are implicitly available as output properties. Additionally, the MaintenanceWindowTarget 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing MaintenanceWindowTarget Resource

Get an existing MaintenanceWindowTarget resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

static get(resource_name, id, opts=None, description=None, name=None, owner_information=None, resource_type=None, targets=None, window_id=None, __props__=None);
func GetMaintenanceWindowTarget(ctx *Context, name string, id IDInput, state *MaintenanceWindowTargetState, opts ...ResourceOption) (*MaintenanceWindowTarget, error)
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.

The following state arguments are supported:

Description string

The description of the maintenance window target.

Name string

The name of the maintenance window target.

OwnerInformation string

User-provided value that will be included in any CloudWatch events raised while running tasks for these targets in this Maintenance Window.

ResourceType string

The type of target being registered with the Maintenance Window. Possible values are INSTANCE and RESOURCE_GROUP.

Targets List<MaintenanceWindowTargetTargetArgs>

The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs. You can specify targets using instance IDs, resource group names, or tags that have been applied to instances. For more information about these examples formats see (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)

WindowId string

The Id of the maintenance window to register the target with.

Description string

The description of the maintenance window target.

Name string

The name of the maintenance window target.

OwnerInformation string

User-provided value that will be included in any CloudWatch events raised while running tasks for these targets in this Maintenance Window.

ResourceType string

The type of target being registered with the Maintenance Window. Possible values are INSTANCE and RESOURCE_GROUP.

Targets []MaintenanceWindowTargetTarget

The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs. You can specify targets using instance IDs, resource group names, or tags that have been applied to instances. For more information about these examples formats see (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)

WindowId string

The Id of the maintenance window to register the target with.

description string

The description of the maintenance window target.

name string

The name of the maintenance window target.

ownerInformation string

User-provided value that will be included in any CloudWatch events raised while running tasks for these targets in this Maintenance Window.

resourceType string

The type of target being registered with the Maintenance Window. Possible values are INSTANCE and RESOURCE_GROUP.

targets MaintenanceWindowTargetTarget[]

The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs. You can specify targets using instance IDs, resource group names, or tags that have been applied to instances. For more information about these examples formats see (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)

windowId string

The Id of the maintenance window to register the target with.

description str

The description of the maintenance window target.

name str

The name of the maintenance window target.

owner_information str

User-provided value that will be included in any CloudWatch events raised while running tasks for these targets in this Maintenance Window.

resource_type str

The type of target being registered with the Maintenance Window. Possible values are INSTANCE and RESOURCE_GROUP.

targets List[MaintenanceWindowTargetTarget]

The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs. You can specify targets using instance IDs, resource group names, or tags that have been applied to instances. For more information about these examples formats see (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)

window_id str

The Id of the maintenance window to register the target with.

Supporting Types

MaintenanceWindowTargetTarget

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Key string
Values List<string>
Key string
Values []string
key string
values string[]
key str
values List[str]

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.