Class MaintenanceWindowTarget
Provides an SSM Maintenance Window Target resource
Instance Target Example Usage
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,
});
}
}
Resource Group Target Example Usage
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,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Ssm
Assembly: Pulumi.Aws.dll
Syntax
public class MaintenanceWindowTarget : CustomResource
Constructors
View SourceMaintenanceWindowTarget(String, MaintenanceWindowTargetArgs, CustomResourceOptions)
Create a MaintenanceWindowTarget resource with the given unique name, arguments, and options.
Declaration
public MaintenanceWindowTarget(string name, MaintenanceWindowTargetArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| MaintenanceWindowTargetArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDescription
The description of the maintenance window target.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The name of the maintenance window target.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
OwnerInformation
User-provided value that will be included in any CloudWatch events raised while running tasks for these targets in this Maintenance Window.
Declaration
public Output<string> OwnerInformation { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ResourceType
The type of target being registered with the Maintenance Window. Possible values are INSTANCE and RESOURCE_GROUP.
Declaration
public Output<string> ResourceType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Targets
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)
Declaration
public Output<ImmutableArray<MaintenanceWindowTargetTarget>> Targets { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<MaintenanceWindowTargetTarget>> |
WindowId
The Id of the maintenance window to register the target with.
Declaration
public Output<string> WindowId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, MaintenanceWindowTargetState, CustomResourceOptions)
Get an existing MaintenanceWindowTarget resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static MaintenanceWindowTarget Get(string name, Input<string> id, MaintenanceWindowTargetState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| MaintenanceWindowTargetState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| MaintenanceWindowTarget |