AWS Systems Manager Maintenance Window Target
This page shows how to write Terraform and CloudFormation for Systems Manager Maintenance Window Target and write them securely.
aws_ssm_maintenance_window_target (Terraform)
The Maintenance Window Target in Systems Manager can be configured in Terraform with the resource name aws_ssm_maintenance_window_target
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
description
optional - string -
id
optional computed - string -
name
optional - string -
owner_information
optional - string -
resource_type
required - string -
window_id
required - string -
targets
list block
Explanation in Terraform Registry
Provides an SSM Maintenance Window Target resource
AWS::SSM::MaintenanceWindowTarget (CloudFormation)
The MaintenanceWindowTarget in SSM can be configured in CloudFormation with the resource name AWS::SSM::MaintenanceWindowTarget
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::SSM::MaintenanceWindowTarget
Properties:
Description: !Sub ${Environment} AL2 Standard
Name: !Sub ${Environment}-al2-standard
ResourceType: INSTANCE
Targets:
Type: "AWS::SSM::MaintenanceWindowTarget"
Properties:
OwnerInformation: "dave@globomantics.com"
Description: "All Server 2016"
WindowId:
Fn::ImportValue: mw-patch-2016
Type: AWS::SSM::MaintenanceWindowTarget
Properties:
Description: "自動停止を適用するターゲットを定義します"
Name: EC2
ResourceType: RESOURCE_GROUP
Targets:
Type: "AWS::SSM::MaintenanceWindowTarget"
Properties:
OwnerInformation: !Ref UbuntuPatchGroupKey
WindowId: !Ref DemoMaintenanceWindow
ResourceType: INSTANCE
Targets:
Type: "AWS::SSM::MaintenanceWindowTarget"
Properties:
Name: "Target-For-Patch-Manager-Maintenance-Window"
Description: "Defines the EC2 Instance Targest for Maintenance Window: Patch-Manager-Maintenance-Window"
ResourceType: "INSTANCE"
WindowId:
"Type": "AWS::SSM::MaintenanceWindowTarget",
"Properties": {
"Description": "Scan for Patches in ScanPatchInfoNoRebootSystems",
"WindowId": {
"Ref": "ScanMaintenanceWindow"
},
"Type": "AWS::SSM::MaintenanceWindowTarget",
"Properties": {
"Description": "Scan for Patches in ScanPatchInfoNoRebootSystems",
"WindowId": {
"Ref": "ScanMaintenanceWindow"
},
"Type" : "AWS::SSM::MaintenanceWindowTarget",
"Properties" : {
"Name": { "Fn::Join": ["-",["MaintenanceWindow-Targets",{ "Fn::FindInMap": ["CustomVariables", "PatchGroups1","Value"]},"Schedule1" ]]},
"Description" : { "Fn::Join": [" ",["MaintenanceWindow","Targets",{ "Fn::FindInMap": ["CustomVariables", "PatchGroups1","Value"]},"Schedule1" ]]},
"WindowId" : {"Ref": "MaintenanceWindow1"},
"ResourceType" : "INSTANCE",
"Type": "AWS::SSM::MaintenanceWindowTarget",
"Properties": {
"ResourceType": "INSTANCE",
"Targets": [
{
"Key": "tag:Patchgroup",
"Type": "AWS::SSM::MaintenanceWindowTarget",
"Properties": {
"Description": "Scan for Patches in All instances",
"WindowId": {
"Ref": "ScanMaintenanceWindow"
},
Parameters
-
OwnerInformation
optional - String -
Description
optional - String -
WindowId
required - String -
ResourceType
required - String -
Targets
required - List of Targets -
Name
optional - String
Explanation in CloudFormation Registry
The
AWS::SSM::MaintenanceWindowTarget
resource registers a target with a maintenance window for AWS Systems Manager. For more information, see RegisterTargetWithMaintenanceWindow in the AWS Systems Manager API Reference.
Frequently asked questions
What is AWS Systems Manager Maintenance Window Target?
AWS Systems Manager Maintenance Window Target is a resource for Systems Manager of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Systems Manager Maintenance Window Target?
For CloudFormation, the stuartellis/ec2-evergreen, sednanref/learning and ShumpeiAsahi/Schwduled-stop-start-ec2 source code examples are useful. See the CloudFormation Example section for further details.