id
stringlengths 8
78
| source
stringclasses 743
values | chunk_id
int64 1
5.05k
| text
stringlengths 593
49.7k
|
---|---|---|---|
systems-manager-ug-488
|
systems-manager-ug.pdf
| 488 |
accepts a string or list of strings. To use a parameter for a plugin input, the parameter type must match the accepted type. For example, you must specify a Boolean type parameter for the allowDowngrade input of the aws:updateSsmAgent plugin. If your parameter type doesn't match the input type for a plugin, the SSM document fails to validate and the system doesn't create the document. This is also true when using parameters downstream within inputs for other plugins or AWS Systems Manager Automation actions. For example, you can't reference a StringList parameter within the documentParameters input of the aws:runDocument plugin. The documentParameters input accepts a map of strings even if the downstream SSM document parameter type is a StringList parameter and matches the parameter you're referencing. When using parameters with Automation actions, parameter types aren't validated when you create the SSM document in most cases. Only when you use the aws:runCommand action are parameter types validated when you create the SSM document. In all other cases, the parameter validation occurs during the automation execution when an action's input is verified before running the action. For example, if your input parameter is a String and you reference it as the value for the MaxInstanceCount input of the aws:runInstances action, the SSM document is created. However, when running the document, the automation fails while validating the aws:runInstances action because the MaxInstanceCount input requires an Integer. The following are examples of each parameter type. String A sequence of zero or more Unicode characters wrapped in quotation marks. For example, "i-1234567890abcdef0". Use backslashes to escape. YAML --- InstanceId: type: String description: "(Optional) The target EC2 instance ID." JSON "InstanceId":{ Documents 1672 AWS Systems Manager "type":"String", "description":"(Optional) The target EC2 instance ID." } User Guide StringList A list of String items separated by commas. For example, ["cd ~", "pwd"]. YAML --- commands: type: StringList description: "(Required) Specify a shell script or a command to run." default: "" minItems: 1 displayType: textarea JSON "commands":{ "type":"StringList", "description":"(Required) Specify a shell script or a command to run.", "minItems":1, "displayType":"textarea" } Boolean Accepts only true or false. Doesn't accept "true" or 0. YAML --- canRun: type: Boolean description: '' default: true JSON "canRun": { Documents 1673 AWS Systems Manager User Guide "type": "Boolean", "description": "", "default": true } Integer Integral numbers. Doesn't accept decimal numbers, for example 3.14159, or numbers wrapped in quotation marks, for example "3". YAML --- timeout: type: Integer description: The type of action to perform. default: 100 JSON "timeout": { "type": "Integer", "description": "The type of action to perform.", "default": 100 } StringMap A mapping of keys to values. Keys and values must be strings. For example, {"Env": "Prod"}. YAML --- notificationConfig: type: StringMap description: The configuration for events to be notified about default: NotificationType: 'Command' NotificationEvents: - 'Failed' NotificationArn: "$dependency.topicArn" maxChars: 150 Documents 1674 AWS Systems Manager JSON User Guide "notificationConfig" : { "type" : "StringMap", "description" : "The configuration for events to be notified about", "default" : { "NotificationType" : "Command", "NotificationEvents" : ["Failed"], "NotificationArn" : "$dependency.topicArn" }, "maxChars" : 150 } MapList A list of StringMap objects. YAML blockDeviceMappings: type: MapList description: The mappings for the create image inputs default: - DeviceName: "/dev/sda1" Ebs: VolumeSize: "50" - DeviceName: "/dev/sdm" Ebs: VolumeSize: "100" maxItems: 2 JSON "blockDeviceMappings":{ "type":"MapList", "description":"The mappings for the create image inputs", "default":[ { "DeviceName":"/dev/sda1", "Ebs":{ "VolumeSize":"50" } }, Documents 1675 User Guide AWS Systems Manager { "DeviceName":"/dev/sdm", "Ebs":{ "VolumeSize":"100" } } ], "maxItems":2 } Viewing SSM Command document content To preview the required and optional parameters for an AWS Systems Manager (SSM) Command document, in addition to the actions the document runs, you can view the content of the document in the Systems Manager console. To view SSM Command document content 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Documents. In the search box, select Document type, and then select Command. 2. 3. 4. Choose the name of a document, and then choose the Content tab. 5. In the content field, review the available parameters and action steps for the document. For example, the following image shows that (1) version and (2) allowDowngrade are optional parameters for the AWS-UpdateSSMAgent document, and that the first action run by the document is (3) aws:updateSsmAgent. Documents 1676 AWS Systems Manager User Guide Command document plugin reference This reference describes the plugins that you can specify in an AWS Systems Manager (SSM) Command type document. These plugins can't be used in SSM Automation runbooks, which use Automation actions. For information about AWS Systems Manager Automation actions, see Systems Manager Automation actions reference. Systems Manager determines the actions to perform on a managed instance by reading the contents of an SSM document. Each document includes a code-execution section. Depending on the schema version of your document, this
|
systems-manager-ug-489
|
systems-manager-ug.pdf
| 489 |
the first action run by the document is (3) aws:updateSsmAgent. Documents 1676 AWS Systems Manager User Guide Command document plugin reference This reference describes the plugins that you can specify in an AWS Systems Manager (SSM) Command type document. These plugins can't be used in SSM Automation runbooks, which use Automation actions. For information about AWS Systems Manager Automation actions, see Systems Manager Automation actions reference. Systems Manager determines the actions to perform on a managed instance by reading the contents of an SSM document. Each document includes a code-execution section. Depending on the schema version of your document, this code-execution section can include one or more plugins or steps. For the purpose of this Help topic, plugins and steps are called plugins. This section includes information about each of the Systems Manager plugins. For more information about documents, including information about creating documents and the differences between schema versions, see AWS Systems Manager Documents. Note Some of the plugins described here run only on either Windows Server instances or Linux instances. Platform dependencies are noted for each plugin. Documents 1677 AWS Systems Manager User Guide The following document plugins are supported on Amazon Elastic Compute Cloud (Amazon EC2) instances for macOS: • aws:refreshAssociation • aws:runShellScript • aws:runPowerShellScript • aws:softwareInventory • aws:updateSsmAgent Contents • Shared inputs • aws:applications • aws:cloudWatch • aws:configureDocker • aws:configurePackage • aws:domainJoin • aws:downloadContent • aws:psModule • aws:refreshAssociation • aws:runDockerAction • aws:runDocument • aws:runPowerShellScript • aws:runShellScript • aws:softwareInventory • aws:updateAgent • aws:updateSsmAgent Shared inputs With SSM Agent version 3.0.502 and later only, all plugins can use the following inputs: Documents 1678 AWS Systems Manager finallyStep User Guide The last step you want the document to run. If this input is defined for a step, it takes precedence over an exit value specified in the onFailure or onSuccess inputs. In order for a step with this input to run as expected, the step must be the last one defined in the mainSteps of your document. Type: Boolean Valid values: true | false Required: No onFailure If you specify this input for a plugin with the exit value and the step fails, the step status reflects the failure and the document doesn't run any remaining steps unless a finallyStep has been defined. If you specify this input for a plugin with the successAndExit value and the step fails, the step status shows successful and the document doesn't run any remaining steps unless a finallyStep has been defined. Type: String Valid values: exit | successAndExit Required: No onSuccess If you specify this input for a plugin and the step runs successfully, the document doesn't run any remaining steps unless a finallyStep has been defined. Type: String Valid values: exit Required: No YAML --- schemaVersion: '2.2' Documents 1679 AWS Systems Manager User Guide description: Shared inputs example parameters: customDocumentParameter: type: String description: Example parameter for a custom Command-type document. mainSteps: - action: aws:runDocument name: runCustomConfiguration inputs: documentType: SSMDocument documentPath: "yourCustomDocument" documentParameters: '"documentParameter":{{customDocumentParameter}}' onSuccess: exit - action: aws:runDocument name: ifConfigurationFailure inputs: documentType: SSMDocument documentPath: "yourCustomRepairDocument" onFailure: exit - action: aws:runDocument name: finalConfiguration inputs: documentType: SSMDocument documentPath: "yourCustomFinalDocument" finallyStep: true JSON { "schemaVersion": "2.2", "description": "Shared inputs example", "parameters": { "customDocumentParameter": { "type": "String", "description": "Example parameter for a custom Command-type document." } }, "mainSteps":[ { "action": "aws:runDocument", "name": "runCustomConfiguration", "inputs": { "documentType": "SSMDocument", Documents 1680 AWS Systems Manager User Guide "documentPath": "yourCustomDocument", "documentParameters": "\"documentParameter\": {{customDocumentParameter}}", "onSuccess": "exit" } }, { "action": "aws:runDocument", "name": "ifConfigurationFailure", "inputs": { "documentType": "SSMDocument", "documentPath": "yourCustomRepairDocument", "onFailure": "exit" } }, { "action": "aws:runDocument", "name":"finalConfiguration", "inputs": { "documentType": "SSMDocument", "documentPath": "yourCustomFinalDocument", "finallyStep": true } } ] } aws:applications Install, repair, or uninstall applications on an EC2 instance. This plugin only runs on Windows Server operating systems. Syntax Schema 2.2 YAML --- schemaVersion: '2.2' description: aws:applications plugin parameters: Documents 1681 User Guide AWS Systems Manager source: description: "(Required) Source of msi." type: String mainSteps: - action: aws:applications name: example inputs: action: Install source: "{{ source }}" JSON { "schemaVersion":"2.2", "description":"aws:applications", "parameters":{ "source":{ "description":"(Required) Source of msi.", "type":"String" } }, "mainSteps":[ { "action":"aws:applications", "name":"example", "inputs":{ "action":"Install", "source":"{{ source }}" } } ] } Schema 1.2 YAML --- runtimeConfig: aws:applications: properties: - id: 0.aws:applications Documents 1682 AWS Systems Manager User Guide action: "{{ action }}" parameters: "{{ parameters }}" source: "{{ source }}" sourceHash: "{{ sourceHash }}" JSON { "runtimeConfig":{ "aws:applications":{ "properties":[ { "id":"0.aws:applications", "action":"{{ action }}", "parameters":"{{ parameters }}", "source":"{{ source }}", "sourceHash":"{{ sourceHash }}" } ] } } } Properties action The action to take. Type: Enum Valid values: Install | Repair | Uninstall Required: Yes parameters The parameters for the installer. Type: String Required: No Documents 1683 User Guide AWS Systems Manager source The URL of the .msi file for the application. Type: String Required: Yes sourceHash The SHA256 hash of the .msi file. Type: String Required: No
|
systems-manager-ug-490
|
systems-manager-ug.pdf
| 490 |
action: "{{ action }}" parameters: "{{ parameters }}" source: "{{ source }}" sourceHash: "{{ sourceHash }}" JSON { "runtimeConfig":{ "aws:applications":{ "properties":[ { "id":"0.aws:applications", "action":"{{ action }}", "parameters":"{{ parameters }}", "source":"{{ source }}", "sourceHash":"{{ sourceHash }}" } ] } } } Properties action The action to take. Type: Enum Valid values: Install | Repair | Uninstall Required: Yes parameters The parameters for the installer. Type: String Required: No Documents 1683 User Guide AWS Systems Manager source The URL of the .msi file for the application. Type: String Required: Yes sourceHash The SHA256 hash of the .msi file. Type: String Required: No aws:cloudWatch Export data from Windows Server to Amazon CloudWatch or Amazon CloudWatch Logs and monitor the data using CloudWatch metrics. This plugin only runs on Windows Server operating systems. For more information about configuring CloudWatch integration with Amazon Elastic Compute Cloud (Amazon EC2), see Collecting metrics, logs, and traces with the CloudWatch agent in the Amazon CloudWatch User Guide. Important The unified CloudWatch agent has replaced SSM Agent as the tool for sending log data to Amazon CloudWatch Logs. The SSM Agent aws:cloudWatch plugin is not supported. We recommend using only the unified CloudWatch agent for your log collection processes. For more information, see the following topics: • Sending node logs to unified CloudWatch Logs (CloudWatch agent) • Migrate Windows Server node log collection to the CloudWatch agent • Collecting metrics, logs, and traces with the CloudWatch agent in the Amazon CloudWatch User Guide. You can export and monitor the following data types: Documents 1684 AWS Systems Manager ApplicationEventLog Sends application event log data to CloudWatch Logs. CustomLogs User Guide Sends any text-based log file to Amazon CloudWatch Logs. The CloudWatch plugin creates a fingerprint for log files. The system then associates a data offset with each fingerprint. The plugin uploads files when there are changes, records the offset, and associates the offset with a fingerprint. This method is used to avoid a situation where a user turns on the plugin, associates the service with a directory that contains a large number of files, and the system uploads all of the files. Warning Be aware that if your application truncates or attempts to clean logs during polling, any logs specified for LogDirectoryPath can lose entries. If, for example, you want to limit log file size, create a new log file when that limit is reached, and then continue writing data to the new file. ETW Sends Event Tracing for Windows (ETW) data to CloudWatch Logs. IIS Sends IIS log data to CloudWatch Logs. PerformanceCounter Sends Windows performance counters to CloudWatch. You can select different categories to upload to CloudWatch as metrics. For each performance counter that you want to upload, create a PerformanceCounter section with a unique ID (for example, "PerformanceCounter2", "PerformanceCounter3", and so on) and configure its properties. Note If the AWS Systems Manager SSM Agent or the CloudWatch plugin is stopped, performance counter data isn't logged in CloudWatch. This behavior is different than custom logs or Windows Event logs. Custom logs and Windows Event logs preserve Documents 1685 AWS Systems Manager User Guide performance counter data and upload it to CloudWatch after SSM Agent or the CloudWatch plugin is available. SecurityEventLog Sends security event log data to CloudWatch Logs. SystemEventLog Sends system event log data to CloudWatch Logs. You can define the following destinations for the data: CloudWatch The destination where your performance counter metric data is sent. You can add more sections with unique IDs (for example, "CloudWatch2", CloudWatch3", and so on), and specify a different Region for each new ID to send the same data to different locations. CloudWatchLogs The destination where your log data is sent. You can add more sections with unique IDs (for example, "CloudWatchLogs2", CloudWatchLogs3", and so on), and specify a different Region for each new ID to send the same data to different locations. Syntax "runtimeConfig":{ "aws:cloudWatch":{ "settings":{ "startType":"{{ status }}" }, "properties":"{{ properties }}" } } Documents 1686 AWS Systems Manager Settings and properties AccessKey User Guide Your access key ID. This property is required unless you launched your instance using an IAM role. This property can't be used with SSM. Type: String Required: No CategoryName The performance counter category from Performance Monitor. Type: String Required: Yes CounterName The name of the performance counter from Performance Monitor. Type: String Required: Yes CultureName The locale where the timestamp is logged. If CultureName is blank, it defaults to the same locale used by your Windows Server instance. Type: String Valid values: For a list of supported values, see National Language Support (NLS) on the Microsoft website. The div, div-MV, hu, and hu-HU values aren't supported. Required: No DimensionName A dimension for your Amazon CloudWatch metric. If you specify DimensionName, you must specify DimensionValue. These parameters provide another view when listing metrics. You
|
systems-manager-ug-491
|
systems-manager-ug.pdf
| 491 |
from Performance Monitor. Type: String Required: Yes CounterName The name of the performance counter from Performance Monitor. Type: String Required: Yes CultureName The locale where the timestamp is logged. If CultureName is blank, it defaults to the same locale used by your Windows Server instance. Type: String Valid values: For a list of supported values, see National Language Support (NLS) on the Microsoft website. The div, div-MV, hu, and hu-HU values aren't supported. Required: No DimensionName A dimension for your Amazon CloudWatch metric. If you specify DimensionName, you must specify DimensionValue. These parameters provide another view when listing metrics. You can use the same dimension for multiple metrics so that you can view all metrics belonging to a specific dimension. Documents 1687 User Guide AWS Systems Manager Type: String Required: No DimensionValue A dimension value for your Amazon CloudWatch metric. Type: String Required: No Encoding The file encoding to use (for example, UTF-8). Use the encoding name, not the display name. Type: String Valid values: For a list of supported values, see Encoding Class in the Microsoft Learn Library. Required: Yes Filter The prefix of log names. Leave this parameter blank to monitor all files. Type: String Valid values: For a list of supported values, see the FileSystemWatcherFilter Property in the MSDN Library. Required: No Flows Each data type to upload, along with the destination for the data (CloudWatch or CloudWatch Logs). For example, to send a performance counter defined under "Id": "PerformanceCounter" to the CloudWatch destination defined under "Id": "CloudWatch", enter "PerformanceCounter,CloudWatch". Similarly, to send the custom log, ETW log, and system log to the CloudWatch Logs destination defined under "Id": "ETW", enter "(ETW),CloudWatchLogs". In addition, you can send the same performance counter or log file to more than one destination. For example, to send the application log to two different destinations that you defined under "Id": "CloudWatchLogs" and "Id": "CloudWatchLogs2", enter "ApplicationEventLog,(CloudWatchLogs, CloudWatchLogs2)". Type: String Documents 1688 AWS Systems Manager User Guide Valid values (source): ApplicationEventLog | CustomLogs | ETW | PerformanceCounter | SystemEventLog | SecurityEventLog Valid values (destination): CloudWatch | CloudWatchLogs | CloudWatchn | CloudWatchLogsn Required: Yes FullName The full name of the component. Type: String Required: Yes Id Identifies the data source or destination. This identifier must be unique within the configuration file. Type: String Required: Yes InstanceName The name of the performance counter instance. Don't use an asterisk (*) to indicate all instances because each performance counter component only supports one metric. You can, however use _Total. Type: String Required: Yes Levels The types of messages to send to Amazon CloudWatch. Type: String Valid values: • 1 - Only error messages uploaded. • 2 - Only warning messages uploaded. • 4 - Only information messages uploaded. Documents 1689 AWS Systems Manager User Guide You can add values together to include more than one type of message. For example, 3 means that error messages (1) and warning messages (2) are included. A value of 7 means that error messages (1), warning messages (2), and informational messages (4) are included. Required: Yes Note Windows Security Logs should set Levels to 7. LineCount The number of lines in the header to identify the log file. For example, IIS log files have virtually identical headers. You could enter 3, which would read the first three lines of the log file's header to identify it. In IIS log files, the third line is the date and time stamp, which is different between log files. Type: Integer Required: No LogDirectoryPath For CustomLogs, the path where logs are stored on your EC2 instance. For IIS logs, the folder where IIS logs are stored for an individual site (for example, C:\\inetpub\\logs\\LogFiles\ \W3SVCn). For IIS logs, only W3C log format is supported. IIS, NCSA, and Custom formats aren't supported. Type: String Required: Yes LogGroup The name for your log group. This name is displayed on the Log Groups screen in the CloudWatch console. Type: String Required: Yes LogName The name of the log file. Documents 1690 AWS Systems Manager User Guide 1. To find the name of the log, in Event Viewer, in the navigation pane, select Applications and Services Logs. 2. In the list of logs, right-click the log you want to upload (for example, Microsoft>Windows>Backup>Operational), and then select Create Custom View. 3. In the Create Custom View dialog box, select the XML tab. The LogName is in the <Select Path=> tag (for example, Microsoft-Windows-Backup). Copy this text into the LogName parameter. Type: String Valid values: Application | Security | System | Microsoft-Windows-WinINet/ Analytic Required: Yes LogStream The destination log stream. If you use {instance_id}, the default, the instance ID of this instance is used as the log stream name. Type: String Valid values: {instance_id} | {hostname} | {ip_address} <log_stream_name> If you enter a log stream name that doesn't already exist, CloudWatch Logs
|
systems-manager-ug-492
|
systems-manager-ug.pdf
| 492 |
(for example, Microsoft>Windows>Backup>Operational), and then select Create Custom View. 3. In the Create Custom View dialog box, select the XML tab. The LogName is in the <Select Path=> tag (for example, Microsoft-Windows-Backup). Copy this text into the LogName parameter. Type: String Valid values: Application | Security | System | Microsoft-Windows-WinINet/ Analytic Required: Yes LogStream The destination log stream. If you use {instance_id}, the default, the instance ID of this instance is used as the log stream name. Type: String Valid values: {instance_id} | {hostname} | {ip_address} <log_stream_name> If you enter a log stream name that doesn't already exist, CloudWatch Logs automatically creates it for you. You can use a literal string or predefined variables ({instance_id}, {hostname}, {ip_address}, or a combination of all three to define a log stream name. The log stream name specified in this parameter is displayed on the Log Groups > Streams for <YourLogStream> screen in the CloudWatch console. Required: Yes MetricName The CloudWatch metric that you want performance data to be included under. Note Don't use special characters in the name. If you do, the metric and associated alarms might not work. Documents 1691 AWS Systems Manager Type: String Required: Yes NameSpace User Guide The metric namespace where you want performance counter data to be written. Type: String Required: Yes PollInterval How many seconds must elapse before new performance counter and log data is uploaded. Type: Integer Valid values: Set this to 5 or more seconds. Fifteen seconds (00:00:15) is recommended. Required: Yes Region The AWS Region where you want to send log data. Although you can send performance counters to a different Region from where you send your log data, we recommend that you set this parameter to the same Region where your instance is running. Type: String Valid values: Regions IDs of the AWS Regions supported by both Systems Manager and CloudWatch Logs, such as us-east-2, eu-west-1, and ap-southeast-1. For lists of AWS Regions supported by each service, see Amazon CloudWatch Logs Service Endpoints and Systems Manager service endpoints in the Amazon Web Services General Reference. Required: Yes SecretKey Your secret access key. This property is required unless you launched your instance using an IAM role. Type: String Documents 1692 User Guide AWS Systems Manager Required: No startType Turn on or turn off CloudWatch on the instance. Type: String Valid values: Enabled | Disabled Required: Yes TimestampFormat The timestamp format you want to use. For a list of supported values, see Custom Date and Time Format Strings in the MSDN Library. Type: String Required: Yes TimeZoneKind Provides time zone information when no time zone information is included in your log’s timestamp. If this parameter is left blank and if your timestamp doesn’t include time zone information, CloudWatch Logs defaults to the local time zone. This parameter is ignored if your timestamp already contains time zone information. Type: String Valid values: Local | UTC Required: No Unit The appropriate unit of measure for the metric. Type: String Valid values: Seconds | Microseconds | Milliseconds | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None Documents 1693 AWS Systems Manager Required: Yes aws:configureDocker User Guide (Schema version 2.0 or later) Configure an instance to work with containers and Docker. This plugin is supported on most Linux variants and Windows Server operating systems. Syntax Schema 2.2 YAML --- schemaVersion: '2.2' description: aws:configureDocker parameters: action: description: "(Required) The type of action to perform." type: String default: Install allowedValues: - Install - Uninstall mainSteps: - action: aws:configureDocker name: configureDocker inputs: action: "{{ action }}" JSON { "schemaVersion": "2.2", "description": "aws:configureDocker plugin", "parameters": { "action": { "description": "(Required) The type of action to perform.", "type": "String", "default": "Install", "allowedValues": [ "Install", Documents 1694 User Guide AWS Systems Manager "Uninstall" ] } }, "mainSteps": [ { "action": "aws:configureDocker", "name": "configureDocker", "inputs": { "action": "{{ action }}" } } ] } Inputs action The type of action to perform. Type: Enum Valid values: Install | Uninstall Required: Yes aws:configurePackage (Schema version 2.0 or later) Install or uninstall an AWS Systems Manager Distributor package. You can install the latest version, default version, or a version of the package you specify. Packages provided by AWS are also supported. This plugin runs on Windows Server and Linux operating systems, but not all the available packages are supported on Linux operating systems. Available AWS packages for Windows Server include the following: AWSPVDriver, AWSNVMe, AwsEnaNetworkDriver, AwsVssComponents, AmazonCloudWatchAgent, CodeDeployAgent, and AWSSupport-EC2Rescue. Available AWS packages for Linux operating systems include the following: AmazonCloudWatchAgent, CodeDeployAgent, and AWSSupport-EC2Rescue. Documents 1695 AWS Systems Manager Syntax Schema 2.2 YAML --- User Guide schemaVersion: '2.2' description:
|
systems-manager-ug-493
|
systems-manager-ug.pdf
| 493 |
Install or uninstall an AWS Systems Manager Distributor package. You can install the latest version, default version, or a version of the package you specify. Packages provided by AWS are also supported. This plugin runs on Windows Server and Linux operating systems, but not all the available packages are supported on Linux operating systems. Available AWS packages for Windows Server include the following: AWSPVDriver, AWSNVMe, AwsEnaNetworkDriver, AwsVssComponents, AmazonCloudWatchAgent, CodeDeployAgent, and AWSSupport-EC2Rescue. Available AWS packages for Linux operating systems include the following: AmazonCloudWatchAgent, CodeDeployAgent, and AWSSupport-EC2Rescue. Documents 1695 AWS Systems Manager Syntax Schema 2.2 YAML --- User Guide schemaVersion: '2.2' description: aws:configurePackage parameters: name: description: "(Required) The name of the AWS package to install or uninstall." type: String action: description: "(Required) The type of action to perform." type: String default: Install allowedValues: - Install - Uninstall ssmParameter: description: "(Required) Argument stored in Parameter Store." type: String default: "{{ ssm:parameter_store_arg }}" mainSteps: - action: aws:configurePackage name: configurePackage inputs: name: "{{ name }}" action: "{{ action }}" additionalArguments: "{\"SSM_parameter_store_arg\": \"{{ ssmParameter }}\", \"SSM_custom_arg\": \"myValue\"}" JSON { "schemaVersion": "2.2", "description": "aws:configurePackage", "parameters": { "name": { "description": "(Required) The name of the AWS package to install or uninstall.", Documents 1696 AWS Systems Manager User Guide "type": "String" }, "action": { "description": "(Required) The type of action to perform.", "type": "String", "default": "Install", "allowedValues": [ "Install", "Uninstall" ] }, "ssmParameter": { "description": "(Required) Argument stored in Parameter Store.", "type": "String", "default": "{{ ssm:parameter_store_arg }}" } }, "mainSteps": [ { "action": "aws:configurePackage", "name": "configurePackage", "inputs": { "name": "{{ name }}", "action": "{{ action }}", "additionalArguments": "{\"SSM_parameter_store_arg\": \"{{ ssmParameter }}\", \"SSM_custom_arg\": \"myValue\"}" } } ] } Inputs name The name of the AWS package to install or uninstall. Available packages include the following: AWSPVDriver, AwsEnaNetworkDriver, AwsVssComponents, and AmazonCloudWatchAgent. Type: String Required: Yes Documents 1697 User Guide AWS Systems Manager action Install or uninstall a package. Type: Enum Valid values: Install | Uninstall Required: Yes installationType The type of installation to perform. If you specify Uninstall and reinstall, the package is completely uninstalled, and then reinstalled. The application is unavailable until the reinstallation is complete. If you specify In-place update, only new or changed files are added to the existing installation according you instructions you provide in an update script. The application remains available throughout the update process. The In-place update option isn't supported for AWS-published packages. Uninstall and reinstall is the default value. Type: Enum Valid values: Uninstall and reinstall | In-place update Required: No additionalArguments A JSON string of the additional parameters to provide to your install, uninstall, or update scripts. Each parameter must be prefixed with SSM_. You can reference a Parameter Store parameter in your additional arguments by using the convention {{ssm:parameter-name}}. To use the additional parameter in your install, uninstall, or update script, you must reference the parameter as an environment variable using the syntax appropriate for the operating system. For example, in PowerShell, you reference the SSM_arg argument as $Env:SSM_arg. There is no limit to the number of arguments you define, but the additional argument input has a 4096 character limit. This limit includes all of the keys and values you define. Type: StringMap Required: No Documents 1698 AWS Systems Manager version User Guide A specific version of the package to install or uninstall. If installing, the system installs the latest published version, by default. If uninstalling, the system uninstalls the currently installed version, by default. If no installed version is found, the latest published version is downloaded, and the uninstall action is run. Type: String Required: No aws:domainJoin Join an EC2 instance to a domain. This plugin runs on Linux and Windows Server operating systems. This plugin changes the hostname for Linux instances to the format EC2AMAZ-XXXXXXX. For more information about joining EC2 instances, see Join an EC2 Instance to Your AWS Managed Microsoft AD Directory in the AWS Directory Service Administration Guide. Syntax Schema 2.2 YAML --- schemaVersion: '2.2' description: aws:domainJoin parameters: directoryId: description: "(Required) The ID of the directory." type: String directoryName: description: "(Required) The name of the domain." type: String directoryOU: description: "(Optional) The organizational unit to assign the computer object to." type: String dnsIpAddresses: description: "(Required) The IP addresses of the DNS servers for your directory." type: StringList Documents 1699 AWS Systems Manager hostname: User Guide description: "(Optional) The hostname you want to assign to the node." type: String mainSteps: - action: aws:domainJoin name: domainJoin inputs: directoryId: "{{ directoryId }}" directoryName: "{{ directoryName }}" directoryOU: "{{ directoryOU }}" dnsIpAddresses: "{{ dnsIpAddresses }}" hostname: "{{ hostname }}" JSON { "schemaVersion": "2.2", "description": "aws:domainJoin", "parameters": { "directoryId": { "description": "(Required) The ID of the directory.", "type": "String" }, "directoryName": { "description": "(Required) The name of the domain.", "type": "String" }, "directoryOU": { "description": "(Optional) The organizational unit to assign the computer object to.", "type": "String" }, "dnsIpAddresses": { "description": "(Required)
|
systems-manager-ug-494
|
systems-manager-ug.pdf
| 494 |
Documents 1699 AWS Systems Manager hostname: User Guide description: "(Optional) The hostname you want to assign to the node." type: String mainSteps: - action: aws:domainJoin name: domainJoin inputs: directoryId: "{{ directoryId }}" directoryName: "{{ directoryName }}" directoryOU: "{{ directoryOU }}" dnsIpAddresses: "{{ dnsIpAddresses }}" hostname: "{{ hostname }}" JSON { "schemaVersion": "2.2", "description": "aws:domainJoin", "parameters": { "directoryId": { "description": "(Required) The ID of the directory.", "type": "String" }, "directoryName": { "description": "(Required) The name of the domain.", "type": "String" }, "directoryOU": { "description": "(Optional) The organizational unit to assign the computer object to.", "type": "String" }, "dnsIpAddresses": { "description": "(Required) The IP addresses of the DNS servers for your directory.", "type": "StringList" }, "hostname": { "description": "(Optional) The hostname you want to assign to the node.", "type": "String" } }, "mainSteps": [ Documents 1700 AWS Systems Manager { "action": "aws:domainJoin", "name": "domainJoin", "inputs": { "directoryId": "{{ directoryId }}", "directoryName": "{{ directoryName }}", "directoryOU":"{{ directoryOU }}", "dnsIpAddresses":"{{ dnsIpAddresses }}", "hostname":"{{ hostname }}" User Guide } } ] } Schema 1.2 YAML --- runtimeConfig: aws:domainJoin: properties: directoryId: "{{ directoryId }}" directoryName: "{{ directoryName }}" directoryOU: "{{ directoryOU }}" dnsIpAddresses: "{{ dnsIpAddresses }}" JSON { "runtimeConfig":{ "aws:domainJoin":{ "properties":{ "directoryId":"{{ directoryId }}", "directoryName":"{{ directoryName }}", "directoryOU":"{{ directoryOU }}", "dnsIpAddresses":"{{ dnsIpAddresses }}" } } } } Documents 1701 User Guide AWS Systems Manager Properties directoryId The ID of the directory. Type: String Required: Yes Example: "directoryId": "d-1234567890" directoryName The name of the domain. Type: String Required: Yes Example: "directoryName": "example.com" directoryOU The organizational unit (OU). Type: String Required: No Example: "directoryOU": "OU=test,DC=example,DC=com" dnsIpAddresses The IP addresses of the DNS servers. Type: StringList Required: Yes Example: "dnsIpAddresses": ["198.51.100.1","198.51.100.2"] hostname The hostname you want to assign to the node. Documents 1702 AWS Systems Manager Type: String Required: No keepHostName User Guide Determines whether the hostname is changed for Linux instances when joined to the domain. Type: Boolean Required: No Examples For examples, see Join an Amazon EC2 Instance to your AWS Managed Microsoft AD in the AWS Directory Service Administration Guide. aws:downloadContent (Schema version 2.0 or later) Download SSM documents and scripts from remote locations. GitHub Enterprise repositories are not supported. This plugin is supported on Linux and Windows Server operating systems. Syntax Schema 2.2 YAML --- schemaVersion: '2.2' description: aws:downloadContent parameters: sourceType: description: "(Required) The download source." type: String sourceInfo: description: "(Required) The information required to retrieve the content from the required source." type: StringMap mainSteps: - action: aws:downloadContent name: downloadContent Documents 1703 User Guide AWS Systems Manager inputs: sourceType: "{{ sourceType }}" sourceInfo: "{{ sourceInfo }}" JSON { "schemaVersion": "2.2", "description": "aws:downloadContent", "parameters": { "sourceType": { "description": "(Required) The download source.", "type": "String" }, "sourceInfo": { "description": "(Required) The information required to retrieve the content from the required source.", "type": "StringMap" } }, "mainSteps": [ { "action": "aws:downloadContent", "name": "downloadContent", "inputs": { "sourceType":"{{ sourceType }}", "sourceInfo":"{{ sourceInfo }}" } } ] } Inputs sourceType The download source. Systems Manager supports the following source types for downloading scripts and SSM documents: GitHub, Git, HTTP, S3, and SSMDocument. Type: String Required: Yes Documents 1704 AWS Systems Manager sourceInfo User Guide The information required to retrieve the content from the required source. Type: StringMap Required: Yes For sourceType GitHub, specify the following: • owner: The repository owner. • repository: The name of the repository. • path: The path to the file or directory you want to download. • getOptions: Extra options to retrieve content from a branch other than master or from a specific commit in the repository. getOptions can be omitted if you're using the latest commit in the master branch. If your repository was created after October 1, 2020 the default branch might be named main instead of master. In this case, you will need to specify values for the getOptions parameter. This parameter uses the following format: • branch:refs/heads/branch_name The default is master. To specify a non-default branch use the following format: branch:refs/heads/branch_name • commitID:commitID The default is head. To use the version of your SSM document in a commit other than the latest, specify the full commit ID. For example: "getOptions": "commitID:bbc1ddb94...b76d3bEXAMPLE", • tokenInfo: The Systems Manager parameter (a SecureString parameter) where you store your GitHub access token information, in the format {{ssm-secure:secure-string-token- name}}. Documents 1705 AWS Systems Manager Note User Guide This tokenInfo field is the only SSM document plugin field that supports a SecureString parameter. SecureString parameters aren't supported for any other fields, nor for any other SSM document plugins. { "owner":"TestUser", "repository":"GitHubTest", "path":"scripts/python/test-script", "getOptions":"branch:master", "tokenInfo":"{{ssm-secure:secure-string-token}}" } For sourceType Git, you must specify the following: • repository The Git repository URL to the file or directory you want to download. Type: String Additionally, you can specify the following optional parameters: • getOptions Extra options to retrieve content from a branch other than master or from a specific commit in the repository. getOptions
|
systems-manager-ug-495
|
systems-manager-ug.pdf
| 495 |
Documents 1705 AWS Systems Manager Note User Guide This tokenInfo field is the only SSM document plugin field that supports a SecureString parameter. SecureString parameters aren't supported for any other fields, nor for any other SSM document plugins. { "owner":"TestUser", "repository":"GitHubTest", "path":"scripts/python/test-script", "getOptions":"branch:master", "tokenInfo":"{{ssm-secure:secure-string-token}}" } For sourceType Git, you must specify the following: • repository The Git repository URL to the file or directory you want to download. Type: String Additionally, you can specify the following optional parameters: • getOptions Extra options to retrieve content from a branch other than master or from a specific commit in the repository. getOptions can be omitted if you're using the latest commit in the master branch. Type: String This parameter uses the following format: • branch:refs/heads/branch_name The default is master. "branch" is required only if your SSM document is stored in a branch other than master. For example: Documents 1706 AWS Systems Manager User Guide "getOptions": "branch:refs/heads/main" • commitID:commitID The default is head. To use the version of your SSM document in a commit other than the latest, specify the full commit ID. For example: "getOptions": "commitID:bbc1ddb94...b76d3bEXAMPLE", • privateSSHKey The SSH key to use when connecting to the repository you specify. You can use the following format to reference a SecureString parameter for the value of your SSH key: {{ssm-secure:your-secure-string-parameter}}. Type: String • skipHostKeyChecking Determines the value of the StrictHostKeyChecking option when connecting to the repository you specify. The default value is false. Type: Boolean • username The username to use when connecting to the repository you specify using HTTP. You can use the following format to reference a SecureString parameter for the value of your username: {{ssm-secure:your-secure-string-parameter}}. Type: String • password The password to use when connecting to the repository you specify using HTTP. You can use the following format to reference a SecureString parameter for the value of your password: {{ssm-secure:your-secure-string-parameter}}. Type: String Documents 1707 AWS Systems Manager User Guide For sourceType HTTP, you must specify the following: • url The URL to the file or directory you want to download. Type: String Additionally, you can specify the following optional parameters: • allowInsecureDownload Determines whether a download can be performed over a connection that isn't encrypted with Secure Socket Layer (SSL) or Transport Layer Security (TLS). The default value is false. We don't recommend performing downloads without encryption. If you choose to do so, you assume all associated risks. Security is a shared responsibility between AWS and you. This is described as the shared responsibility model. To learn more, see the shared responsibility model. Type: Boolean • authMethod Determines whether a username and password are used for authentication when connecting to the url you specify. If you specify Basic or Digest, you must provide values for the username and password parameters. To use the Digest method, SSM Agent version 3.0.1181.0 or later must be installed on your instance. The Digest method supports MD5 and SHA256 encryption. Type: String Valid values: None | Basic | Digest • username The username to use when connecting to the url you specify using Basic authentication. You can use the following format to reference a SecureString parameter for the value of your username: {{ssm-secure:your-secure-string-parameter}}. Type: String • password Documents 1708 AWS Systems Manager User Guide The password to use when connecting to the url you specify using Basic authentication. You can use the following format to reference a SecureString parameter for the value of your password: {{ssm-secure:your-secure-string-parameter}}. Type: String For sourceType S3, specify the following: • path: The URL to the file or directory you want to download from Amazon S3. { "path": "https://s3.amazonaws.com/amzn-s3-demo-bucket/powershell/ helloPowershell.ps1" } For sourceType SSMDocument, specify one of the following: • name: The name and version of the document in the following format: name:version. Version is optional. { "name": "Example-RunPowerShellScript:3" } • name: The ARN for the document in the following format: arn:aws:ssm:region:account_id:document/document_name { "name":"arn:aws:ssm:us-east-2:3344556677:document/MySharedDoc" } destinationPath An optional local path on the instance where you want to download the file. If you don't specify a path, the content is downloaded to a path relative to your command ID. Type: String Required: No Documents 1709 AWS Systems Manager aws:psModule User Guide Install PowerShell modules on an Amazon EC2 instance. This plugin only runs on Windows Server operating systems. Syntax Schema 2.2 YAML --- schemaVersion: '2.2' description: aws:psModule parameters: source: description: "(Required) The URL or local path on the instance to the application .zip file." type: String mainSteps: - action: aws:psModule name: psModule inputs: source: "{{ source }}" JSON { "schemaVersion": "2.2", "description": "aws:psModule", "parameters": { "source": { "description": "(Required) The URL or local path on the instance to the application .zip file.", "type": "String" } }, "mainSteps": [ { "action": "aws:psModule", "name": "psModule", "inputs": { Documents 1710 AWS Systems Manager User Guide "source": "{{ source }}" } } ] } Schema 1.2
|
systems-manager-ug-496
|
systems-manager-ug.pdf
| 496 |
runs on Windows Server operating systems. Syntax Schema 2.2 YAML --- schemaVersion: '2.2' description: aws:psModule parameters: source: description: "(Required) The URL or local path on the instance to the application .zip file." type: String mainSteps: - action: aws:psModule name: psModule inputs: source: "{{ source }}" JSON { "schemaVersion": "2.2", "description": "aws:psModule", "parameters": { "source": { "description": "(Required) The URL or local path on the instance to the application .zip file.", "type": "String" } }, "mainSteps": [ { "action": "aws:psModule", "name": "psModule", "inputs": { Documents 1710 AWS Systems Manager User Guide "source": "{{ source }}" } } ] } Schema 1.2 YAML --- runtimeConfig: aws:psModule: properties: - runCommand: "{{ commands }}" source: "{{ source }}" sourceHash: "{{ sourceHash }}" workingDirectory: "{{ workingDirectory }}" timeoutSeconds: "{{ executionTimeout }}" JSON { "runtimeConfig":{ "aws:psModule":{ "properties":[ { "runCommand":"{{ commands }}", "source":"{{ source }}", "sourceHash":"{{ sourceHash }}", "workingDirectory":"{{ workingDirectory }}", "timeoutSeconds":"{{ executionTimeout }}" } ] } } } Documents 1711 User Guide AWS Systems Manager Properties runCommand The PowerShell command to run after the module is installed. Type: StringList Required: No source The URL or local path on the instance to the application .zip file. Type: String Required: Yes sourceHash The SHA256 hash of the .zip file. Type: String Required: No timeoutSeconds The time in seconds for a command to be completed before it's considered to have failed. Type: String Required: No workingDirectory The path to the working directory on your instance. Type: String Required: No aws:refreshAssociation (Schema version 2.0 or later) Refresh (force apply) an association on demand. This action will change the system state based on what is defined in the selected association or all associations bound to the targets. This plugin runs on Linux and Microsoft Windows Server operating systems. Documents 1712 AWS Systems Manager Syntax Schema 2.2 YAML --- User Guide schemaVersion: '2.2' description: aws:refreshAssociation parameters: associationIds: description: "(Optional) List of association IDs. If empty, all associations bound to the specified target are applied." type: StringList mainSteps: - action: aws:refreshAssociation name: refreshAssociation inputs: associationIds: - "{{ associationIds }}" JSON { "schemaVersion": "2.2", "description": "aws:refreshAssociation", "parameters": { "associationIds": { "description": "(Optional) List of association IDs. If empty, all associations bound to the specified target are applied.", "type": "StringList" } }, "mainSteps": [ { "action": "aws:refreshAssociation", "name": "refreshAssociation", "inputs": { "associationIds": [ "{{ associationIds }}" ] } Documents 1713 AWS Systems Manager } ] } Inputs associationIds User Guide List of association IDs. If empty, all associations bound to the specified target are applied. Type: StringList Required: No aws:runDockerAction (Schema version 2.0 or later) Run Docker actions on containers. This plugin runs on Linux and Microsoft Windows Server operating systems. Syntax Schema 2.2 YAML --- mainSteps: - action: aws:runDockerAction name: RunDockerAction inputs: action: "{{ action }}" container: "{{ container }}" image: "{{ image }}" memory: "{{ memory }}" cpuShares: "{{ cpuShares }}" volume: "{{ volume }}" cmd: "{{ cmd }}" env: "{{ env }}" user: "{{ user }}" publish: "{{ publish }}" workingDirectory: "{{ workingDirectory }}" Documents 1714 AWS Systems Manager User Guide timeoutSeconds: "{{ timeoutSeconds }}" JSON { "mainSteps":[ { "action":"aws:runDockerAction", "name":"RunDockerAction", "inputs":{ "action":"{{ action }}", "container":"{{ container }}", "image":"{{ image }}", "memory":"{{ memory }}", "cpuShares":"{{ cpuShares }}", "volume":"{{ volume }}", "cmd":"{{ cmd }}", "env":"{{ env }}", "user":"{{ user }}", "publish":"{{ publish }}", "workingDirectory": "{{ workingDirectory }}", "timeoutSeconds": "{{ timeoutSeconds }}" } } ] } Inputs action The type of action to perform. Type: String Required: Yes container The Docker container ID. Type: String Documents 1715 User Guide AWS Systems Manager Required: No image The Docker image name. Type: String Required: No cmd The container command. Type: String Required: No memory The container memory limit. Type: String Required: No cpuShares The container CPU shares (relative weight). Type: String Required: No volume The container volume mounts. Type: StringList Required: No env The container environment variables. Documents 1716 User Guide AWS Systems Manager Type: String Required: No user The container user name. Type: String Required: No publish The container published ports. Type: String Required: No workingDirectory The path to the working directory on your managed node. Type: String Required: No timeoutSeconds The time in seconds for a command to be completed before it's considered to have failed. Type: String Required: No aws:runDocument (Schema version 2.0 or later) Runs SSM documents stored in Systems Manager or on a local share. You can use this plugin with the aws:downloadContent plugin to download an SSM document from a remote location to a local share, and then run it. This plugin is supported on Linux and Windows Server operating systems. This plugin doesn't support running the AWS- UpdateSSMAgent document or any document that uses the aws:updateSsmAgent plugin. Documents 1717 User Guide AWS Systems Manager Syntax Schema 2.2 YAML --- schemaVersion: '2.2' description: aws:runDocument parameters: documentType: description: "(Required) The document type to run." type: String allowedValues: - LocalPath - SSMDocument
|
systems-manager-ug-497
|
systems-manager-ug.pdf
| 497 |
or later) Runs SSM documents stored in Systems Manager or on a local share. You can use this plugin with the aws:downloadContent plugin to download an SSM document from a remote location to a local share, and then run it. This plugin is supported on Linux and Windows Server operating systems. This plugin doesn't support running the AWS- UpdateSSMAgent document or any document that uses the aws:updateSsmAgent plugin. Documents 1717 User Guide AWS Systems Manager Syntax Schema 2.2 YAML --- schemaVersion: '2.2' description: aws:runDocument parameters: documentType: description: "(Required) The document type to run." type: String allowedValues: - LocalPath - SSMDocument mainSteps: - action: aws:runDocument name: runDocument inputs: documentType: "{{ documentType }}" JSON { "schemaVersion": "2.2", "description": "aws:runDocument", "parameters": { "documentType": { "description": "(Required) The document type to run.", "type": "String", "allowedValues": [ "LocalPath", "SSMDocument" ] } }, "mainSteps": [ { "action": "aws:runDocument", "name": "runDocument", "inputs": { "documentType": "{{ documentType }}" Documents 1718 AWS Systems Manager } } ] } Inputs documentType User Guide The document type to run. You can run local documents (LocalPath) or documents stored in Systems Manager (SSMDocument). Type: String Required: Yes documentPath The path to the document. If documentType is LocalPath, then specify the path to the document on the local share. If documentType is SSMDocument, then specify the name of the document. Type: String Required: No documentParameters Parameters for the document. Type: StringMap Required: No aws:runPowerShellScript Run PowerShell scripts or specify the path to a script to run. This plugin runs on Microsoft Windows Server and Linux operating systems. Documents 1719 AWS Systems Manager Syntax Schema 2.2 YAML --- User Guide schemaVersion: '2.2' description: aws:runPowerShellScript parameters: commands: type: String description: "(Required) The commands to run or the path to an existing script on the instance." default: Write-Host "Hello World" mainSteps: - action: aws:runPowerShellScript name: runPowerShellScript inputs: timeoutSeconds: '60' runCommand: - "{{ commands }}" JSON { "schemaVersion": "2.2", "description": "aws:runPowerShellScript", "parameters": { "commands": { "type": "String", "description": "(Required) The commands to run or the path to an existing script on the instance.", "default": "Write-Host \"Hello World\"" } }, "mainSteps": [ { "action": "aws:runPowerShellScript", "name": "runPowerShellScript", "inputs": { "timeoutSeconds": "60", "runCommand": [ Documents 1720 AWS Systems Manager User Guide "{{ commands }}" ] } } ] } Schema 1.2 YAML --- runtimeConfig: aws:runPowerShellScript: properties: - id: 0.aws:runPowerShellScript runCommand: "{{ commands }}" workingDirectory: "{{ workingDirectory }}" timeoutSeconds: "{{ executionTimeout }}" JSON { "runtimeConfig":{ "aws:runPowerShellScript":{ "properties":[ { "id":"0.aws:runPowerShellScript", "runCommand":"{{ commands }}", "workingDirectory":"{{ workingDirectory }}", "timeoutSeconds":"{{ executionTimeout }}" } ] } } } Documents 1721 AWS Systems Manager Properties runCommand User Guide Specify the commands to run or the path to an existing script on the instance. Type: StringList Required: Yes timeoutSeconds The time in seconds for a command to be completed before it's considered to have failed. When the timeout is reached, Systems Manager stops the command execution. Type: String Required: No workingDirectory The path to the working directory on your instance. Type: String Required: No aws:runShellScript Run Linux shell scripts or specify the path to a script to run. This plugin only runs on Linux operating systems. Syntax Schema 2.2 YAML --- schemaVersion: '2.2' description: aws:runShellScript parameters: commands: type: String description: "(Required) The commands to run or the path to an existing script Documents 1722 AWS Systems Manager User Guide on the instance." default: echo Hello World mainSteps: - action: aws:runShellScript name: runShellScript inputs: timeoutSeconds: '60' runCommand: - "{{ commands }}" JSON { "schemaVersion": "2.2", "description": "aws:runShellScript", "parameters": { "commands": { "type": "String", "description": "(Required) The commands to run or the path to an existing script on the instance.", "default": "echo Hello World" } }, "mainSteps": [ { "action": "aws:runShellScript", "name": "runShellScript", "inputs": { "timeoutSeconds": "60", "runCommand": [ "{{ commands }}" ] } } ] } Schema 1.2 YAML --- Documents 1723 AWS Systems Manager User Guide runtimeConfig: aws:runShellScript: properties: - runCommand: "{{ commands }}" workingDirectory: "{{ workingDirectory }}" timeoutSeconds: "{{ executionTimeout }}" JSON { "runtimeConfig":{ "aws:runShellScript":{ "properties":[ { "runCommand":"{{ commands }}", "workingDirectory":"{{ workingDirectory }}", "timeoutSeconds":"{{ executionTimeout }}" } ] } } } Properties runCommand Specify the commands to run or the path to an existing script on the instance. Type: StringList Required: Yes timeoutSeconds The time in seconds for a command to be completed before it's considered to have failed. When the timeout is reached, Systems Manager stops the command execution. Type: String Required: No Documents 1724 AWS Systems Manager workingDirectory The path to the working directory on your instance. User Guide Type: String Required: No aws:softwareInventory (Schema version 2.0 or later) Gather metadata about applications, files, and configurations on your managed instances. This plugin runs on Linux and Microsoft Windows Server operating systems. When you configure inventory collection, you start by creating an AWS Systems Manager State Manager association. Systems Manager collects the inventory data when the association is run. If you don't create the association
|
systems-manager-ug-498
|
systems-manager-ug.pdf
| 498 |
to have failed. When the timeout is reached, Systems Manager stops the command execution. Type: String Required: No Documents 1724 AWS Systems Manager workingDirectory The path to the working directory on your instance. User Guide Type: String Required: No aws:softwareInventory (Schema version 2.0 or later) Gather metadata about applications, files, and configurations on your managed instances. This plugin runs on Linux and Microsoft Windows Server operating systems. When you configure inventory collection, you start by creating an AWS Systems Manager State Manager association. Systems Manager collects the inventory data when the association is run. If you don't create the association first, and attempt to invoke the aws:softwareInventory plugin the system returns the following error: The aws:softwareInventory plugin can only be invoked via ssm-associate. An instance can have only one inventory association configured at a time. If you configure an instance with two or more associations, the inventory association doesn't run and no inventory data is collected. For more information about collecting inventory, see AWS Systems Manager Inventory. Syntax Schema 2.2 YAML --- mainSteps: - action: aws:softwareInventory name: collectSoftwareInventoryItems inputs: applications: "{{ applications }}" awsComponents: "{{ awsComponents }}" networkConfig: "{{ networkConfig }}" files: "{{ files }}" services: "{{ services }}" windowsRoles: "{{ windowsRoles }}" Documents 1725 AWS Systems Manager User Guide windowsRegistry: "{{ windowsRegistry}}" windowsUpdates: "{{ windowsUpdates }}" instanceDetailedInformation: "{{ instanceDetailedInformation }}" customInventory: "{{ customInventory }}" JSON { "mainSteps":[ { "action":"aws:softwareInventory", "name":"collectSoftwareInventoryItems", "inputs":{ "applications":"{{ applications }}", "awsComponents":"{{ awsComponents }}", "networkConfig":"{{ networkConfig }}", "files":"{{ files }}", "services":"{{ services }}", "windowsRoles":"{{ windowsRoles }}", "windowsRegistry":"{{ windowsRegistry}}", "windowsUpdates":"{{ windowsUpdates }}", "instanceDetailedInformation":"{{ instanceDetailedInformation }}", "customInventory":"{{ customInventory }}" } } ] } Inputs applications (Optional) Collect metadata for installed applications. Type: String Required: No awsComponents (Optional) Collect metadata for AWS components like amazon-ssm-agent. Type: String Documents 1726 AWS Systems Manager Required: No files User Guide (Optional, requires SSM Agent version 2.2.64.0 or later) Collect metadata for files, including file names, the time files were created, the time files were last modified and accessed, and file sizes, to name a few. For more information about collecting file inventory, see Working with file and Windows registry inventory. Type: String Required: No networkConfig (Optional) Collect metadata for network configurations. Type: String Required: No billingInfo (Optional) Collect metadata for platform details associated with the billing code of the AMI. Type: String Required: No windowsUpdates (Optional) Collect metadata for all Windows updates. Type: String Required: No instanceDetailedInformation (Optional) Collect more instance information than is provided by the default inventory plugin (aws:instanceInformation), including CPU model, speed, and the number of cores, to name a few. Type: String Required: No Documents 1727 AWS Systems Manager services User Guide (Optional, Windows OS only, requires SSM Agent version 2.2.64.0 or later) Collect metadata for service configurations. Type: String Required: No windowsRegistry (Optional, Windows OS only, requires SSM Agent version 2.2.64.0 or later) Collect Windows Registry keys and values. You can choose a key path and collect all keys and values recursively. You can also collect a specific registry key and its value for a specific path. Inventory collects the key path, name, type, and the value. For more information about collecting Windows Registry inventory, see Working with file and Windows registry inventory. Type: String Required: No windowsRoles (Optional, Windows OS only, requires SSM Agent version 2.2.64.0 or later) Collect metadata for Microsoft Windows role configurations. Type: String Required: No customInventory (Optional) Collect custom inventory data. For more information about custom inventory, see Working with custom inventory Type: String Required: No customInventoryDirectory (Optional) Collect custom inventory data from the specified directory. For more information about custom inventory, see Working with custom inventory Type: String Documents 1728 AWS Systems Manager Required: No aws:updateAgent User Guide Update the EC2Config service to the latest version or specify an older version. This plugin only runs on Microsoft Windows Server operating systems. For more information about the EC2Config service, see Configuring a Windows Instance using the EC2Config service (legacy) in the Amazon EC2 User Guide. Syntax Schema 2.2 YAML --- schemaVersion: '2.2' description: aws:updateAgent mainSteps: - action: aws:updateAgent name: updateAgent inputs: agentName: Ec2Config source: https://s3.{Region}.amazonaws.com/aws-ssm-{Region}/manifest.json JSON { "schemaVersion": "2.2", "description": "aws:updateAgent", "mainSteps": [ { "action": "aws:updateAgent", "name": "updateAgent", "inputs": { "agentName": "Ec2Config", "source": "https://s3.{Region}.amazonaws.com/aws-ssm-{Region}/manifest.json" } } ] } Documents 1729 User Guide AWS Systems Manager Schema 1.2 YAML --- runtimeConfig: aws:updateAgent: properties: agentName: Ec2Config source: https://s3.{Region}.amazonaws.com/aws-ssm-{Region}/manifest.json allowDowngrade: "{{ allowDowngrade }}" targetVersion: "{{ version }}" JSON { "runtimeConfig":{ "aws:updateAgent":{ "properties":{ "agentName":"Ec2Config", "source":"https://s3.{Region}.amazonaws.com/aws-ssm-{Region}/ manifest.json", "allowDowngrade":"{{ allowDowngrade }}", "targetVersion":"{{ version }}" } } } } Properties agentName EC2Config. This is the name of the agent that runs the EC2Config service. Type: String Required: Yes allowDowngrade Allow the EC2Config service to be downgraded to an earlier version. If set to false, the service can be upgraded to newer versions only (default). If set to true, specify the earlier version. Documents 1730 AWS Systems Manager Type: Boolean
|
systems-manager-ug-499
|
systems-manager-ug.pdf
| 499 |
AWS Systems Manager Schema 1.2 YAML --- runtimeConfig: aws:updateAgent: properties: agentName: Ec2Config source: https://s3.{Region}.amazonaws.com/aws-ssm-{Region}/manifest.json allowDowngrade: "{{ allowDowngrade }}" targetVersion: "{{ version }}" JSON { "runtimeConfig":{ "aws:updateAgent":{ "properties":{ "agentName":"Ec2Config", "source":"https://s3.{Region}.amazonaws.com/aws-ssm-{Region}/ manifest.json", "allowDowngrade":"{{ allowDowngrade }}", "targetVersion":"{{ version }}" } } } } Properties agentName EC2Config. This is the name of the agent that runs the EC2Config service. Type: String Required: Yes allowDowngrade Allow the EC2Config service to be downgraded to an earlier version. If set to false, the service can be upgraded to newer versions only (default). If set to true, specify the earlier version. Documents 1730 AWS Systems Manager Type: Boolean Required: No source User Guide The location where Systems Manager copies the version of EC2Config to install. You can't change this location. Type: String Required: Yes targetVersion A specific version of the EC2Config service to install. If not specified, the service will be updated to the latest version. Type: String Required: No aws:updateSsmAgent Update the SSM Agent to the latest version or specify an older version. This plugin runs on Linux and Windows Server operating systems. For more information, see Working with SSM Agent. Syntax Schema 2.2 YAML --- schemaVersion: '2.2' description: aws:updateSsmAgent parameters: allowDowngrade: default: 'false' description: "(Optional) Allow the Amazon SSM Agent service to be downgraded to an earlier version. If set to false, the service can be upgraded to newer versions only (default). If set to true, specify the earlier version." type: String Documents 1731 AWS Systems Manager User Guide allowedValues: - 'true' - 'false' mainSteps: - action: aws:updateSsmAgent name: updateSSMAgent inputs: agentName: amazon-ssm-agent source: https://s3.{Region}.amazonaws.com/amazon-ssm-{Region}/ssm-agent- manifest.json allowDowngrade: "{{ allowDowngrade }}" JSON { "schemaVersion": "2.2", "description": "aws:updateSsmAgent", "parameters": { "allowDowngrade": { "default": "false", "description": "(Required) Allow the Amazon SSM Agent service to be downgraded to an earlier version. If set to false, the service can be upgraded to newer versions only (default). If set to true, specify the earlier version.", "type": "String", "allowedValues": [ "true", "false" ] } }, "mainSteps": [ { "action": "aws:updateSsmAgent", "name": "awsupdateSsmAgent", "inputs": { "agentName": "amazon-ssm-agent", "source": "https://s3.{Region}.amazonaws.com/amazon-ssm-{Region}/ssm-agent- manifest.json", "allowDowngrade": "{{ allowDowngrade }}" } } ] } Documents 1732 User Guide AWS Systems Manager Schema 1.2 YAML --- runtimeConfig: aws:updateSsmAgent: properties: - agentName: amazon-ssm-agent source: https://s3.{Region}.amazonaws.com/aws-ssm-{Region}/manifest.json allowDowngrade: "{{ allowDowngrade }}" JSON { "runtimeConfig":{ "aws:updateSsmAgent":{ "properties":[ { "agentName":"amazon-ssm-agent", "source":"https://s3.{Region}.amazonaws.com/aws-ssm-{Region}/ manifest.json", "allowDowngrade":"{{ allowDowngrade }}" } ] } } } Properties agentName amazon-ssm-agent. This is the name of the Systems Manager agent that processes requests and runs commands on the instance. Type: String Required: Yes Documents 1733 AWS Systems Manager allowDowngrade User Guide Allow the SSM Agent to be downgraded to an earlier version. If set to false, the agent can be upgraded to newer versions only (default). If set to true, specify the earlier version. Type: Boolean Required: Yes source The location where Systems Manager copies the SSM Agent version to install. You can't change this location. Type: String Required: Yes targetVersion A specific version of SSM Agent to install. If not specified, the agent will be updated to the latest version. Type: String Required: No Creating SSM document content If the AWS Systems Manager public documents don't perform all the actions you want to perform on your AWS resources, you can create your own SSM documents. You can also clone SSM documents using the console. Cloning documents copies content from an existing document to a new document that you can modify. When creating or cloning a document, the content of the document must not exceed 64KB. This quota also includes the content specified for input parameters at runtime. When you create a new Command or Policy document, we recommend that you use schema version 2.2 or later so you can take advantage of the latest features, such as document editing, automatic versioning, sequencing, and more. Writing SSM document content To create your own SSM document content, it's important to understand the different schemas, features, plugins, and syntax available for SSM documents. We recommend becoming familiar with the following resources. Documents 1734 AWS Systems Manager User Guide • Writing your own AWS Systems Manager documents • Data elements and parameters • Schemas, features, and examples • Command document plugin reference • Systems Manager Automation actions reference • Automation system variables • Additional runbook examples • Working with Systems Manager Automation runbooks using the AWS Toolkit for Visual Studio Code • Visual design experience for Automation runbooks • Using scripts in runbooks AWS pre-defined SSM documents might perform some of the actions you require. You can call these documents by using the aws:runDocument, aws:runCommand, or aws:executeAutomation plugins within your custom SSM document, depending on the document type. You can also copy portions of those documents into a custom SSM document, and edit the content to meet your requirements. Tip When creating SSM document content, you might change the content and update your SSM document several times
|
systems-manager-ug-500
|
systems-manager-ug.pdf
| 500 |
Working with Systems Manager Automation runbooks using the AWS Toolkit for Visual Studio Code • Visual design experience for Automation runbooks • Using scripts in runbooks AWS pre-defined SSM documents might perform some of the actions you require. You can call these documents by using the aws:runDocument, aws:runCommand, or aws:executeAutomation plugins within your custom SSM document, depending on the document type. You can also copy portions of those documents into a custom SSM document, and edit the content to meet your requirements. Tip When creating SSM document content, you might change the content and update your SSM document several times while testing. The following commands update the SSM document with your latest content, and update the document's default version to the latest version of the document. Note The Linux and Windows commands use the jq command line tool to filter the JSON response data. Linux & macOS latestDocVersion=$(aws ssm update-document \ --content file://path/to/file/documentContent.json \ --name "ExampleDocument" \ Documents 1735 AWS Systems Manager User Guide --document-format JSON \ --document-version '$LATEST' \ | jq -r '.DocumentDescription.LatestVersion') aws ssm update-document-default-version \ --name "ExampleDocument" \ --document-version $latestDocVersion Windows latestDocVersion=$(aws ssm update-document ^ --content file://C:\path\to\file\documentContent.json ^ --name "ExampleDocument" ^ --document-format JSON ^ --document-version "$LATEST" ^ | jq -r '.DocumentDescription.LatestVersion') aws ssm update-document-default-version ^ --name "ExampleDocument" ^ --document-version $latestDocVersion PowerShell $content = Get-Content -Path "C:\path\to\file\documentContent.json" | Out- String $latestDocVersion = Update-SSMDocument ` -Content $content ` -Name "ExampleDocument" ` -DocumentFormat "JSON" ` -DocumentVersion '$LATEST' ` | Select-Object -ExpandProperty LatestVersion Update-SSMDocumentDefaultVersion ` -Name "ExampleDocument" ` -DocumentVersion $latestDocVersion Documents 1736 AWS Systems Manager Cloning an SSM document User Guide You can clone AWS Systems Manager documents using the Systems Manager Documents console to create SSM documents. Cloning SSM documents copies content from an existing document to a new document that you can modify. You can't clone a document larger than 64KB. To clone an SSM document 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Documents. In the search box, enter the name of the document you want to clone. 2. 3. 4. Choose the name of the document you want to clone, and then choose Clone document in the Actions dropdown. 5. Modify the document as you prefer, and then choose Create document to save the document. After writing your SSM document content, you can use your content to create an SSM document using one of the following methods. Create SSM documents • Creating composite documents Creating composite documents A composite AWS Systems Manager (SSM) document is a custom document that performs a series of actions by running one or more secondary SSM documents. Composite documents promote infrastructure as code by allowing you to create a standard set of SSM documents for common tasks such as boot-strapping software or domain-joining instances. You can then share these documents across AWS accounts in the same AWS Region to reduce SSM document maintenance and ensure consistency. For example, you can create a composite document that performs the following actions: 1. Installs all patches in the allow list. 2. Installs antivirus software. 3. Downloads scripts from GitHub and runs them. Documents 1737 AWS Systems Manager User Guide In this example, your custom SSM document includes the following plugins to perform these actions: 1. The aws:runDocument plugin to run the AWS-RunPatchBaseline document, which installs all allow listed patches. 2. The aws:runDocument plugin to run the AWS-InstallApplication document, which installs the antivirus software. 3. The aws:downloadContent plugin to download scripts from GitHub and run them. Composite and secondary documents can be stored in Systems Manager, GitHub (public and private repositories), or Amazon S3. Composite documents and secondary documents can be created in JSON or YAML. Note Composite documents can only run to a maximum depth of three documents. This means that a composite document can call a child document; and that child document can call one last document. To create a composite document, add the aws:runDocument plugin in a custom SSM document and specify the required inputs. The following is an example of a composite document that performs the following actions: 1. Runs the aws:downloadContent plugin to download an SSM document from a GitHub public repository to a local directory called bootstrap. The SSM document is called StateManagerBootstrap.yml (a YAML document). 2. Runs the aws:runDocument plugin to run the StateManagerBootstrap.yml document. No parameters are specified. 3. Runs the aws:runDocument plugin to run the AWS-ConfigureDocker pre-defined SSM document. The specified parameters install Docker on the instance. { "schemaVersion": "2.2", "description": "My composite document for bootstrapping software and installing Docker.", Documents 1738 AWS Systems Manager "parameters": { }, "mainSteps": [ { "action": "aws:downloadContent", "name": "downloadContent", "inputs": { "sourceType": "GitHub", User Guide "sourceInfo": "{\"owner\":\"TestUser1\",\"repository\":\"TestPublic\", \"path \":\"documents/bootstrap/StateManagerBootstrap.yml\"}", "destinationPath": "bootstrap" } }, { "action": "aws:runDocument", "name": "runDocument", "inputs": { "documentType": "LocalPath", "documentPath": "bootstrap", "documentParameters": "{}" } }, { "action": "aws:runDocument", "name": "configureDocker", "inputs":
|
systems-manager-ug-501
|
systems-manager-ug.pdf
| 501 |
(a YAML document). 2. Runs the aws:runDocument plugin to run the StateManagerBootstrap.yml document. No parameters are specified. 3. Runs the aws:runDocument plugin to run the AWS-ConfigureDocker pre-defined SSM document. The specified parameters install Docker on the instance. { "schemaVersion": "2.2", "description": "My composite document for bootstrapping software and installing Docker.", Documents 1738 AWS Systems Manager "parameters": { }, "mainSteps": [ { "action": "aws:downloadContent", "name": "downloadContent", "inputs": { "sourceType": "GitHub", User Guide "sourceInfo": "{\"owner\":\"TestUser1\",\"repository\":\"TestPublic\", \"path \":\"documents/bootstrap/StateManagerBootstrap.yml\"}", "destinationPath": "bootstrap" } }, { "action": "aws:runDocument", "name": "runDocument", "inputs": { "documentType": "LocalPath", "documentPath": "bootstrap", "documentParameters": "{}" } }, { "action": "aws:runDocument", "name": "configureDocker", "inputs": { "documentType": "SSMDocument", "documentPath": "AWS-ConfigureDocker", "documentParameters": "{\"action\":\"Install\"}" } } ] } More info • For information about rebooting servers and instances when using Run Command to call scripts, see Handling reboots when running commands. • For more information about the plugins you can add to a custom SSM document, see Command document plugin reference. • If you simply want to run a document from a remote location (without creating a composite document), see Running documents from remote locations. Documents 1739 AWS Systems Manager Working with documents User Guide This section includes information about how to use and work with SSM documents. Topics • Compare SSM document versions • Create an SSM document • Deleting custom SSM documents • Running documents from remote locations • Sharing SSM documents • Searching for SSM documents Compare SSM document versions You can compare the differences in content between versions of AWS Systems Manager (SSM) documents in the Systems Manager Documents console. When comparing versions of an SSM document, differences between the content of the versions are highlighted. To compare SSM document content (console) 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Documents. In the documents list, choose the document whose content you want to compare. 2. 3. 4. On the Content tab, select Compare versions, and choose the version of the document you want to compare the content to. Create an SSM document After you create the content for your custom SSM document, as described in Writing SSM document content, you can use the Systems Manager console to create an SSM document using your content. To create an SSM document 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. Documents 1740 AWS Systems Manager User Guide 2. In the navigation pane, choose Documents. 3. Choose Create command or session. 4. 5. 6. Enter a descriptive name for the document. (Optional) For Target type, specify the type of resources the document can run on. In the Document type list, choose the type of document you want to create. 7. Delete the brackets in the Content field, and then paste the document content you created earlier. 8. (Optional) In the Document tags section, apply one or more tag key name/value pairs to the document. Tags are optional metadata that you assign to a resource. Tags allow you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a document to identify the type of tasks it runs, the type of operating systems it targets, and the environment it runs in. In this case, you could specify the following key name/ value pairs: • Key=TaskType,Value=MyConfigurationUpdate • Key=OS,Value=AMAZON_LINUX_2 • Key=Environment,Value=Production 9. Choose Create document to save the document. Deleting custom SSM documents If you no longer want to use a custom SSM document, you can delete it using the AWS Systems Manager console. To delete an SSM document 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Documents. Select the document you want to delete. Select Delete. When prompted to delete the document, select Delete. 2. 3. 4. Documents 1741 AWS Systems Manager User Guide For examples using command line tools or SDKs to delete SSM documents, see Use DeleteDocument with an AWS SDK or CLI. Running documents from remote locations You can run AWS Systems Manager (SSM) documents from remote locations by using the AWS- RunDocument pre-defined SSM document. This document supports running SSM documents stored in the following locations: • Public and private GitHub repositories (GitHub Enterprise is not supported) • Amazon S3 buckets • Systems Manager While you can also run remote documents by using State Manager or Automation, tools in AWS Systems Manager, the following procedure describes only how to run remote SSM documents by using AWS Systems Manager Run Command in the Systems Manager console. Note AWS-RunDocument can be used to run only command-type SSM documents, not other types such as Automation runbooks. The AWS-RunDocument uses the aws:downloadContent plugin. For more information about the aws:downloadContent plugin, see aws:downloadContent. Before you begin Before you run a remote document, you must complete the following tasks. • Create an SSM Command
|
systems-manager-ug-502
|
systems-manager-ug.pdf
| 502 |
Amazon S3 buckets • Systems Manager While you can also run remote documents by using State Manager or Automation, tools in AWS Systems Manager, the following procedure describes only how to run remote SSM documents by using AWS Systems Manager Run Command in the Systems Manager console. Note AWS-RunDocument can be used to run only command-type SSM documents, not other types such as Automation runbooks. The AWS-RunDocument uses the aws:downloadContent plugin. For more information about the aws:downloadContent plugin, see aws:downloadContent. Before you begin Before you run a remote document, you must complete the following tasks. • Create an SSM Command document and save it in a remote location. For more information, see Creating SSM document content • If you plan to run a remote document that is stored in a private GitHub repository, then you must create a Systems Manager SecureString parameter for your GitHub security access token. You can't access a remote document in a private GitHub repository by manually passing your token over SSH. The access token must be passed as a Systems Manager SecureString parameter. For more information about creating a SecureString parameter, see Creating Parameter Store parameters in Systems Manager. Documents 1742 AWS Systems Manager User Guide Run a remote document (console) To run a remote document 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Run Command. 3. Choose Run command. 4. 5. In the Document list, choose AWS-RunDocument. In Command parameters, for Source Type, choose an option. • If you choose GitHub, specify Source Info information in the following format: { "owner": "owner_name", "repository": "repository_name", "path": "path_to_document", "getOptions":"branch:branch_name", "tokenInfo": "{{ssm-secure:secure-string-token}}" } For example: { "owner":"TestUser", "repository":"GitHubTestExamples", "path":"scripts/python/test-script", "getOptions":"branch:exampleBranch", "tokenInfo":"{{ssm-secure:my-secure-string-token}}" } Note getOptions are extra options to retrieve content from a branch other than master, or from a specific commit in the repository. getOptions can be omitted if you are using the latest commit in the master branch. The branch parameter is required only if your SSM document is stored in a branch other than master. To use the version of your SSM document in a particular commit in your repository, use commitID with getOptions instead of branch. For example: Documents 1743 AWS Systems Manager User Guide "getOptions": "commitID:bbc1ddb94...b76d3bEXAMPLE", • If you choose S3, specify Source Info information in the following format: {"path":"URL_to_document_in_S3"} For example: {"path":"https://s3.amazonaws.com/amzn-s3-demo-bucket/scripts/ruby/ mySSMdoc.json"} • If you choose SSMDocument, specify Source Info information in the following format: {"name": "document_name"} For example: {"name": "mySSMdoc"} 6. In the Document Parameters field, enter parameters for the remote SSM document. For example, if you run the AWS-RunPowerShell document, you could specify: {"commands": ["date", "echo \"Hello World\""]} If you run the AWS-ConfigureAWSPack document, you could specify: { "action":"Install", "name":"AWSPVDriver" } 7. In the Targets section, choose the managed nodes on which you want to run this operation by specifying tags, selecting instances or edge devices manually, or specifying a resource group. Documents 1744 AWS Systems Manager Tip User Guide If a managed node you expect to see isn't listed, see Troubleshooting managed node availability for troubleshooting tips. 8. For Other parameters: • For Comment, enter information about this command. • For Timeout (seconds), specify the number of seconds for the system to wait before failing the overall command execution. 9. For Rate control: • For Concurrency, specify either a number or a percentage of managed nodes on which to run the command at the same time. Note If you selected targets by specifying tags applied to managed nodes or by specifying AWS resource groups, and you aren't certain how many managed nodes are targeted, then restrict the number of targets that can run the document at the same time by specifying a percentage. • For Error threshold, specify when to stop running the command on other managed nodes after it fails on either a number or a percentage of nodes. For example, if you specify three errors, then Systems Manager stops sending the command when the fourth error is received. Managed nodes still processing the command might also send errors. 10. (Optional) For Output options, to save the command output to a file, select the Write command output to an S3 bucket box. Enter the bucket and prefix (folder) names in the boxes. Note The S3 permissions that grant the ability to write the data to an S3 bucket are those of the instance profile (for EC2 instances) or IAM service role (hybrid-activated machines) assigned to the instance, not those of the IAM user performing this task. For more information, see Configure instance permissions required for Systems Manager or Create an IAM service role for a hybrid environment. In addition, if the specified S3 Documents 1745 AWS Systems Manager User Guide bucket is in a different AWS account, make sure that the instance profile or IAM service role associated with
|
systems-manager-ug-503
|
systems-manager-ug.pdf
| 503 |
in the boxes. Note The S3 permissions that grant the ability to write the data to an S3 bucket are those of the instance profile (for EC2 instances) or IAM service role (hybrid-activated machines) assigned to the instance, not those of the IAM user performing this task. For more information, see Configure instance permissions required for Systems Manager or Create an IAM service role for a hybrid environment. In addition, if the specified S3 Documents 1745 AWS Systems Manager User Guide bucket is in a different AWS account, make sure that the instance profile or IAM service role associated with the managed node has the necessary permissions to write to that bucket. 11. In the SNS notifications section, if you want notifications sent about the status of the command execution, select the Enable SNS notifications check box. For more information about configuring Amazon SNS notifications for Run Command, see Monitoring Systems Manager status changes using Amazon SNS notifications. 12. Choose Run. Note For information about rebooting servers and instances when using Run Command to call scripts, see Handling reboots when running commands. Sharing SSM documents You can share AWS Systems Manager (SSM) documents privately or publicly with accounts in the same AWS Region. To privately share a document, you modify the document permissions and allow specific individuals to access it according to their AWS account ID. To publicly share an SSM document, you modify the document permissions and specify All. Documents can't be simultaneously shared publicly and privately. Warning Use shared SSM documents only from trusted sources. When using any shared document, carefully review the contents of the document before using it so that you understand how it will change the configuration of your instance. For more information about shared document best practices, see Best practices for shared SSM documents. Limitations As you begin working with SSM documents, be aware of the following limitations. • Only the owner can share a document. Documents 1746 AWS Systems Manager User Guide • You must stop sharing a document before you can delete it. For more information, see Modify permissions for a shared SSM document. • You can share a document with a maximum of 1000 AWS accounts. You can request an increase to this limit in the Support Center. For Limit type, choose EC2 Systems Manager and describe your reason for the request. • You can publicly share a maximum of five SSM documents. You can request an increase to this limit in the Support Center. For Limit type, choose EC2 Systems Manager and describe your reason for the request. • Documents can be shared with other accounts in the same AWS Region only. Cross-Region sharing isn't supported. Important In Systems Manager, an Amazon-owned SSM document is a document created and managed by Amazon Web Services itself. Amazon-owned documents include a prefix like AWS-* in the document name. The owner of the document is considered to be Amazon, not a specific user account within AWS. These documents are publicly available for all to use. For more information about Systems Manager service quotas, see AWS Systems Manager Service Quotas. Contents • Best practices for shared SSM documents • Block public sharing for SSM documents • Share an SSM document • Modify permissions for a shared SSM document • Using shared SSM documents Best practices for shared SSM documents Review the following guidelines before you share or use a shared document. Documents 1747 AWS Systems Manager Remove sensitive information User Guide Review your AWS Systems Manager (SSM) document carefully and remove any sensitive information. For example, verify that the document doesn't include your AWS credentials. If you share a document with specific individuals, those users can view the information in the document. If you share a document publicly, anyone can view the information in the document. Block public sharing for documents Review all publicly shared SSM documents in your account and confirm whether you want to continue sharing them. To stop sharing a document with the public, you must modify the document permission setting as described in the Modify permissions for a shared SSM document section of this topic. Turning on the block public sharing setting doesn't affect any documents you're currently sharing with the public. Unless your use case requires you to share documents with the public, we recommend turning on the block public sharing setting for your SSM documents in the Preferences section of the Systems Manager Documents console. Turning on this setting prevents unwanted access to your SSM documents. The block public sharing setting is an account level setting that can differ for each AWS Region. Restrict Run Command actions using an IAM trust policy Create a restrictive AWS Identity and Access Management (IAM) policy for users who will have access to the document. The IAM policy determines which SSM documents
|
systems-manager-ug-504
|
systems-manager-ug.pdf
| 504 |
the public. Unless your use case requires you to share documents with the public, we recommend turning on the block public sharing setting for your SSM documents in the Preferences section of the Systems Manager Documents console. Turning on this setting prevents unwanted access to your SSM documents. The block public sharing setting is an account level setting that can differ for each AWS Region. Restrict Run Command actions using an IAM trust policy Create a restrictive AWS Identity and Access Management (IAM) policy for users who will have access to the document. The IAM policy determines which SSM documents a user can see in either the Amazon Elastic Compute Cloud (Amazon EC2) console or by calling ListDocuments using the AWS Command Line Interface (AWS CLI) or AWS Tools for Windows PowerShell. The policy also restricts the actions the user can perform with SSM documents. You can create a restrictive policy so that a user can only use specific documents. For more information, see Customer managed policy examples. Use caution when using shared SSM documents Review the contents of every document that is shared with you, especially public documents, to understand the commands that will be run on your instances. A document could intentionally or unintentionally have negative repercussions after it's run. If the document references an external network, review the external source before you use the document. Send commands using the document hash When you share a document, the system creates a Sha-256 hash and assigns it to the document. The system also saves a snapshot of the document content. When you send a command using a shared document, you can specify the hash in your command to ensure that the following conditions are true: Documents 1748 AWS Systems Manager User Guide • You're running a command from the correct Systems Manager document • The content of the document hasn't changed since it was shared with you. If the hash doesn't match the specified document or if the content of the shared document has changed, the command returns an InvalidDocument exception. The hash can't verify document content from external locations. Block public sharing for SSM documents Before you begin, review all publicly shared SSM documents in your AWS account and confirm whether you want to continue sharing them. To stop sharing an SSM document with the public, you must modify the document permission setting as described in the Modify permissions for a shared SSM document section of this topic. Turning on the block public sharing setting doesn't affect any SSM documents you're currently sharing with the public. With the block public sharing setting enabled, you won’t be able to share any additional SSM documents with the public. Unless your use case requires you to share documents with the public, we recommend turning on the block public sharing setting for your SSM documents. Turning on this setting prevents unwanted access to your SSM documents. The block public sharing setting is an account level setting that can differ for each AWS Region. Complete the following tasks to block public sharing for any SSM documents you're not currently sharing. Block public sharing (console) To block public sharing of your SSM documents 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Documents. 3. Choose Preferences, and then choose Edit in the Block public sharing section. 4. Select the Block public sharing check box, and then choose Save. Block public sharing (command line) Open the AWS Command Line Interface (AWS CLI) or AWS Tools for Windows PowerShell on your local computer and run the following command to block public sharing of your SSM documents. Documents 1749 AWS Systems Manager Linux & macOS User Guide aws ssm update-service-setting \ --setting-id /ssm/documents/console/public-sharing-permission \ --setting-value Disable \ --region 'The AWS Region you want to block public sharing in' Windows aws ssm update-service-setting ^ --setting-id /ssm/documents/console/public-sharing-permission ^ --setting-value Disable ^ --region "The AWS Region you want to block public sharing in" PowerShell Update-SSMServiceSetting ` -SettingId /ssm/documents/console/public-sharing-permission ` -SettingValue Disable ` –Region The AWS Region you want to block public sharing in Confirm the setting value was updated using the following command. Linux & macOS aws ssm get-service-setting \ --setting-id /ssm/documents/console/public-sharing-permission \ --region The AWS Region you blocked public sharing in Windows aws ssm get-service-setting ^ --setting-id /ssm/documents/console/public-sharing-permission ^ --region "The AWS Region you blocked public sharing in" PowerShell Get-SSMServiceSetting ` -SettingId /ssm/documents/console/public-sharing-permission ` -Region The AWS Region you blocked public sharing in Documents 1750 AWS Systems Manager User Guide Restricting access to block public sharing with IAM You can create AWS Identity and Access Management (IAM) policies that restrict users from modifying the block public sharing setting. This prevents users from allowing unwanted access to your SSM documents. The following is an example of an IAM policy that prevents users from
|
systems-manager-ug-505
|
systems-manager-ug.pdf
| 505 |
--region The AWS Region you blocked public sharing in Windows aws ssm get-service-setting ^ --setting-id /ssm/documents/console/public-sharing-permission ^ --region "The AWS Region you blocked public sharing in" PowerShell Get-SSMServiceSetting ` -SettingId /ssm/documents/console/public-sharing-permission ` -Region The AWS Region you blocked public sharing in Documents 1750 AWS Systems Manager User Guide Restricting access to block public sharing with IAM You can create AWS Identity and Access Management (IAM) policies that restrict users from modifying the block public sharing setting. This prevents users from allowing unwanted access to your SSM documents. The following is an example of an IAM policy that prevents users from updating the block public sharing setting. To use this example, you must replace the example Amazon Web Services account ID with your own account ID. { "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": "ssm:UpdateServiceSetting", "Resource": "arn:aws:ssm:*:987654321098:servicesetting/ssm/documents/ console/public-sharing-permission" } ] } Share an SSM document You can share AWS Systems Manager (SSM) documents by using the Systems Manager console. When sharing documents from the console, only the default version of the document can be shared. You can also share SSM documents programmatically by calling the ModifyDocumentPermission API operation using the AWS Command Line Interface (AWS CLI), AWS Tools for Windows PowerShell, or the AWS SDK. Before you share a document, get the AWS account IDs of the people with whom you want to share. You will specify these account IDs when you share the document. Share a document (console) 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Documents. In the documents list, choose the document you want to share, and then choose View details. On the Permissions tab, verify that you're the document owner. Only a document owner can share a document. Documents 1751 AWS Systems Manager 4. Choose Edit. User Guide 5. To share the command publicly, choose Public and then choose Save. To share the command privately, choose Private, enter the AWS account ID, choose Add permission, and then choose Save. Share a document (command line) The following procedure requires that you specify an AWS Region for your command line session. 1. Open the AWS CLI or AWS Tools for Windows PowerShell on your local computer and run the following command to specify your credentials. In the following command, replace region with your own information. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. Linux & macOS aws config AWS Access Key ID: [your key] AWS Secret Access Key: [your key] Default region name: region Default output format [None]: Windows aws config AWS Access Key ID: [your key] AWS Secret Access Key: [your key] Default region name: region Default output format [None]: PowerShell Set-AWSCredentials –AccessKey your key –SecretKey your key Set-DefaultAWSRegion -Region region Documents 1752 AWS Systems Manager User Guide 2. Use the following command to list all of the SSM documents that are available for you. The list includes documents that you created and documents that were shared with you. Linux & macOS aws ssm list-documents Windows aws ssm list-documents PowerShell Get-SSMDocumentList 3. Use the following command to get a specific document. Linux & macOS aws ssm get-document \ --name document name Windows aws ssm get-document ^ --name document name PowerShell Get-SSMDocument ` –Name document name 4. Use the following command to get a description of the document. Linux & macOS aws ssm describe-document \ --name document name Documents 1753 User Guide AWS Systems Manager Windows aws ssm describe-document ^ --name document name PowerShell Get-SSMDocumentDescription ` –Name document name 5. Use the following command to view the permissions for the document. Linux & macOS aws ssm describe-document-permission \ --name document name \ --permission-type Share Windows aws ssm describe-document-permission ^ --name document name ^ --permission-type Share PowerShell Get-SSMDocumentPermission ` –Name document name ` -PermissionType Share 6. Use the following command to modify the permissions for the document and share it. You must be the owner of the document to edit the permissions. Optionally, for documents shared with specific AWS account IDs, you can specify a version of the document you want to share using the --shared-document-version parameter. If you don't specify a version, the system shares the Default version of the document. If you share a document publicly (with all), all versions of the specified document are shared by default. The following example command privately shares the document with a specific individual, based on that person's AWS account ID. Documents 1754 AWS Systems Manager Linux & macOS User Guide aws ssm modify-document-permission \ --name document name \ --permission-type Share \ --account-ids-to-add AWS account ID Windows aws ssm modify-document-permission ^ --name document name ^ --permission-type Share ^ --account-ids-to-add AWS account ID PowerShell Edit-SSMDocumentPermission ` –Name document name ` -PermissionType Share ` -AccountIdsToAdd AWS account ID 7.
|
systems-manager-ug-506
|
systems-manager-ug.pdf
| 506 |
shares the Default version of the document. If you share a document publicly (with all), all versions of the specified document are shared by default. The following example command privately shares the document with a specific individual, based on that person's AWS account ID. Documents 1754 AWS Systems Manager Linux & macOS User Guide aws ssm modify-document-permission \ --name document name \ --permission-type Share \ --account-ids-to-add AWS account ID Windows aws ssm modify-document-permission ^ --name document name ^ --permission-type Share ^ --account-ids-to-add AWS account ID PowerShell Edit-SSMDocumentPermission ` –Name document name ` -PermissionType Share ` -AccountIdsToAdd AWS account ID 7. Use the following command to share a document publicly. Note If you share a document publicly (with all), all versions of the specified document are shared by default. Linux & macOS aws ssm modify-document-permission \ --name document name \ --permission-type Share \ --account-ids-to-add 'all' Windows aws ssm modify-document-permission ^ Documents 1755 AWS Systems Manager User Guide --name document name ^ --permission-type Share ^ --account-ids-to-add "all" PowerShell Edit-SSMDocumentPermission ` -Name document name ` -PermissionType Share ` -AccountIdsToAdd ('all') Modify permissions for a shared SSM document If you share a command, users can view and use that command until you either remove access to the AWS Systems Manager (SSM) document or delete the SSM document. However, you can't delete a document as long as it's shared. You must stop sharing it first and then delete it. Stop sharing a document (console) Stop sharing a document 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Documents. In the documents list, choose the document you want to stop sharing, and then choose the Details. In the Permissions section, verify that you're the document owner. Only a document owner can stop sharing a document. 4. Choose Edit. 5. Choose X to delete the AWS account ID that should no longer have access to the command, and then choose Save. Stop sharing a document (command line) Open the AWS CLI or AWS Tools for Windows PowerShell on your local computer and run the following command to stop sharing a command. Documents 1756 User Guide AWS Systems Manager Linux & macOS aws ssm modify-document-permission \ --name document name \ --permission-type Share \ --account-ids-to-remove 'AWS account ID' Windows aws ssm modify-document-permission ^ --name document name ^ --permission-type Share ^ --account-ids-to-remove "AWS account ID" PowerShell Edit-SSMDocumentPermission ` -Name document name ` -PermissionType Share ` –AccountIdsToRemove AWS account ID Using shared SSM documents When you share an AWS Systems Manager (SSM) document, the system generates an Amazon Resource Name (ARN) and assigns it to the command. If you select and run a shared document from the Systems Manager console, you don't see the ARN. However, if you want to run a shared SSM document using a method other than the Systems Manager console, you must specify the full ARN of the document for the DocumentName request parameter. You're shown the full ARN for an SSM document when you run the command to list documents. Note You aren't required to specify ARNs for AWS public documents (documents that begin with AWS-*) or documents that you own. Use a shared SSM document (command line) To list all public SSM documents Documents 1757 User Guide AWS Systems Manager Linux & macOS aws ssm list-documents \ --filters Key=Owner,Values=Public Windows aws ssm list-documents ^ --filters Key=Owner,Values=Public PowerShell $filter = New-Object Amazon.SimpleSystemsManagement.Model.DocumentKeyValuesFilter $filter.Key = "Owner" $filter.Values = "Public" Get-SSMDocumentList ` -Filters @($filter) To list private SSM documents that have been shared with you Linux & macOS aws ssm list-documents \ --filters Key=Owner,Values=Private Windows aws ssm list-documents ^ --filters Key=Owner,Values=Private PowerShell $filter = New-Object Amazon.SimpleSystemsManagement.Model.DocumentKeyValuesFilter $filter.Key = "Owner" $filter.Values = "Private" Get-SSMDocumentList ` -Filters @($filter) Documents 1758 AWS Systems Manager User Guide To list all SSM documents available to you Linux & macOS aws ssm list-documents Windows aws ssm list-documents PowerShell Get-SSMDocumentList To get information about an SSM document that has been shared with you Linux & macOS aws ssm describe-document \ --name arn:aws:ssm:us-east-2:12345678912:document/documentName Windows aws ssm describe-document ^ --name arn:aws:ssm:us-east-2:12345678912:document/documentName PowerShell Get-SSMDocumentDescription ` –Name arn:aws:ssm:us-east-2:12345678912:document/documentName To run a shared SSM document Linux & macOS aws ssm send-command \ --document-name arn:aws:ssm:us-east-2:12345678912:document/documentName \ --instance-ids ID Documents 1759 AWS Systems Manager Windows User Guide aws ssm send-command ^ --document-name arn:aws:ssm:us-east-2:12345678912:document/documentName ^ --instance-ids ID PowerShell Send-SSMCommand ` –DocumentName arn:aws:ssm:us-east-2:12345678912:document/documentName ` –InstanceIds ID Searching for SSM documents You can search the AWS Systems Manager (SSM) document store for SSM documents by using either free text search or a filter-based search. You can also favorite documents to help you find frequently used SSM documents. The following sections describes how to use these features. Using free text search The search box on the Systems Manager Documents page supports free text search. Free text search compares the search term or terms that you enter against the
|
systems-manager-ug-507
|
systems-manager-ug.pdf
| 507 |
Windows User Guide aws ssm send-command ^ --document-name arn:aws:ssm:us-east-2:12345678912:document/documentName ^ --instance-ids ID PowerShell Send-SSMCommand ` –DocumentName arn:aws:ssm:us-east-2:12345678912:document/documentName ` –InstanceIds ID Searching for SSM documents You can search the AWS Systems Manager (SSM) document store for SSM documents by using either free text search or a filter-based search. You can also favorite documents to help you find frequently used SSM documents. The following sections describes how to use these features. Using free text search The search box on the Systems Manager Documents page supports free text search. Free text search compares the search term or terms that you enter against the document name in each SSM document. If you enter a single search term, for example ansible, then Systems Manager returns all SSM documents where this term was discovered. If you enter multiple search terms, then Systems Manager searches by using an OR statement. For example, if you specify ansible and linux, then search returns all documents with either keyword in their name. If you enter a free text search term and choose a search option, such as Platform type, then search uses an AND statement and returns all documents with the keyword in their name and the specified platform type. Note Note the following details about free text search. • Free text search is not case sensitive. • Search terms require a minimum of three characters and have a maximum of 20 characters. Documents 1760 AWS Systems Manager User Guide • Free text search accepts up to five search terms. • If you enter a space between search terms, the system includes the space when searching. • You can combine free text search with other search options such as Document type or Platform type. • The Document Name Prefix filter and free text search can't be used together. they're mutually exclusive. To search for an SSM document 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Documents. Enter your search terms in the search box, and press Enter. Performing free text document search by using the AWS CLI To perform a free text document search by using the CLI 1. Install and configure the AWS Command Line Interface (AWS CLI), if you haven't already. For information, see Installing or updating the latest version of the AWS CLI. 2. To perform free text document search with a single term, run the following command. In this command, replace search_term with your own information. aws ssm list-documents --filters Key="SearchKeyword",Values="search_term" Here's an example. aws ssm list-documents --filters Key="SearchKeyword",Values="aws-asg" --region us- east-2 To search using multiple terms that create an AND statement, run the following command. In this command, replace search_term_1 and search_term_2 with your own information. Documents 1761 AWS Systems Manager User Guide aws ssm list-documents --filters Key="SearchKeyword",Values="search_term_1","search_term_2","search_term_3" -- region us-east-2 Here's an example. aws ssm list-documents --filters Key="SearchKeyword",Values="aws-asg","aws- ec2","restart" --region us-east-2 Using filters The Systems Manager Documents page automatically displays the following filters when you choose the search box. • Document name prefix • Platform types • Document type • Tag key Documents 1762 AWS Systems Manager User Guide You can search for SSM documents by using a single filter. If you want to return a more specific set of SSM documents, you can apply multiple filters. Here is an example of a search that uses the Platform types and the Document name prefix filters. If you apply multiple filters, Systems Manager creates different search statements based on the filters you choose: • If you apply the same filter multiple times, for example Document name prefix, then Systems Manager searches by using an OR statement. For example, if you specify one filter of Document name prefix=AWS and a second filter of Document name prefix=Lambda, then search returns all documents with the prefix "AWS" and all documents with the prefix "Lambda". • If you apply different filters, for example Document name prefix and Platform types, then Systems Manager searches by using an AND statement. For example, if you specify a Document name prefix=AWS filter and a Platform types=Linux filter, then search returns all documents with the prefix "AWS" that are specific to the Linux platform. Note Searches that use filters are case sensitive. Adding documents to your favorites To help you find frequently used SSM documents, add documents to your favorites. You can favorite up to 20 documents per document type, per AWS account and AWS Region. You can choose, modify, and view your favorites from the documents AWS Management Console. The following procedures describe how to choose, modify, and view your favorites. Documents 1763 AWS Systems Manager To favorite an SSM document User Guide 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Documents. Select the star icon next to the document name you want to favorite. 2. 3.
|
systems-manager-ug-508
|
systems-manager-ug.pdf
| 508 |
your favorites To help you find frequently used SSM documents, add documents to your favorites. You can favorite up to 20 documents per document type, per AWS account and AWS Region. You can choose, modify, and view your favorites from the documents AWS Management Console. The following procedures describe how to choose, modify, and view your favorites. Documents 1763 AWS Systems Manager To favorite an SSM document User Guide 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Documents. Select the star icon next to the document name you want to favorite. 2. 3. To remove an SSM document from your favorites 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Documents. 3. Deselect the star icon next to the document name you want to remove from your favorites. To view your favorites from the documents AWS Management Console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Documents. Select the Favorites tab. AWS Systems Manager Maintenance Windows Maintenance Windows, a tool in AWS Systems Manager, helps you define a schedule for when to perform potentially disruptive actions on your nodes such as patching an operating system, updating drivers, or installing software or patches. Note State Manager and Maintenance Windows can perform some similar types of updates on your managed nodes. Which one you choose depends on whether you need to automate system compliance or perform high-priority, time-sensitive tasks during periods you specify. For more information, see Choosing between State Manager and Maintenance Windows. Maintenance Windows 1764 AWS Systems Manager User Guide With Maintenance Windows, you can schedule actions on numerous other AWS resource types, such as Amazon Simple Storage Service (Amazon S3) buckets, Amazon Simple Queue Service (Amazon SQS) queues, AWS Key Management Service (AWS KMS) keys, and many more. For a full list of supported resource types that you can include in a maintenance window target, see Resources you can use with AWS Resource Groups and Tag Editor in the AWS Resource Groups User Guide. To get started with Maintenance Windows, open the Systems Manager console. In the navigation pane, choose Maintenance Windows. Each maintenance window has a schedule, a maximum duration, a set of registered targets (the managed nodes or other AWS resources that are acted upon), and a set of registered tasks. You can add tags to your maintenance windows when you create or update them. (Tags are keys that help identify and sort your resources within your organization.) You can also specify dates that a maintenance window shouldn't run before or after, and you can specify the international time zone on which to base the maintenance window schedule. For an explanation of how the various schedule-related options for maintenance windows relate to one another, see Maintenance window scheduling and active period options. For more information about working with the --schedule option, see Reference: Cron and rate expressions for Systems Manager. Supported task types With maintenance windows, you can run four types of tasks: • Commands in Run Command, a tool in Systems Manager For more information about Run Command, see AWS Systems Manager Run Command. • Workflows in Automation, a tool in Systems Manager For more information about Automation workflows, see AWS Systems Manager Automation. • Functions in AWS Lambda For more information about Lambda functions, see Getting started with Lambda in the AWS Lambda Developer Guide. • Tasks in AWS Step Functions Maintenance Windows 1765 AWS Systems Manager Note User Guide Maintenance window tasks support Step Functions Standard state machine workflows only. They don't support Express state machine workflows. For information about state machine workflow types, see Standard vs. Express Workflows in the AWS Step Functions Developer Guide. For more information about Step Functions, see the AWS Step Functions Developer Guide. This means you can use maintenance windows to perform tasks such as the following on your selected targets. • Install or update applications. • Apply patches. • Install or update SSM Agent. • Run PowerShell commands and Linux shell scripts by using a Systems Manager Run Command task. • Build Amazon Machine Images (AMIs), boot-strap software, and configure nodes by using a Systems Manager Automation task. • Run AWS Lambda functions that invokes additional actions, such as scanning your nodes for patch updates. • Run AWS Step Functions state machines to perform tasks such as removing a node from an Elastic Load Balancing environment, patching the node, and then adding the node back to the Elastic Load Balancing environment. • Target nodes that are offline by specifying an AWS resource group as the target. Note One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation,
|
systems-manager-ug-509
|
systems-manager-ug.pdf
| 509 |
Systems Manager Automation task. • Run AWS Lambda functions that invokes additional actions, such as scanning your nodes for patch updates. • Run AWS Step Functions state machines to perform tasks such as removing a node from an Elastic Load Balancing environment, patching the node, and then adding the node back to the Elastic Load Balancing environment. • Target nodes that are offline by specifying an AWS resource group as the target. Note One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, AWS Lambda, and AWS Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets. Maintenance Windows 1766 AWS Systems Manager EventBridge support User Guide This Systems Manager tool is supported as an event type in Amazon EventBridge rules. For information, see Monitoring Systems Manager events with Amazon EventBridge and Reference: Amazon EventBridge event patterns and types for Systems Manager. Contents • Setting up Maintenance Windows • Create and manage maintenance windows using the console • Tutorials • Using pseudo parameters when registering maintenance window tasks • Maintenance window scheduling and active period options • Registering maintenance window tasks without targets • Troubleshooting maintenance windows Setting up Maintenance Windows Before users in your AWS account can create and schedule maintenance window tasks using Maintenance Windows, a tool in AWS Systems Manager, they must be granted the necessary permissions. In addition, you must create an IAM service role for maintenance windows and the IAM policy to attach to it. Before you begin In addition to the permissions you configure in this section, the IAM Entities (users, roles, or groups that will work with maintenance windows should already have general maintenance window permissions. You can grant these permissions by assigning the IAM policy AmazonSSMFullAccess to the Entities, or assigning a custom IAM policy that provides a smaller set of access permissions for Systems Manager that covers maintenance window tasks. Topics • Control access to maintenance windows using the console • Control access to maintenance windows using the AWS CLI Maintenance Windows 1767 AWS Systems Manager User Guide Control access to maintenance windows using the console The following procedures describe how to use the AWS Systems Manager console to create the required permissions and roles for maintenance windows. Topics • Task 1: Create a custom policy for your maintenance window service role using the console • Task 2: Create a custom service role for maintenance windows using the console • Task 3: Grant permissions to specified users to register maintenance window tasks using the console • Task 4: Prevent specified users from registering maintenance window tasks using the console Task 1: Create a custom policy for your maintenance window service role using the console Maintenance window tasks require an IAM role to provide the permissions required to run on the target resources. The permissions are provided through an IAM policy attached to the role. The types of tasks you run and your other operational requirements determine the contents of this policy. We provide a base policy you can adapt to your needs. Depending on the tasks and types of tasks your maintenance windows run, you might not need all the permissions in this policy, and you might need to include additional permissions. You attach this policy to the role that you create later in Task 2: Create a custom service role for maintenance windows using the console. To create a custom policy using the console 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. 3. In the navigation pane, choose Policies, and then choose Create policy. In the Policy editor area, choose JSON. 4. Replace the default contents with the following: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:SendCommand", "ssm:CancelCommand", "ssm:ListCommands", Maintenance Windows 1768 AWS Systems Manager User Guide "ssm:ListCommandInvocations", "ssm:GetCommandInvocation", "ssm:GetAutomationExecution", "ssm:StartAutomationExecution", "ssm:ListTagsForResource", "ssm:DescribeInstanceInformation", "ssm:GetParameters" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "states:DescribeExecution", "states:StartExecution" ], "Resource": [ "arn:aws:states:*:*:execution:*:*", "arn:aws:states:*:*:stateMachine:*" ] }, { "Effect": "Allow", "Action": [ "lambda:InvokeFunction" ], "Resource": [ "arn:aws:lambda:*:*:function:*" ] }, { "Effect": "Allow", "Action": [ "resource-groups:ListGroups", "resource-groups:ListGroupResources" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "tag:GetResources" Maintenance Windows 1769 AWS Systems Manager User Guide ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": "iam:PassRole", "Resource": "*", "Condition": { "StringEquals": { "iam:PassedToService": [ "ssm.amazonaws.com" ] } } } ] } 5. Modify the JSON content as needed for the maintenance tasks that you run in your account. The changes you make are specific to your planned operations. For example: • You can provide Amazon Resource Names (ARNs) for specific functions and state machines instead of using wildcard (*) qualifiers. • If you don’t plan to run AWS Step Functions tasks, you can remove the
|
systems-manager-ug-510
|
systems-manager-ug.pdf
| 510 |
[ "tag:GetResources" Maintenance Windows 1769 AWS Systems Manager User Guide ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": "iam:PassRole", "Resource": "*", "Condition": { "StringEquals": { "iam:PassedToService": [ "ssm.amazonaws.com" ] } } } ] } 5. Modify the JSON content as needed for the maintenance tasks that you run in your account. The changes you make are specific to your planned operations. For example: • You can provide Amazon Resource Names (ARNs) for specific functions and state machines instead of using wildcard (*) qualifiers. • If you don’t plan to run AWS Step Functions tasks, you can remove the states permissions and (ARNs). • If you don’t plan to run AWS Lambda tasks, you can remove the lambda permissions and ARNs. • If you don't plan to run Automation tasks, you can remove the ssm:GetAutomationExecution and ssm:StartAutomationExecution permissions. • Add additional permissions that might be needed for the tasks to run. For example, some Automation actions work with AWS CloudFormation stacks. Therefore, the permissions cloudformation:CreateStack, cloudformation:DescribeStacks, and cloudformation:DeleteStack are required. Maintenance Windows 1770 AWS Systems Manager User Guide For another example, the Automation runbook AWS-CopySnapshot requires permissions to create an Amazon Elastic Block Store (Amazon EBS) snapshot. Therefore, the service role needs the permission ec2:CreateSnapshot. For information about the role permissions needed by Automation runbooks, see the runbook descriptions in the AWS Systems Manager Automation runbook reference. 6. After completing the policy revisions, choose Next. 7. 8. For Policy name, enter a name that identifies this as the policy attached to the service role you create. For example: my-maintenance-window-role-policy. (Optional) In the Add tags area, add one or more tag-key value pairs to organize, track, or control access for this policy. 9. Choose Create policy. Make a note of the name you specified for the policy. You refer to it in the next procedure, Task 2: Create a custom service role for maintenance windows using the console. Task 2: Create a custom service role for maintenance windows using the console The policy you created in the previous task is attached to the maintenance window service role you create in this task. When users register a maintenance window task, they specify this IAM role as part of the task configuration. The permissions in this role allow Systems Manager to run tasks in maintenance windows on your behalf. Important Previously, the Systems Manager console provided you with the ability to choose the AWS managed IAM service-linked role AWSServiceRoleForAmazonSSM to use as the maintenance role for your tasks. Using this role and its associated policy, AmazonSSMServiceRolePolicy, for maintenance window tasks is no longer recommended. If you're using this role for maintenance window tasks now, we encourage you to stop using it. Instead, create your own IAM role that enables communication between Systems Manager and other AWS services when your maintenance window tasks run. Maintenance Windows 1771 AWS Systems Manager User Guide Use the following procedure to create a custom service role for Maintenance Windows, so that Systems Manager can run Maintenance Windows tasks on your behalf. You attach the policy you created in the previous task to the custom service role you create. To create a custom service role for maintenance windows using the console 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. 3. In the navigation pane, choose Roles, and then choose Create role. For Select trusted entity, make the following choices: 1. For Trusted entity type, choose AWS service. 2. For Use case, choose Systems Manager 3. Choose Systems Manager. The following image highlights the location of the Systems Manager option. 4. Choose Next. 5. 6. 7. 8. In the Permissions policies area, in the search box, enter the name of the policy you created in Task 1: Create a custom policy for your maintenance window service role using the console, select the box next to its name, and then choose Next. For Role name, enter a name that identifies this role as a Maintenance Windows role. For example: my-maintenance-window-role. (Optional) Change the default role description to reflect the purpose of this role. For example: Performs maintenance window tasks on your behalf. For Step 1: Select trusted entities, verify that the following policy is displayed in the Trusted policy box. Maintenance Windows 1772 AWS Systems Manager User Guide { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } 9. For Step 2: Add permissions, verify that policy you created in Task 1: Create a custom policy for your maintenance window service role using the console is present. 10. (Optional) In Step 3: Add tags, add one or more tag-key value pairs to organize, track, or control access for this role. 11. Choose Create role. The system returns you to the Roles page. 12. Choose the name of the IAM role
|
systems-manager-ug-511
|
systems-manager-ug.pdf
| 511 |
Maintenance Windows 1772 AWS Systems Manager User Guide { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } 9. For Step 2: Add permissions, verify that policy you created in Task 1: Create a custom policy for your maintenance window service role using the console is present. 10. (Optional) In Step 3: Add tags, add one or more tag-key value pairs to organize, track, or control access for this role. 11. Choose Create role. The system returns you to the Roles page. 12. Choose the name of the IAM role you just created. 13. Copy or make a note of the role name and the ARN value in the Summary area. Users in your account specify this information when they create maintenance windows. Task 3: Grant permissions to specified users to register maintenance window tasks using the console Providing users with permissions to access the custom service role for maintenance windows lets them use it with their maintenance windows tasks. This is in addition to permissions that you’ve already given them to work with the Systems Manager API commands for the Maintenance Windows tool. This IAM role conveys the permissions need to run a maintenance window task. As a result, a user can't register tasks with a maintenance window using your custom service role without the ability to pass these IAM permissions. When you register a task with a maintenance window, you specify a service role to run the actual task operations. This is the role that the service assumes when it runs tasks on your behalf. Before that, to register the task itself, assign the IAM PassRole policy to an IAM entity (such as a user or group). This allows the IAM entity to specify, as part of registering those tasks with the Maintenance Windows 1773 AWS Systems Manager User Guide maintenance window, the role that should be used when running tasks. For information, see Grant a user permissions to pass a role to an AWS service in the IAM User Guide. To configure permissions to allow users to register maintenance window tasks If an IAM entity (user, role, or group) is set up with administrator permissions, then the IAM user or role has access to Maintenance Windows. For IAM entities without administrator permissions, an administrator must grant the following permissions to the IAM entity. These are the minimum permissions required to register tasks with a maintenance window: • The AmazonSSMFullAccess managed policy, or a policy that provides comparable permissions. • The following iam:PassRole and iam:ListRolespermissions. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws:iam::account-id:role/my-maintenance-window-role" }, { "Effect": "Allow", "Action": "iam:ListRoles", "Resource": "arn:aws:iam::account-id:role/" }, { "Effect": "Allow", "Action": "iam:ListRoles", "Resource": "arn:aws:iam::account-id:role/aws-service-role/ ssm.amazonaws.com/" } ] } my-maintenance-window-role represents the name of the custom maintenance window service role you created earlier. account-id represents the ID of your AWS account. Adding this permission for the resource arn:aws:iam::account-id:role/ allows a user to view and choose from customer roles in the console when they create a maintenance window task. Adding this permission for Maintenance Windows 1774 AWS Systems Manager User Guide arn:aws:iam::account-id:role/aws-service-role/ssm.amazonaws.com/ allows a user to choose the Systems Manager service-linked role in the console when they create a maintenance window task. To provide access, add permissions to your users, groups, or roles: • Users and groups in AWS IAM Identity Center: Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity Center User Guide. • Users managed in IAM through an identity provider: Create a role for identity federation. Follow the instructions in Create a role for a third-party identity provider (federation) in the IAM User Guide. • IAM users: • Create a role that your user can assume. Follow the instructions in Create a role for an IAM user in the IAM User Guide. • (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the instructions in Adding permissions to a user (console) in the IAM User Guide. To configure permissions for groups that are allowed to register maintenance window tasks using the console 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. 3. In the navigation pane, choose User groups. In the list of groups, select the name of the group you want to assign the iam:PassRole permission to, or first create a new group if necessary 4. On the Permissions tab, choose Add permissions, Create inline policy. 5. In the Policy editor area, choose JSON, and replace the default contents of the box with the following. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws:iam::account-id:role/my-maintenance-window-role" Maintenance Windows 1775 AWS Systems Manager }, User Guide { "Effect": "Allow", "Action": "iam:ListRoles", "Resource": "arn:aws:iam::account-id:role/" }, { "Effect": "Allow", "Action": "iam:ListRoles", "Resource": "arn:aws:iam::account-id:role/aws-service-role/
|
systems-manager-ug-512
|
systems-manager-ug.pdf
| 512 |
In the navigation pane, choose User groups. In the list of groups, select the name of the group you want to assign the iam:PassRole permission to, or first create a new group if necessary 4. On the Permissions tab, choose Add permissions, Create inline policy. 5. In the Policy editor area, choose JSON, and replace the default contents of the box with the following. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws:iam::account-id:role/my-maintenance-window-role" Maintenance Windows 1775 AWS Systems Manager }, User Guide { "Effect": "Allow", "Action": "iam:ListRoles", "Resource": "arn:aws:iam::account-id:role/" }, { "Effect": "Allow", "Action": "iam:ListRoles", "Resource": "arn:aws:iam::account-id:role/aws-service-role/ ssm.amazonaws.com/" } ] } my-maintenance-window-role represents the name of the custom maintenance window role you created earlier. account-id represents the ID of your AWS account. Adding this permission for the resource arn:aws:iam::account-id:role/ allows a user to view and choose from customer roles in the console when they create a maintenance window task. Adding this permission for arn:aws:iam::account-id:role/aws-service-role/ssm.amazonaws.com/ allows a user to choose the Systems Manager service-linked role in the console when they create a maintenance window task. 6. Choose Next. 7. On the Review and create page, enter a name in the Policy name box to identify this PassRole policy, such as my-group-iam-passrole-policy, and then choose Create policy. Task 4: Prevent specified users from registering maintenance window tasks using the console You can deny the ssm:RegisterTaskWithMaintenanceWindow permission for the users in your AWS account who you don't want to register tasks with maintenance windows. This provides an extra layer of prevention for users who shouldn’t register maintenance window tasks. To configure permissions for groups that aren't allowed to register maintenance window tasks using the console 1. Open the IAM console at https://console.aws.amazon.com/iam/. Maintenance Windows 1776 AWS Systems Manager User Guide 2. 3. In the navigation pane, choose User groups. In the list of groups, select the name of the group you want to deny the ssm:RegisterTaskWithMaintenanceWindow permission from, or first create a new group if necessary. 4. On the Permissions tab, choose Add permissions, Create inline policy. 5. In the Policy editor area, choose JSON, and then replace the default contents of the box with the following. { "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": "ssm:RegisterTaskWithMaintenanceWindow", "Resource": "*" } ] } 6. Choose Next. 7. On the Review and create page, for Policy name, enter a name to identify this policy, such as my-groups-deny-mw-tasks-policy, and then choose Create policy. Control access to maintenance windows using the AWS CLI The following procedures describe how to use the AWS Command Line Interface (AWS CLI) to create the required permissions and roles for Maintenance Windows, a tool in AWS Systems Manager. Topics • Task 1: Create trust policy and customer managed policy files in JSON format • Task 2: Create and verify a custom service role for maintenance windows using the AWS CLI • Task 3: Grant permissions to specified users to register maintenance window tasks using the AWS CLI • Task 4: Prevent specified users from registering maintenance window tasks using the AWS CLI Maintenance Windows 1777 AWS Systems Manager User Guide Task 1: Create trust policy and customer managed policy files in JSON format Maintenance window tasks require an IAM role to provide the permissions required to run on the target resources. The permissions are provided through an IAM policy attached to the role. The types of tasks you run and your other operational requirements determine the contents of this policy. We provide a base policy you can adapt to your needs. Depending on the tasks and types of tasks your maintenance windows run, you might not need all the permissions in this policy, and you might need to include additional permissions. In this task, you specify the permissions needed for your custom maintenance window role in a pair of JSON files. You attach this policy to the role that you create later in Task 2: Create and verify a custom service role for maintenance windows using the AWS CLI. To create trust policy and customer managed policy files 1. Copy and paste the following trust policy into a text file. Save this file with the following name and file extension: mw-role-trust-policy.json. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } 2. Copy and paste the following JSON policy into a different text file. In the same directory where you created the first file, save this file with the following name and file extension: mw-role- custom-policy.json. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:SendCommand", Maintenance Windows 1778 AWS Systems Manager User Guide "ssm:CancelCommand", "ssm:ListCommands", "ssm:ListCommandInvocations", "ssm:GetCommandInvocation", "ssm:GetAutomationExecution", "ssm:StartAutomationExecution", "ssm:ListTagsForResource", "ssm:GetParameters" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "states:DescribeExecution", "states:StartExecution" ], "Resource": [ "arn:aws:states:*:*:execution:*:*", "arn:aws:states:*:*:stateMachine:*" ] }, { "Effect": "Allow", "Action": [ "lambda:InvokeFunction" ], "Resource": [ "arn:aws:lambda:*:*:function:*"
|
systems-manager-ug-513
|
systems-manager-ug.pdf
| 513 |
"Principal": { "Service": "ssm.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } 2. Copy and paste the following JSON policy into a different text file. In the same directory where you created the first file, save this file with the following name and file extension: mw-role- custom-policy.json. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:SendCommand", Maintenance Windows 1778 AWS Systems Manager User Guide "ssm:CancelCommand", "ssm:ListCommands", "ssm:ListCommandInvocations", "ssm:GetCommandInvocation", "ssm:GetAutomationExecution", "ssm:StartAutomationExecution", "ssm:ListTagsForResource", "ssm:GetParameters" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "states:DescribeExecution", "states:StartExecution" ], "Resource": [ "arn:aws:states:*:*:execution:*:*", "arn:aws:states:*:*:stateMachine:*" ] }, { "Effect": "Allow", "Action": [ "lambda:InvokeFunction" ], "Resource": [ "arn:aws:lambda:*:*:function:*" ] }, { "Effect": "Allow", "Action": [ "resource-groups:ListGroups", "resource-groups:ListGroupResources" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ Maintenance Windows 1779 AWS Systems Manager User Guide "tag:GetResources" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": "iam:PassRole", "Resource": "*", "Condition": { "StringEquals": { "iam:PassedToService": [ "ssm.amazonaws.com" ] } } } ] } 3. Modify the the content of mw-role-custom-policy.json as needed for the maintenance tasks that you run in your account. The changes you make are specific to your planned operations. For example: • You can provide Amazon Resource Names (ARNs) for specific functions and state machines instead of using wildcard (*) qualifiers. • If you don’t plan to run AWS Step Functions tasks, you can remove the states permissions and (ARNs). • If you don’t plan to run AWS Lambda tasks, you can remove the lambda permissions and ARNs. • If you don't plan to run Automation tasks, you can remove the ssm:GetAutomationExecution and ssm:StartAutomationExecution permissions. • Add additional permissions that might be needed for the tasks to run. For example, some Automation actions work with AWS CloudFormation stacks. Therefore, the permissions cloudformation:CreateStack, cloudformation:DescribeStacks, and cloudformation:DeleteStack are required. Maintenance Windows 1780 AWS Systems Manager User Guide For another example, the Automation runbook AWS-CopySnapshot requires permissions to create an Amazon Elastic Block Store (Amazon EBS) snapshot. Therefore, the service role needs the permission ec2:CreateSnapshot. For information about the role permissions needed by Automation runbooks, see the runbook descriptions in the AWS Systems Manager Automation runbook reference. Save the file again after making any needed changes. Task 2: Create and verify a custom service role for maintenance windows using the AWS CLI The policy you created in the previous task is attached to the maintenance window service role you create in this task. When users register a maintenance window task, they specify this IAM role as part of the task configuration. The permissions in this role allow Systems Manager to run tasks in maintenance windows on your behalf. Important Previously, the Systems Manager console provided you with the ability to choose the AWS managed IAM service-linked role AWSServiceRoleForAmazonSSM to use as the maintenance role for your tasks. Using this role and its associated policy, AmazonSSMServiceRolePolicy, for maintenance window tasks is no longer recommended. If you're using this role for maintenance window tasks now, we encourage you to stop using it. Instead, create your own IAM role that enables communication between Systems Manager and other AWS services when your maintenance window tasks run. In this task, you run CLI commands to create your maintenance windows service role, adding the policy content from the JSON files you created. Create a custom service role for maintenance windows using the AWS CLI 1. Open the AWS CLI and run the following command in the directory where you placed mw- role-custom-policy.json and mw-role-trust-policy.json. The command creates a maintenance window service role called my-maintenance-window-role and attaches the trust policy to it. Maintenance Windows 1781 AWS Systems Manager Linux & macOS User Guide aws iam create-role \ --role-name "my-maintenance-window-role" \ --assume-role-policy-document file://mw-role-trust-policy.json Windows aws iam create-role ^ --role-name "my-maintenance-window-role" ^ --assume-role-policy-document file://mw-role-trust-policy.json The system returns information similar to the following. { "Role": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" } } ] }, "RoleId": "AROAIIZKPBKS2LEXAMPLE", "CreateDate": "2024-08-19T03:40:17.373Z", "RoleName": "my-maintenance-window-role", "Path": "/", "Arn": "arn:aws:iam::123456789012:role/my-maintenance-window-role" } } Maintenance Windows 1782 AWS Systems Manager Note User Guide Make a note of the RoleName and the Arn values. You include them in the next command. 2. Run the following command to attach the customer managed policy to the role. Replace the account-id placeholder with your own AWS account ID Linux & macOS aws iam attach-role-policy \ --role-name "my-maintenance-window-role" \ --policy-arn "arn:aws:iam::account-id:policy/mw-role-custom-policy.json" Windows aws iam attach-role-policy ^ --role-name "my-maintenance-window-role" ^ --policy-arn "arn:aws:iam::account-id:policy/mw-role-custom-policy.json" 3. Run the following command to verify that your role has been created, and that the trust policy has been attached. aws iam get-role --role-name my-maintenance-window-role The command returns information similar to the following: { "Role": { "Path": "/", "RoleName": "my-maintenance-window-role", "RoleId": "AROA123456789EXAMPLE", "Arn": "arn:aws:iam::123456789012:role/my-maintenance-window-role", "CreateDate": "2024-08-19T14:13:32+00:00", "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { Maintenance Windows 1783 AWS Systems Manager User Guide "Service": "ssm.amazonaws.com" },
|
systems-manager-ug-514
|
systems-manager-ug.pdf
| 514 |
the account-id placeholder with your own AWS account ID Linux & macOS aws iam attach-role-policy \ --role-name "my-maintenance-window-role" \ --policy-arn "arn:aws:iam::account-id:policy/mw-role-custom-policy.json" Windows aws iam attach-role-policy ^ --role-name "my-maintenance-window-role" ^ --policy-arn "arn:aws:iam::account-id:policy/mw-role-custom-policy.json" 3. Run the following command to verify that your role has been created, and that the trust policy has been attached. aws iam get-role --role-name my-maintenance-window-role The command returns information similar to the following: { "Role": { "Path": "/", "RoleName": "my-maintenance-window-role", "RoleId": "AROA123456789EXAMPLE", "Arn": "arn:aws:iam::123456789012:role/my-maintenance-window-role", "CreateDate": "2024-08-19T14:13:32+00:00", "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { Maintenance Windows 1783 AWS Systems Manager User Guide "Service": "ssm.amazonaws.com" }, "Action": "sts:AssumeRole" } ] }, "MaxSessionDuration": 3600, "RoleLastUsed": { "LastUsedDate": "2024-08-19T14:30:44+00:00", "Region": "us-east-2" } } } 4. Run the following command to verify that the customer managed policy has been attached to the role. aws iam list-attached-role-policies --role-name my-maintenance-window-role The command returns information similar to the following: { "AttachedPolicies": [ { "PolicyName": "mw-role-custom-policy", "PolicyArn": "arn:aws:iam::123456789012:policy/mw-role-custom-policy" } ] } Task 3: Grant permissions to specified users to register maintenance window tasks using the AWS CLI Providing users with permissions to access the custom service role for maintenance windows lets them use it with their maintenance windows tasks. This is in addition to permissions that you’ve already given them to work with the Systems Manager API commands for the Maintenance Windows tool. This IAM role conveys the permissions need to run a maintenance window task. As a result, a user can't register tasks with a maintenance window using your custom service role without the ability to pass these IAM permissions. Maintenance Windows 1784 AWS Systems Manager User Guide When you register a task with a maintenance window, you specify a service role to run the actual task operations. This is the role that the service assumes when it runs tasks on your behalf. Before that, to register the task itself, assign the IAM PassRole policy to an IAM entity (such as a user or group). This allows the IAM entity to specify, as part of registering those tasks with the maintenance window, the role that should be used when running tasks. For information, see Grant a user permissions to pass a role to an AWS service in the IAM User Guide. To configure permissions for users who are allowed to register maintenance window tasks using the AWS CLI 1. Copy and paste the following AWS Identity and Access Management (IAM) policy into a text editor and save it with the following name and file extension: mw-passrole-policy.json. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws:iam::account-id:role/my-maintenance-window-role" }, { "Effect": "Allow", "Action": "iam:ListRoles", "Resource": "arn:aws:iam::account-id:role/" }, { "Effect": "Allow", "Action": "iam:ListRoles", "Resource": "arn:aws:iam::account-id:role/aws-service-role/ ssm.amazonaws.com/" } ] } Replace my-maintenance-window-role with the name of the custom maintenance window role you created earlier. Replace account-id with the ID of your AWS account. Adding this permission for the resource arn:aws:iam::account-id:role/ allows users in the group to view and choose from customer roles in the console when they create a maintenance window task. Maintenance Windows 1785 AWS Systems Manager User Guide Adding this permission for arn:aws:iam::account-id:role/aws-service-role/ ssm.amazonaws.com/ allows users in the group to choose the Systems Manager service- linked role in the console when they create a maintenance window task. 2. Open the AWS CLI. 3. Depending on whether you're assigning the permission to an IAM entity (user or group), run one of the following commands. • For an IAM entity: Linux & macOS aws iam put-user-policy \ --user-name "user-name" \ --policy-name "policy-name" \ --policy-document file://path-to-document Windows aws iam put-user-policy ^ --user-name "user-name" ^ --policy-name "policy-name" ^ --policy-document file://path-to-document For user-name, specify the user who assigns tasks to maintenance windows. For policy- name, specify the name you want to use to identify the policy, such as my-iam-passrole- policy. For path-to-document, specify the path to the file you saved in step 1. For example: file://C:\Temp\mw-passrole-policy.json Note To grant access for a user to register tasks for maintenance windows using the Systems Manager console, you must also assign the AmazonSSMFullAccess policy to your user (or an IAM policy that provides a smaller set of access permissions for Systems Manager that covers maintenance window tasks). Run the following command to assign the AmazonSSMFullAccess policy to your user. Linux & macOS aws iam attach-user-policy \ --policy-arn "arn:aws:iam::aws:policy/AmazonSSMFullAccess" \ Maintenance Windows 1786 AWS Systems Manager User Guide --user-name "user-name" Windows aws iam attach-user-policy ^ --policy-arn "arn:aws:iam::aws:policy/AmazonSSMFullAccess" ^ --user-name "user-name" • For an IAM group: Linux & macOS aws iam put-group-policy \ --group-name "group-name" \ --policy-name "policy-name" \ --policy-document file://path-to-document Windows aws iam put-group-policy ^ --group-name "group-name" ^ --policy-name "policy-name" ^ --policy-document file://path-to-document For group-name, specify the group whose members assign tasks to maintenance windows. For policy-name, specify the name you want to use to identify the policy, such as my-iam- passrole-policy. For path-to-document, specify the path to the file you
|
systems-manager-ug-515
|
systems-manager-ug.pdf
| 515 |
& macOS aws iam attach-user-policy \ --policy-arn "arn:aws:iam::aws:policy/AmazonSSMFullAccess" \ Maintenance Windows 1786 AWS Systems Manager User Guide --user-name "user-name" Windows aws iam attach-user-policy ^ --policy-arn "arn:aws:iam::aws:policy/AmazonSSMFullAccess" ^ --user-name "user-name" • For an IAM group: Linux & macOS aws iam put-group-policy \ --group-name "group-name" \ --policy-name "policy-name" \ --policy-document file://path-to-document Windows aws iam put-group-policy ^ --group-name "group-name" ^ --policy-name "policy-name" ^ --policy-document file://path-to-document For group-name, specify the group whose members assign tasks to maintenance windows. For policy-name, specify the name you want to use to identify the policy, such as my-iam- passrole-policy. For path-to-document, specify the path to the file you saved in step 1. For example: file://C:\Temp\mw-passrole-policy.json Note To grant access for members of a group to register tasks for maintenance windows using the Systems Manager console, you must also assign the AmazonSSMFullAccess policy to your group. Run the following command to assign this policy to your group. Linux & macOS aws iam attach-group-policy \ --policy-arn "arn:aws:iam::aws:policy/AmazonSSMFullAccess" \ Maintenance Windows 1787 AWS Systems Manager User Guide --group-name "group-name" Windows aws iam attach-group-policy ^ --policy-arn "arn:aws:iam::aws:policy/AmazonSSMFullAccess" ^ --group-name "group-name" 4. Run the following command to verify that the policy has been assigned to the group. Linux & macOS aws iam list-group-policies \ --group-name "group-name" Windows aws iam list-group-policies ^ --group-name "group-name" Task 4: Prevent specified users from registering maintenance window tasks using the AWS CLI You can deny the ssm:RegisterTaskWithMaintenanceWindow permission for the users in your AWS account who you don't want to register tasks with maintenance windows. This provides an extra layer of prevention for users who shouldn’t register maintenance window tasks. Depending on whether you're denying the ssm:RegisterTaskWithMaintenanceWindow permission for an individual user or a group, use one of the following procedures to prevent users from registering tasks with a maintenance window. To configure permissions for users who aren't allowed to register maintenance window tasks using the AWS CLI 1. Copy and paste the following IAM policy into a text editor and save it with the following name and file extension: deny-mw-tasks-policy.json. { "Version": "2012-10-17", "Statement": [ Maintenance Windows 1788 AWS Systems Manager { "Effect": "Deny", "Action": "ssm:RegisterTaskWithMaintenanceWindow", "Resource": "*" User Guide } ] } 2. Open the AWS CLI. 3. Depending on whether you're assigning the permission to an IAM entity (user or group), run one of the following commands. • For a user: Linux & macOS aws iam put-user-policy \ --user-name "user-name" \ --policy-name "policy-name" \ --policy-document file://path-to-document Windows aws iam put-user-policy ^ --user-name "user-name" ^ --policy-name "policy-name" ^ --policy-document file://path-to-document For user-name, specify the user to prevent from assigning tasks to maintenance windows. For policy-name, specify the name you want to use to identify the policy, such as my- deny-mw-tasks-policy. For path-to-document, specify the path to the file you saved in step 1. For example: file://C:\Temp\deny-mw-tasks-policy.json • For a group: Linux & macOS aws iam put-group-policy \ --group-name "group-name" \ --policy-name "policy-name" \ --policy-document file://path-to-document Maintenance Windows 1789 AWS Systems Manager Windows User Guide aws iam put-group-policy ^ --group-name "group-name" ^ --policy-name "policy-name" ^ --policy-document file://path-to-document For group-name, specify the group whose to prevent from assigning tasks to maintenance windows. For policy-name, specify the name you want to use to identify the policy, such as my-deny-mw-tasks-policy. For path-to-document, specify the path to the file you saved in step 1. For example: file://C:\Temp\deny-mw-tasks-policy.json 4. Run the following command to verify that the policy has been assigned to the group. Linux & macOS aws iam list-group-policies \ --group-name "group-name" Windows aws iam list-group-policies ^ --group-name "group-name" Create and manage maintenance windows using the console This section describes how to create, configure, update, and delete maintenance windows using the AWS Systems Manager console. This section also provides information about managing the targets and tasks of a maintenance window. Important We recommend that you initially create and configure maintenance windows in a test environment. Before you begin Maintenance Windows 1790 AWS Systems Manager User Guide Before you create a maintenance window, you must configure access to Maintenance Windows, a tool in AWS Systems Manager. For more information, see Setting up Maintenance Windows. Topics • Create a maintenance window using the console • Assign targets to a maintenance window using the console • Assign tasks to a maintenance window using the console • Disable or enable a maintenance window using the console • Update or delete maintenance window resources using the console Create a maintenance window using the console In this procedure, you create a maintenance window in Maintenance Windows, a tool in AWS Systems Manager. You can specify its basic options, such as name, schedule, and duration. In later steps, you choose the targets, or resources, that it updates and the tasks that run when the maintenance window runs. Note For an explanation of how the various schedule-related options for maintenance windows relate to one another, see Maintenance window scheduling
|
systems-manager-ug-516
|
systems-manager-ug.pdf
| 516 |
console • Disable or enable a maintenance window using the console • Update or delete maintenance window resources using the console Create a maintenance window using the console In this procedure, you create a maintenance window in Maintenance Windows, a tool in AWS Systems Manager. You can specify its basic options, such as name, schedule, and duration. In later steps, you choose the targets, or resources, that it updates and the tasks that run when the maintenance window runs. Note For an explanation of how the various schedule-related options for maintenance windows relate to one another, see Maintenance window scheduling and active period options. For more information about working with the --schedule option, see Reference: Cron and rate expressions for Systems Manager. To create a maintenance window using the console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Maintenance Windows. 3. Choose Create maintenance window. 4. 5. 6. For Name, enter a descriptive name to help you identify this maintenance window. (Optional) For Description, enter a description to identify how this maintenance window will be used. (Optional) If you want to allow a maintenance window task to run on managed nodes, even if you haven't registered those nodes as targets, choose Allow unregistered targets. Maintenance Windows 1791 AWS Systems Manager User Guide If you choose this option, then you can choose the unregistered nodes (by node ID) when you register a task with the maintenance window. If you don't choose this option, then you must choose previously registered targets when you register a task with the maintenance window. 7. Specify a schedule for the maintenance window by using one of the three scheduling options. For information about building cron/rate expressions, see Reference: Cron and rate expressions for Systems Manager. 8. For Duration, enter the number of hours the maintenance window will run. The value you specify determines the specific end time for the maintenance window based on the time it begins. No maintenance window tasks are permitted to start after the resulting endtime minus the number of hours you specify for Stop initiating tasks in the next step. For example, if the maintenance window starts at 3 PM, the duration is three hours, and the Stop initiating tasks value is one hour, no maintenance window tasks can start after 5 PM. 9. For Stop initiating tasks, enter the number of hours before the end of the maintenance window that the system should stop scheduling new tasks to run. 10. (Optional) For Window start date, specify a date and time, in ISO-8601 Extended format, for when you want the maintenance window to become active. This allows you to delay activation of the maintenance window until the specified future date. Note You can't specify a start date and time that occurs in the past. 11. (Optional) For Window end date, specify a date and time, in ISO-8601 Extended format, for when you want the maintenance window to become inactive. This allows you to set a date and time in the future after which the maintenance window no longer runs. 12. (Optional) For Schedule timezone, specify the time zone to use as the basis for when scheduled maintenance windows run, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For more information about valid formats, see the Time Zone Database on the IANA website. Maintenance Windows 1792 AWS Systems Manager User Guide 13. (Optional) For Schedule offset, enter the number of days to wait after the date and time specified by a cron or rate expression before running the maintenance window. You can specify between one and six days. Note This option is available only if you specified a schedule by entering a cron or rate expression manually. 14. (Optional) In the Manage tags area, apply one or more tag key name/value pairs to the maintenance window. Tags are optional metadata that you assign to a resource. Tags allow you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a maintenance window to identify the type of tasks it runs, the types of targets, and the environment it runs in. In this case, you could specify the following key name/value pairs: • Key=TaskType,Value=AgentUpdate • Key=OS,Value=Windows • Key=Environment,Value=Production 15. Choose Create maintenance window. The system returns you to the maintenance window page. The state of the maintenance window you just created is Enabled. Assign targets to a maintenance window using the console In this procedure, you register a target with a maintenance window. In other words, you specify which resources the maintenance window performs actions on. Note If a single maintenance window task is registered with multiple targets, its task invocations occur sequentially and not in parallel. If your task
|
systems-manager-ug-517
|
systems-manager-ug.pdf
| 517 |
in. In this case, you could specify the following key name/value pairs: • Key=TaskType,Value=AgentUpdate • Key=OS,Value=Windows • Key=Environment,Value=Production 15. Choose Create maintenance window. The system returns you to the maintenance window page. The state of the maintenance window you just created is Enabled. Assign targets to a maintenance window using the console In this procedure, you register a target with a maintenance window. In other words, you specify which resources the maintenance window performs actions on. Note If a single maintenance window task is registered with multiple targets, its task invocations occur sequentially and not in parallel. If your task must run on multiple targets at the same time, register a task for each target individually and assign each task the same priority level. Maintenance Windows 1793 AWS Systems Manager User Guide To assign targets to a maintenance window using the console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Maintenance Windows. In the list of maintenance windows, choose the maintenance window to add targets to. 2. 3. 4. Choose Actions, and then choose Register targets. 5. 6. 7. (Optional) For Target name, enter a name for the targets. (Optional) For Description, enter a description. (Optional) For Owner information, specify information to include in any Amazon EventBridge event raised while running tasks for these targets in this maintenance window. For information about using EventBridge to monitor Systems Manager events, see Monitoring Systems Manager events with Amazon EventBridge. 8. In the Targets area, choose one of the options described in the following table. Option Description Specify instance tags Choose instances manually For the Specify instance tags boxes, specify one or more tag keys and (optional) values that have been or will be added to managed nodes in your account. When the maintenan ce window runs, it attempts to perform tasks on all of the managed nodes to which these tags have been added. If you specify more than one tag key, a node must be tagged with all the tag keys and values you specify to be included in the target group. From the list, select the box for each node that you want to include in the maintenance window target. Maintenance Windows 1794 AWS Systems Manager Option User Guide Description The list includes all nodes in your account that are configured for use with Systems Manager. If a managed node you expect to see isn't listed, see Troubleshooting managed node availability for troubleshooting tips. For edge devices and on-premises servers and virtual machines (VMs), see Managing nodes in hybrid and multicloud environme nts with Systems Manager Maintenance Windows 1795 AWS Systems Manager Option Choose a resource group User Guide Description For Resource group, choose the name of an existing resource group in your account from the list. For information about creating and working with resource groups, see the following topics: • What are resource groups? in the AWS Resource Groups User Guide • Resource Groups and Tagging for AWS in the AWS News Blog (Optional) For Resource types, select up to five available resource types, or choose All resource types. If the tasks you assign to the maintenance window don't act on one of the resource types you added to the target, the system might report an error. Tasks for which a supported resource type is found continue to run despite these errors. For example, suppose you add the following resource types to this target: • AWS::S3::Bucket • AWS::DynamoDB::Table • AWS::EC2::Instance But later, when you add tasks to the maintenance window, you include only tasks that perform actions on nodes, such as applying a patch baseline or rebooting Maintenance Windows 1796 AWS Systems Manager Option User Guide Description a node. In the maintenance window log, an error might be reported for no Amazon Simple Storage Service (Amazon S3) buckets or Amazon DynamoDB tables being found. However, the maintenance window still runs tasks on the nodes in your resource group. 9. Choose Register target. If you want to assign more targets to this maintenance window, choose the Targets tab, and then choose Register target. With this option, you can choose a different means of targeting. For example, if you previously targeted nodes by node ID, you can register new targets and target nodes by specifying tags applied to managed nodes or choosing resource types from a resource group. Assign tasks to a maintenance window using the console In this procedure, you add a task to a maintenance window. Tasks are the actions performed when a maintenance window runs. The following four types of tasks can be added to a maintenance window: • AWS Systems Manager Run Command commands • Systems Manager Automation workflows • AWS Step Functions tasks • AWS Lambda functions Important The IAM policy for Maintenance Windows requires that you add the
|
systems-manager-ug-518
|
systems-manager-ug.pdf
| 518 |
ID, you can register new targets and target nodes by specifying tags applied to managed nodes or choosing resource types from a resource group. Assign tasks to a maintenance window using the console In this procedure, you add a task to a maintenance window. Tasks are the actions performed when a maintenance window runs. The following four types of tasks can be added to a maintenance window: • AWS Systems Manager Run Command commands • Systems Manager Automation workflows • AWS Step Functions tasks • AWS Lambda functions Important The IAM policy for Maintenance Windows requires that you add the prefix SSM to Lambda function (or alias) names. Before you proceed to register this type of task, update its name in AWS Lambda to include SSM. For example, if your Lambda function name is MyLambdaFunction, change it to SSMMyLambdaFunction. Maintenance Windows 1797 AWS Systems Manager User Guide To assign tasks to a maintenance window 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Maintenance Windows. In the list of maintenance windows, choose a maintenance window. 4. Choose Actions, and then choose the option for the type of task you want to register with the maintenance window. • Register Run command task • Register Automation task • Register Lambda task • Register Step Functions task Note Maintenance window tasks support Step Functions Standard state machine workflows only. They don't support Express state machine workflows. For information about state machine workflow types, see Standard vs. Express Workflows in the AWS Step Functions Developer Guide. 5. 6. 7. (Optional) For Name, enter a name for the task. (Optional) For Description, enter a description. For New task invocation cutoff, if you don't want any new task invocations to start after the maintenance window cutoff time is reached, choose Enabled. When this option is not enabled, the task continues running when the cutoff time is reached and starts new task invocations until completion. Note The status for tasks that are not completed when you enable this option is TIMED_OUT. 8. For this step, follow the sub-steps for your selected task type. Maintenance Windows 1798 AWS Systems Manager Run Command User Guide 1. In the Command document list, choose the Systems Manager Command document (SSM document) that defines the tasks to run. 2. For Document version, choose the document version to use. 3. For Task priority, specify a priority for this task. Zero (0) is the highest priority. Tasks in a maintenance window are scheduled in priority order with tasks that have the same priority scheduled in parallel. Automation 1. In the Automation document list, choose the Automation runbook that defines the tasks to run. 2. For Document version, choose the runbook version to use. 3. For Task priority, specify a priority for this task. Zero (0) is the highest priority. Tasks in a maintenance window are scheduled in priority order with tasks that have the same priority scheduled in parallel. Lambda 1. In the Lambda parameters area, choose a Lambda function from the list. 2. (Optional) Provide any content for Payload, Client Context, or Qualifier that you want to include. Note In some cases, you can use a pseudo parameter as part of your Payload value. Then when the maintenance window task runs, it passes the correct values instead of the pseudo parameter placeholders. For information, see Using pseudo parameters when registering maintenance window tasks. 3. For Task priority, specify a priority for this task. Zero (0) is the highest priority. Tasks in a maintenance window are scheduled in priority order with tasks that have the same priority scheduled in parallel. Maintenance Windows 1799 AWS Systems Manager Step Functions User Guide 1. In the Step Functions parameters area, choose a state machine from the list. 2. (Optional) Provide a name for the state machine execution and any content for Input that you want to include. Note In some cases, you can use a pseudo parameter as part of your Input value. Then when the maintenance window task runs, it passes the correct values instead of the pseudo parameter placeholders. For information, see Using pseudo parameters when registering maintenance window tasks. 3. For Task priority, specify a priority for this task. Zero (0) is the highest priority. Tasks in a maintenance window are scheduled in priority order with tasks that have the same priority scheduled in parallel. 9. In the Targets area, choose one of the following: • Selecting registered target groups: Select one or more maintenance window targets you have registered with the current maintenance window. • Selecting unregistered targets: Choose available resources one by one as targets for the task. If a managed node you expect to see isn't listed, see Troubleshooting managed node availability for troubleshooting tips. • Task target not required: Targets for the
|
systems-manager-ug-519
|
systems-manager-ug.pdf
| 519 |
for this task. Zero (0) is the highest priority. Tasks in a maintenance window are scheduled in priority order with tasks that have the same priority scheduled in parallel. 9. In the Targets area, choose one of the following: • Selecting registered target groups: Select one or more maintenance window targets you have registered with the current maintenance window. • Selecting unregistered targets: Choose available resources one by one as targets for the task. If a managed node you expect to see isn't listed, see Troubleshooting managed node availability for troubleshooting tips. • Task target not required: Targets for the task might already be specified in other functions for all but Run Command-type tasks. Specify one or more targets for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, AWS Lambda, and AWS Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets. Maintenance Windows 1800 AWS Systems Manager Note User Guide In many cases, you don't need to explicitly specify a target for an automation task. For example, say that you're creating an Automation-type task to update an Amazon Machine Image (AMI) for Linux using the AWS-UpdateLinuxAmi runbook. When the task runs, the AMI is updated with the latest available Linux distribution packages and Amazon software. New instances created from the AMI already have these updates installed. Because the ID of the AMI to be updated is specified in the input parameters for the runbook, there is no need to specify a target again in the maintenance window task. 10. Automation tasks only: In the Input parameters area, provide values for any required or optional parameters needed to run your task. Note In some cases, you can use a pseudo parameter for certain input parameter values. Then when the maintenance window task runs, it passes the correct values instead of the pseudo parameter placeholders. For information, see Using pseudo parameters when registering maintenance window tasks. 11. For Rate control: • For Concurrency, specify either a number or a percentage of managed nodes on which to run the command at the same time. Note If you selected targets by specifying tags applied to managed nodes or by specifying AWS resource groups, and you aren't certain how many managed nodes are targeted, then restrict the number of targets that can run the document at the same time by specifying a percentage. • For Error threshold, specify when to stop running the command on other managed nodes after it fails on either a number or a percentage of nodes. For example, if you specify three Maintenance Windows 1801 AWS Systems Manager User Guide errors, then Systems Manager stops sending the command when the fourth error is received. Managed nodes still processing the command might also send errors. 12. (Optional) For IAM service role, choose a role to provide permissions for Systems Manager to assume when running a maintenance window task. If you don't specify a service role ARN, Systems Manager uses a service-linked role in your account. This role is not listed in the drop-down menu. If no appropriate service-linked role for Systems Manager exists in your account, it's created when the task is registered successfully. Note For an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see Setting up Maintenance Windows. 13. Run Command tasks only: (Optional) For Output options, do the following: • Select the Enable writing to S3 check box to save the command output to a file. Enter the bucket and prefix (folder) names in the boxes. • Select the CloudWatch output check box to write complete output to Amazon CloudWatch Logs. Enter the name of a CloudWatch Logs log group. Note The permissions that grant the ability to write data to an S3 bucket or CloudWatch Logs are those of the instance profile assigned to the node, not those of the IAM user performing this task. For more information, see Configure instance permissions required for Systems Manager. In addition, if the specified S3 bucket or log group is in a different AWS account, verify that the instance profile associated with the node has the necessary permissions to write to that bucket. 14. Run Command tasks only: In the SNS notifications section, if you want notifications sent about the status of the command execution, select the Enable SNS notifications check box. Maintenance Windows 1802 AWS Systems Manager User Guide For more information about configuring Amazon SNS notifications for Run Command, see Monitoring Systems Manager status changes using Amazon SNS notifications. 15. Run Command tasks only: In the
|
systems-manager-ug-520
|
systems-manager-ug.pdf
| 520 |
Manager. In addition, if the specified S3 bucket or log group is in a different AWS account, verify that the instance profile associated with the node has the necessary permissions to write to that bucket. 14. Run Command tasks only: In the SNS notifications section, if you want notifications sent about the status of the command execution, select the Enable SNS notifications check box. Maintenance Windows 1802 AWS Systems Manager User Guide For more information about configuring Amazon SNS notifications for Run Command, see Monitoring Systems Manager status changes using Amazon SNS notifications. 15. Run Command tasks only: In the Parameters area, specify parameters for the document. Note In some cases, you can use a pseudo parameter for certain input parameter values. Then when the maintenance window task runs, it passes the correct values instead of the pseudo parameter placeholders. For information, see Using pseudo parameters when registering maintenance window tasks. 16. Run Command and Automation tasks only: (Optional) In the CloudWatch alarm area, for Alarm name, choose an existing CloudWatch alarm to apply to your task for monitoring. If the alarm activates, the task is stopped. Note To attach a CloudWatch alarm to your task, the IAM principal that runs the task must have permission for the iam:createServiceLinkedRole action. For more information about CloudWatch alarms, see Using Amazon CloudWatch alarms. 17. Depending on your task type, choose one of the following: • Register Run command task • Register Automation task • Register Lambda task • Register Step Functions task Disable or enable a maintenance window using the console You can disable or enable a maintenance window in Maintenance Windows, a tool in AWS Systems Manager. You can choose one maintenance window at a time to either disable or enable the Maintenance Windows 1803 AWS Systems Manager User Guide maintenance window from running. You can also select multiple or all maintenance windows to enable and disable. This section describes how to disable or enable a maintenance window by using the Systems Manager console. For examples of how to do this by using the AWS Command Line Interface (AWS CLI), see Tutorial: Update a maintenance window using the AWS CLI. Topics • Disable a maintenance window using the console • Enable a maintenance window using the console Disable a maintenance window using the console You can disable a maintenance window to pause a task for a specified period, and it will remain available to enable again later. To disable a maintenance window 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Maintenance Windows. 3. Using the check box next to the maintenance window that you want to disable, select one or more maintenance windows. 4. Choose Disable maintenance window in the Actions menu. The system prompts you to confirm your actions. Enable a maintenance window using the console You can enable a maintenance window to resume a task. Note If the maintenance window uses a rate schedule and the start date is currently set to a past date and time, the current date and time is used as the start date for the maintenance window. You can change the start date of the maintenance window before or after enabling it. For information, see Update or delete maintenance window resources using the console. Maintenance Windows 1804 AWS Systems Manager User Guide To enable a maintenance window 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Maintenance Windows. Select the check box next to the maintenance window to enable. 4. Choose Actions, Enable maintenance window. The system prompts you to confirm your actions. Update or delete maintenance window resources using the console You can update or delete a maintenance window in Maintenance Windows, a tool in AWS Systems Manager. You can also update or delete the targets or tasks of a maintenance window. If you edit the details of a maintenance window, you can change the schedule, targets, and tasks. You can also specify names and descriptions for windows, targets, and tasks, which helps you better understand their purpose, and makes it easier to manage your queue of windows. This section describes how to update or delete a maintenance window, targets, and tasks by using the Systems Manager console. For examples of how to do this by using the AWS Command Line Interface (AWS CLI), see Tutorial: Update a maintenance window using the AWS CLI. Topics • Updating or deleting a maintenance window using the console • Updating or deregistering maintenance window targets using the console • Updating or deregistering maintenance window tasks using the console Updating or deleting a maintenance window using the console You can update a maintenance window to change its name, description, and schedule, and whether the maintenance window should allow unregistered targets. To
|
systems-manager-ug-521
|
systems-manager-ug.pdf
| 521 |
maintenance window, targets, and tasks by using the Systems Manager console. For examples of how to do this by using the AWS Command Line Interface (AWS CLI), see Tutorial: Update a maintenance window using the AWS CLI. Topics • Updating or deleting a maintenance window using the console • Updating or deregistering maintenance window targets using the console • Updating or deregistering maintenance window tasks using the console Updating or deleting a maintenance window using the console You can update a maintenance window to change its name, description, and schedule, and whether the maintenance window should allow unregistered targets. To update or delete a maintenance window 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Maintenance Windows. Maintenance Windows 1805 AWS Systems Manager User Guide 3. Select the button next to the maintenance window that you want to update or delete, and then do one of the following: • Choose Delete. The system prompts you to confirm your actions. • Choose Edit. On the Edit maintenance window page, change the values and options that you want, and then choose Save changes. For information about the configuration choices you can make, see Create a maintenance window using the console. Updating or deregistering maintenance window targets using the console You can update or deregister the targets of a maintenance window. If you choose to update a maintenance window target you can specify a new target name, description, and owner. You can also choose different targets. To update or delete the targets of a maintenance window 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Maintenance Windows. 3. Choose the name of the maintenance window that you want to update, choose the Targets tab, and then do one of the following: • To update targets, select the button next to the target to update, and then choose Edit. • To deregister targets, select the button next to the target to deregister, and then choose Deregister target. In the Deregister maintenance windows target dialog box, choose Deregister. Updating or deregistering maintenance window tasks using the console You can update or deregister the tasks of a maintenance window. If you choose to update, you can specify a new task name, description, and owner. For Run Command and Automation tasks, you can choose a different SSM document for the tasks. You can't, however, edit a task to change its type. For example, if you created an Automation task, you can't edit that task and change it to a Run Command task. Maintenance Windows 1806 AWS Systems Manager User Guide To update or delete the tasks of a maintenance window using the console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Maintenance Windows. 3. Choose the name of the maintenance window that you want to update. 4. Choose the Tasks tab, and then select the button next to the task to update. 5. Do one of the following: • To deregister a task, choose Deregister task. • To edit the task, choose Edit. Change the values and options that you want, and then choose Edit task. Tutorials The tutorials in this section show you how to perform common tasks when working with maintenance windows. Complete prerequisites Before trying these tutorials, complete the following prerequisites. • Configure the AWS CLI on your local machine – Before you can run AWS CLI commands, you must install and configure the CLI on your local machine. For information, see Installing or updating the latest version of the AWS CLI and Installing the AWS Tools for PowerShell. • Verify maintenance window roles and permissions – An AWS administrator in your account must grant you the AWS Identity and Access Management (IAM) permissions you need to manage maintenance windows using the CLI. For information, see Setting up Maintenance Windows. • Create or configure an instance that is compatible with Systems Manager – You need at least one Amazon Elastic Compute Cloud (Amazon EC2) instance that is configured for use with Systems Manager to complete the tutorials. This means that SSM Agent is installed on the instance, and an IAM instance profile for Systems Manager is attached to the instance. We recommend launching an instance from one AWS managed Amazon Machine Image (AMI) with the agent preinstalled. For more information, see Find AMIs with the SSM Agent preinstalled. Maintenance Windows 1807 AWS Systems Manager User Guide For information about installing SSM Agent on an instance, see the following topics: • Manually installing and uninstalling SSM Agent on EC2 instances for Windows Server • Manually installing and uninstalling SSM Agent on EC2 instances for Linux For information about configuring IAM permissions for Systems Manager to your instance, see Configure instance permissions required for
|
systems-manager-ug-522
|
systems-manager-ug.pdf
| 522 |
for Systems Manager is attached to the instance. We recommend launching an instance from one AWS managed Amazon Machine Image (AMI) with the agent preinstalled. For more information, see Find AMIs with the SSM Agent preinstalled. Maintenance Windows 1807 AWS Systems Manager User Guide For information about installing SSM Agent on an instance, see the following topics: • Manually installing and uninstalling SSM Agent on EC2 instances for Windows Server • Manually installing and uninstalling SSM Agent on EC2 instances for Linux For information about configuring IAM permissions for Systems Manager to your instance, see Configure instance permissions required for Systems Manager. • Create additional resources as needed – Run Command, a tool in Systems Manager, includes many tasks that don't require you to create resources other than those listed in this prerequisites topic. For that reason, we provide a simple Run Command task for you to use your first time through the tutorials. You also need an EC2 instance that is configured to use with Systems Manager, as described earlier in this topic. After you configure that instance, you can register a simple Run Command task. The Systems Manager Maintenance Windows tool supports running the following four types of tasks: • Run Command commands • Systems Manager Automation workflows • AWS Lambda functions • AWS Step Functions tasks In general, if a maintenance window task that you want to run requires additional resources, you should create them first. For example, if you want a maintenance window that runs an AWS Lambda function, create the Lambda function before you begin; for a Run Command task, create the S3 bucket that you can save command output to (if you plan to do so); and so on. Tutorials • Tutorials: Create and manage maintenance windows using the AWS CLI • Tutorial: Create a maintenance window for patching using the console Tutorials: Create and manage maintenance windows using the AWS CLI This section includes tutorials that help you learn how to use the AWS Command Line Interface (AWS CLI) to do the following: • Create and configure a maintenance window Maintenance Windows 1808 AWS Systems Manager User Guide • View information about a maintenance window • View information about maintenance windows tasks and task executions • Update a maintenance window • Delete a maintenance window Keep track of resource IDs As you complete the tasks in these AWS CLI tutorials, keep track of resource IDs generated by the commands you run. You use many of these as input for subsequent commands. For example, when you create the maintenance window, the system provides you with a maintenance window ID in the following format. { "WindowId":"mw-0c50858d01EXAMPLE" } Make a note of the following system-generated IDs because the tutorials in this section use them: • WindowId • WindowTargetId • WindowTaskId • WindowExecutionId • TaskExecutionId • InvocationId • ExecutionId You also need the ID of the EC2 instance that you plan to use in the tutorials. For example: i-02573cafcfEXAMPLE Tutorials • Tutorial: Create and configure a maintenance window using the AWS CLI • Tutorial: View information about maintenance windows using the AWS CLI • Tutorial: View information about tasks and task executions using the AWS CLI • Tutorial: Update a maintenance window using the AWS CLI • Tutorial: Delete a maintenance window using the AWS CLI Maintenance Windows 1809 AWS Systems Manager User Guide Tutorial: Create and configure a maintenance window using the AWS CLI This tutorial demonstrates how to use the AWS Command Line Interface (AWS CLI) to create and configure a maintenance window, its targets, and its tasks. The main path through the tutorial consists of simple steps. You create a single maintenance window, identify a single target, and set up a simple task for the maintenance window to run. Along the way, we provide information you can use to try more complicated scenarios. As you follow the steps in this tutorial, replace the values in italicized red text with your own options and IDs. For example, replace the maintenance window ID mw-0c50858d01EXAMPLE and the instance ID i-02573cafcfEXAMPLE with IDs of resources you create. Contents • Step 1: Create the maintenance window using the AWS CLI • Step 2: Register a target node with the maintenance window using the AWS CLI • Step 3: Register a task with the maintenance window using the AWS CLI Step 1: Create the maintenance window using the AWS CLI In this step, you create a maintenance window and specify its basic options, such as name, schedule, and duration. In later steps, you choose the instance it updates and the task it runs. In our example, you create a maintenance window that runs every five minutes. Normally, you wouldn't run a maintenance window this frequently. However, with this rate you can see your tutorial results quickly. We will show you
|
systems-manager-ug-523
|
systems-manager-ug.pdf
| 523 |
maintenance window using the AWS CLI • Step 3: Register a task with the maintenance window using the AWS CLI Step 1: Create the maintenance window using the AWS CLI In this step, you create a maintenance window and specify its basic options, such as name, schedule, and duration. In later steps, you choose the instance it updates and the task it runs. In our example, you create a maintenance window that runs every five minutes. Normally, you wouldn't run a maintenance window this frequently. However, with this rate you can see your tutorial results quickly. We will show you how to change to a less frequent rate after the task has run successfully. Note For an explanation of how the various schedule-related options for maintenance windows relate to one another, see Maintenance window scheduling and active period options. For more information about working with the --schedule option, see Reference: Cron and rate expressions for Systems Manager. To create a maintenance window using the AWS CLI 1. Open the AWS Command Line Interface (AWS CLI) and run the following command on your local machine to create a maintenance window that does the following: Maintenance Windows 1810 AWS Systems Manager User Guide • Runs every five minutes for up to two hours (as needed). • Prevents new tasks from starting within one hour of the end of the maintenance window operation. • Allows unassociated targets (instances that you haven't registered with the maintenance window). • Indicates through the use of custom tags that its creator intends to use it in a tutorial. Linux & macOS aws ssm create-maintenance-window \ --name "My-First-Maintenance-Window" \ --schedule "rate(5 minutes)" \ --duration 2 \ --cutoff 1 \ --allow-unassociated-targets \ --tags "Key=Purpose,Value=Tutorial" Windows aws ssm create-maintenance-window ^ --name "My-First-Maintenance-Window" ^ --schedule "rate(5 minutes)" ^ --duration 2 ^ --cutoff 1 ^ --allow-unassociated-targets ^ --tags "Key"="Purpose","Value"="Tutorial" The system returns information similar to the following. { "WindowId":"mw-0c50858d01EXAMPLE" } 2. Now run the following command to view details about this and any other maintenance windows already in your account. aws ssm describe-maintenance-windows Maintenance Windows 1811 AWS Systems Manager User Guide The system returns information similar to the following. { "WindowIdentities":[ { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "My-First-Maintenance-Window", "Enabled": true, "Duration": 2, "Cutoff": 1, "NextExecutionTime": "2019-05-11T16:46:16.991Z" } ] } Continue to Step 2: Register a target node with the maintenance window using the AWS CLI. Step 2: Register a target node with the maintenance window using the AWS CLI In this step, you register a target with your new maintenance window. In this case, you specify which node to update when the maintenance window runs. For an example of registering more than one node at a time using node IDs, examples of using tags to identify multiple nodes, and examples of specifying resource groups as targets, see Examples: Register targets with a maintenance window. Note You should already have created an Amazon Elastic Compute Cloud (Amazon EC2) instance to use in this step, as described in the Maintenance Windows tutorial prerequisites. To register a target node with a maintenance window using the AWS CLI 1. Run the following command on your local machine. Replace each example resource placeholder with your own information. Linux & macOS aws ssm register-target-with-maintenance-window \ Maintenance Windows 1812 AWS Systems Manager User Guide --window-id "mw-0c50858d01EXAMPLE" \ --resource-type "INSTANCE" \ --target "Key=InstanceIds,Values=i-02573cafcfEXAMPLE" Windows aws ssm register-target-with-maintenance-window ^ --window-id "mw-0c50858d01EXAMPLE" ^ --resource-type "INSTANCE" ^ --target "Key=InstanceIds,Values=i-02573cafcfEXAMPLE" The system returns information similar to the following. { "WindowTargetId":"e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" } 2. Now run the following command on your local machine to view details about your maintenance window target. Linux & macOS aws ssm describe-maintenance-window-targets \ --window-id "mw-0c50858d01EXAMPLE" Windows aws ssm describe-maintenance-window-targets ^ --window-id "mw-0c50858d01EXAMPLE" The system returns information similar to the following. { "Targets": [ { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTargetId": "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE", "ResourceType": "INSTANCE", "Targets": [ Maintenance Windows 1813 AWS Systems Manager { "Key": "InstanceIds", "Values": [ "i-02573cafcfEXAMPLE" ] } ] } ] } User Guide Continue to Step 3: Register a task with the maintenance window using the AWS CLI. Examples: Register targets with a maintenance window You can register a single node as a target using its node ID, as demonstrated in Step 2: Register a target node with the maintenance window using the AWS CLI. You can also register one or more nodes as targets using the command formats on this page. In general, there are two methods for identifying the nodes you want to use as maintenance window targets: specifying individual nodes, and using resource tags. The resource tags method provides more options, as shown in examples 2-3. You can also specify one or more resource groups as the target of a maintenance window. A resource group can include nodes and many other types of supported AWS resources. Examples 4 and 5, next, demonstrate how to add resource groups to your maintenance window
|
systems-manager-ug-524
|
systems-manager-ug.pdf
| 524 |
CLI. You can also register one or more nodes as targets using the command formats on this page. In general, there are two methods for identifying the nodes you want to use as maintenance window targets: specifying individual nodes, and using resource tags. The resource tags method provides more options, as shown in examples 2-3. You can also specify one or more resource groups as the target of a maintenance window. A resource group can include nodes and many other types of supported AWS resources. Examples 4 and 5, next, demonstrate how to add resource groups to your maintenance window targets. Note If a single maintenance window task is registered with multiple targets, its task invocations occur sequentially and not in parallel. If your task must run on multiple targets at the same time, register a task for each target individually and assign each task the same priority level. For more information about creating and managing resource groups, see What are resource groups? in the AWS Resource Groups User Guide and Resource Groups and Tagging for AWS in the AWS News Blog. Maintenance Windows 1814 AWS Systems Manager User Guide For information about quotas for Maintenance Windows, a tool in AWS Systems Manager, in addition to those specified in the following examples, see Systems Manager service quotas in the Amazon Web Services General Reference. Example 1: Register multiple targets using node IDs Run the following command on your local machine format to register multiple nodes as targets using their node IDs. Replace each example resource placeholder with your own information. Linux & macOS aws ssm register-target-with-maintenance-window \ --window-id "mw-0c50858d01EXAMPLE" \ --resource-type "INSTANCE" \ --target "Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE" Windows aws ssm register-target-with-maintenance-window ^ --window-id "mw-0c50858d01EXAMPLE ^ --resource-type "INSTANCE" ^ --target "Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE Recommended use: Most useful when registering a unique group of nodes with any maintenance window for the first time and they do not share a common node tag. Quotas: You can specify up to 50 nodes total for each maintenance window target. Example 2: Register targets using resource tags applied to nodes Run the following command on your local machine to register nodes that are all already tagged with a key-value pair you have assigned. Replace each example resource placeholder with your own information. Linux & macOS aws ssm register-target-with-maintenance-window \ Maintenance Windows 1815 AWS Systems Manager User Guide --window-id "mw-0c50858d01EXAMPLE" \ --resource-type "INSTANCE" \ --target "Key=tag:Region,Values=East" Windows aws ssm register-target-with-maintenance-window ^ --window-id "mw-0c50858d01EXAMPLE" ^ --resource-type "INSTANCE" ^ --target "Key=tag:Region,Values=East" Recommended use: Most useful when registering a unique group of nodes with any maintenance window for the first time and they do share a common node tag. Quotas: You can specify up to five key-value pairs total for each target. If you specify more than one key-value pair, a node must be tagged with all the tag keys and values you specify to be included in the target group. Note You can tag a group of nodes with the tag-key Patch Group or PatchGroup and assign the nodes a common key value, such as my-patch-group. (You must use PatchGroup, without a space, if you have allowed tags in EC2 instance metadata.) Patch Manager, a tool in Systems Manager, evaluates the Patch Group or PatchGroup key on nodes to help determine which patch baseline applies to them. If your task will run the AWS- RunPatchBaseline SSM document (or the legacy AWS-ApplyPatchBaseline SSM document), you can specify the same Patch Group or PatchGroup key-value pair when you register targets with a maintenance window. For example: --target "Key=tag:PatchGroup,Values=my-patch-group. Doing so allows you to use a maintenance window to update patches on a group of nodes that are already associated with the same patch baseline. For more information, see Patch groups. Example 3: Register targets using a group of tag keys (without tag values) Run the following command on your local machine to register nodes that all have one or more tag keys assigned to them, regardless of their key values. Replace each example resource placeholder with your own information. Maintenance Windows 1816 AWS Systems Manager Linux & macOS User Guide aws ssm register-target-with-maintenance-window \ --window-id "mw-0c50858d01EXAMPLE" \ --resource-type "INSTANCE" \ --target "Key=tag-key,Values=Name,Instance-Type,CostCenter" Windows aws ssm register-target-with-maintenance-window ^ --window-id "mw-0c50858d01EXAMPLE" ^ --resource-type "INSTANCE" ^ --target "Key=tag-key,Values=Name,Instance-Type,CostCenter" Recommended use: Useful when you want to target nodes by specifying multiple tag keys (without their values) rather than just one tag-key or a tag key-value pair. Quotas: You can specify up to five tag-keys total for each target. If you specify more than one tag key, a node must be tagged with all the tag keys you specify to be included in the target group. Example 4: Register targets using a resource group name Run the following command on your local machine to register a specified resource group, regardless of the type of resources it contains. Replace mw-0c50858d01EXAMPLE with
|
systems-manager-ug-525
|
systems-manager-ug.pdf
| 525 |
Recommended use: Useful when you want to target nodes by specifying multiple tag keys (without their values) rather than just one tag-key or a tag key-value pair. Quotas: You can specify up to five tag-keys total for each target. If you specify more than one tag key, a node must be tagged with all the tag keys you specify to be included in the target group. Example 4: Register targets using a resource group name Run the following command on your local machine to register a specified resource group, regardless of the type of resources it contains. Replace mw-0c50858d01EXAMPLE with your own information. If the tasks you assign to the maintenance window don't act on a type of resource included in this resource group, the system might report an error. Tasks for which a supported resource type is found continue to run despite these errors. Linux & macOS aws ssm register-target-with-maintenance-window \ --window-id "mw-0c50858d01EXAMPLE" \ --resource-type "RESOURCE_GROUP" \ --target "Key=resource-groups:Name,Values=MyResourceGroup" Windows aws ssm register-target-with-maintenance-window ^ --window-id "mw-0c50858d01EXAMPLE" ^ --resource-type "RESOURCE_GROUP" ^ Maintenance Windows 1817 AWS Systems Manager User Guide --target "Key=resource-groups:Name,Values=MyResourceGroup" Recommended use: Useful when you want to quickly specify a resource group as a target without evaluating whether all of its resource types will be targeted by a maintenance window, or when you know that the resource group contains only the resource types that your tasks perform actions on. Quotas: You can specify only one resource group as a target. Example 5: Register targets by filtering resource types in a resource group Run the following command on your local machine to register only certain resource types that belong to a resource group that you specify. Replace mw-0c50858d01EXAMPLE with your own information. With this option, even if you add a task for a resource type that belongs to the resource group, the task won’t run if you haven’t explicitly added the resource type to the filter. Linux & macOS aws ssm register-target-with-maintenance-window \ --window-id "mw-0c50858d01EXAMPLE" \ --resource-type "RESOURCE_GROUP" \ --target "Key=resource-groups:Name,Values=MyResourceGroup" \ "Key=resource- groups:ResourceTypeFilters,Values=AWS::EC2::Instance,AWS::ECS::Cluster" Windows aws ssm register-target-with-maintenance-window ^ --window-id "mw-0c50858d01EXAMPLE" ^ --resource-type "RESOURCE_GROUP" ^ --target "Key=resource-groups:Name,Values=MyResourceGroup" ^ "Key=resource- groups:ResourceTypeFilters,Values=AWS::EC2::Instance,AWS::ECS::Cluster" Recommended use: Useful when you want to maintain strict control over the types of AWS resources your maintenance window can run actions on, or when your resource group contains a large number of resource types and you want to avoid unnecessary error reports in your maintenance window logs. Quotas: You can specify only one resource group as a target. Maintenance Windows 1818 AWS Systems Manager User Guide Step 3: Register a task with the maintenance window using the AWS CLI In this step of the tutorial, you register an AWS Systems Manager Run Command task that runs the df command on your Amazon Elastic Compute Cloud (Amazon EC2) instance for Linux. The results of this standard Linux command show how much space is free and how much is used on the disk file system of your instance. -or- If you're targeting an Amazon EC2 instance for Windows Server instead of Linux, replace df in the following command with ipconfig. Output from this command lists details about the IP address, subnet mask, and default gateway for adapters on the target instance. When you're ready to register other task types, or use more of the available Systems Manager Run Command options, see Examples: Register tasks with a maintenance window. There, we provide more information about all four task types, and some of their most important options, to help you plan for more extensive real-world scenarios. To register a task with a maintenance window 1. Run the following command on your local machine. Replace each example resource placeholder with your own information. The version to run from a local Windows machine includes the escape characters ("/") that you need to run the command from your command line tool. Linux & macOS aws ssm register-task-with-maintenance-window \ --window-id mw-0c50858d01EXAMPLE \ --task-arn "AWS-RunShellScript" \ --max-concurrency 1 --max-errors 1 \ --priority 10 \ --targets "Key=InstanceIds,Values=i-0471e04240EXAMPLE" \ --task-type "RUN_COMMAND" \ --task-invocation-parameters '{"RunCommand":{"Parameters":{"commands": ["df"]}}}' Windows aws ssm register-task-with-maintenance-window ^ --window-id mw-0c50858d01EXAMPLE ^ Maintenance Windows 1819 AWS Systems Manager User Guide --task-arn "AWS-RunShellScript" ^ --max-concurrency 1 --max-errors 1 ^ --priority 10 ^ --targets "Key=InstanceIds,Values=i-02573cafcfEXAMPLE" ^ --task-type "RUN_COMMAND" ^ --task-invocation-parameters={\"RunCommand\":{\"Parameters\":{\"commands\": [\"df\"]}}} The system returns information similar to the following: { "WindowTaskId": "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE" } 2. Now run the following command to view details about the maintenance window task you created. Linux & macOS aws ssm describe-maintenance-window-tasks \ --window-id mw-0c50858d01EXAMPLE Windows aws ssm describe-maintenance-window-tasks ^ --window-id mw-0c50858d01EXAMPLE 3. The system returns information similar to the following. { "Tasks": [ { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTaskId": "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", "TaskArn": "AWS-RunShellScript", "Type": "RUN_COMMAND", "Targets": [ { "Key": "InstanceIds", "Values": [ "i-02573cafcfEXAMPLE" Maintenance Windows 1820 AWS Systems Manager User Guide ] } ], "TaskParameters": {}, "Priority": 10, "ServiceRoleArn": "arn:aws:iam::123456789012:role/ MyMaintenanceWindowServiceRole", "MaxConcurrency": "1", "MaxErrors": "1" } ] } 4. Wait
|
systems-manager-ug-526
|
systems-manager-ug.pdf
| 526 |
The system returns information similar to the following: { "WindowTaskId": "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE" } 2. Now run the following command to view details about the maintenance window task you created. Linux & macOS aws ssm describe-maintenance-window-tasks \ --window-id mw-0c50858d01EXAMPLE Windows aws ssm describe-maintenance-window-tasks ^ --window-id mw-0c50858d01EXAMPLE 3. The system returns information similar to the following. { "Tasks": [ { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTaskId": "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", "TaskArn": "AWS-RunShellScript", "Type": "RUN_COMMAND", "Targets": [ { "Key": "InstanceIds", "Values": [ "i-02573cafcfEXAMPLE" Maintenance Windows 1820 AWS Systems Manager User Guide ] } ], "TaskParameters": {}, "Priority": 10, "ServiceRoleArn": "arn:aws:iam::123456789012:role/ MyMaintenanceWindowServiceRole", "MaxConcurrency": "1", "MaxErrors": "1" } ] } 4. Wait until the task has had time to run, based on the schedule you specified in Step 1: Create the maintenance window using the AWS CLI. For example, if you specified -- schedule "rate(5 minutes)", wait five minutes. Then run the following command to view information about any executions that occurred for this task. Linux & macOS aws ssm describe-maintenance-window-executions \ --window-id mw-0c50858d01EXAMPLE Windows aws ssm describe-maintenance-window-executions ^ --window-id mw-0c50858d01EXAMPLE The system returns information similar to the following. { "WindowExecutions": [ { "WindowId": "mw-0c50858d01EXAMPLE", "WindowExecutionId": "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE", "Status": "SUCCESS", "StartTime": 1557593493.096, "EndTime": 1557593498.611 } ] Maintenance Windows 1821 AWS Systems Manager User Guide } Tip After the task runs successfully, you can decrease the rate at which the maintenance window runs. For example, run the following command to decrease the frequency to once a week. Replace mw-0c50858d01EXAMPLE with your own information. Linux & macOS aws ssm update-maintenance-window \ --window-id mw-0c50858d01EXAMPLE \ --schedule "rate(7 days)" Windows aws ssm update-maintenance-window ^ --window-id mw-0c50858d01EXAMPLE ^ --schedule "rate(7 days)" For information about managing maintenance window schedules, see Reference: Cron and rate expressions for Systems Manager and Maintenance window scheduling and active period options. For information about using the AWS Command Line Interface (AWS CLI) to modify a maintenance window, see Tutorial: Update a maintenance window using the AWS CLI. For practice running AWS CLI commands to view more details about your maintenance window task and its executions, continue to Tutorial: View information about tasks and task executions using the AWS CLI. Accessing tutorial command output It's beyond the scope of this tutorial to use the AWS CLI to view the output of the Run Command command associated with your maintenance window task executions. You could view this data, however, using the AWS CLI. (You could also view the output in the Systems Manager console or in a log file stored in an Amazon Simple Storage Service (Amazon Maintenance Windows 1822 AWS Systems Manager User Guide S3) bucket, if you had configured the maintenance window to store command output there.) You would find that the output of the df command on an EC2 instance for Linux is similar to the following. Filesystem 1K-blocks Used Available Use% Mounted on devtmpfs 485716 0 485716 0% /dev tmpfs 503624 0 503624 0% /dev/shm tmpfs 503624 328 503296 1% /run tmpfs 503624 0 503624 0% /sys/fs/cgroup /dev/xvda1 8376300 1464160 6912140 18% / The output of the ipconfig command on an EC2 instance for Windows Server is similar to the following: Windows IP Configuration Ethernet adapter Ethernet 2: Connection-specific DNS Suffix . : example.com IPv4 Address. . . . . . . . . . . : 10.24.34.0/23 Subnet Mask . . . . . . . . . . . : 255.255.255.255 Default Gateway . . . . . . . . . : 0.0.0.0 Ethernet adapter Ethernet: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : abc1.wa.example.net Wireless LAN adapter Local Area Connection* 1: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Wireless LAN adapter Wi-Fi: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::100b:c234:66d6:d24f%4 Maintenance Windows 1823 AWS Systems Manager User Guide IPv4 Address. . . . . . . . . . . : 192.0.2.0 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.0.2.0 Ethernet adapter Bluetooth Network Connection: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Examples: Register tasks with a maintenance window You can register a task in Run Command, a tool in AWS Systems Manager, with a maintenance window using the AWS Command Line Interface (AWS CLI), as demonstrated in Register tasks with the maintenance window. You can also register tasks for Systems Manager Automation workflows, AWS Lambda functions, and AWS Step Functions tasks, as demonstrated later in this topic. Note Specify one or more targets for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance
|
systems-manager-ug-527
|
systems-manager-ug.pdf
| 527 |
. . . . : Media disconnected Connection-specific DNS Suffix . : Examples: Register tasks with a maintenance window You can register a task in Run Command, a tool in AWS Systems Manager, with a maintenance window using the AWS Command Line Interface (AWS CLI), as demonstrated in Register tasks with the maintenance window. You can also register tasks for Systems Manager Automation workflows, AWS Lambda functions, and AWS Step Functions tasks, as demonstrated later in this topic. Note Specify one or more targets for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, AWS Lambda, and AWS Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets. In this topic, we provide examples of using the AWS Command Line Interface (AWS CLI) command register-task-with-maintenance-window to register each of the four supported task types with a maintenance window. The examples are for demonstration only, but you can modify them to create working task registration commands. Using the --cli-input-json option To better manage your task options, you can use the command option --cli-input-json, with option values referenced in a JSON file. To use the sample JSON file content we provide in the following examples, do the following on your local machine: 1. Create a file with a name such as MyRunCommandTask.json, MyAutomationTask.json, or another name that you prefer. 2. Copy the contents of our JSON sample into the file. Maintenance Windows 1824 AWS Systems Manager User Guide 3. Modify the contents of the file for your task registration, and then save the file. 4. In the same directory where you stored the file, run the following command. Substitute your file name for MyFile.json. Linux & macOS aws ssm register-task-with-maintenance-window \ --cli-input-json file://MyFile.json Windows aws ssm register-task-with-maintenance-window ^ --cli-input-json file://MyFile.json Pseudo parameters in maintenance window tasks In some examples, we use pseudo parameters as the method to pass ID information to your tasks. For instance, {{TARGET_ID}} and {{RESOURCE_ID}} can be used to pass IDs of AWS resources to Automation, Lambda, and Step Functions tasks. For more information about pseudo parameters in --task-invocation-parameters content, see Using pseudo parameters when registering maintenance window tasks. More info • Parameter options for the register-task-with-maintenance-windows command. • register-task-with-maintenance-window in the AWS CLI Command Reference • RegisterTaskWithMaintenanceWindow in the AWS Systems Manager API Reference Task registration examples The following sections provide a sample AWS CLI command for registering a supported task type and a JSON sample that can be used with the --cli-input-json option. Register a Systems Manager Run Command task The following examples demonstrate how to register Systems Manager Run Command tasks with a maintenance window using the AWS CLI. Maintenance Windows 1825 AWS Systems Manager Linux & macOS User Guide aws ssm register-task-with-maintenance-window \ --window-id mw-0c50858d01EXAMPLE \ --task-arn "AWS-RunShellScript" \ --max-concurrency 1 --max-errors 1 --priority 10 \ --targets "Key=InstanceIds,Values=i-02573cafcfEXAMPLE" \ --task-type "RUN_COMMAND" \ --task-invocation-parameters '{"RunCommand":{"Parameters":{"commands":["df"]}}}' Windows aws ssm register-task-with-maintenance-window ^ --window-id mw-0c50858d01EXAMPLE ^ --task-arn "AWS-RunShellScript" ^ --max-concurrency 1 --max-errors 1 --priority 10 ^ --targets "Key=InstanceIds,Values=i-02573cafcfEXAMPLE" ^ --task-type "RUN_COMMAND" ^ --task-invocation-parameters "{\"RunCommand\":{\"Parameters\":{\"commands\": [\"df\"]}}}" JSON content to use with --cli-input-json file option: { "TaskType": "RUN_COMMAND", "WindowId": "mw-0c50858d01EXAMPLE", "Description": "My Run Command task to update SSM Agent on an instance", "MaxConcurrency": "1", "MaxErrors": "1", "Name": "My-Run-Command-Task", "Priority": 10, "Targets": [ { "Key": "WindowTargetIds", "Values": [ "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ] } ], "TaskArn": "AWS-UpdateSSMAgent", "TaskInvocationParameters": { "RunCommand": { Maintenance Windows 1826 AWS Systems Manager User Guide "Comment": "A TaskInvocationParameters test comment", "NotificationConfig": { "NotificationArn": "arn:aws:sns:region:123456789012:my-sns-topic-name", "NotificationEvents": [ "All" ], "NotificationType": "Invocation" }, "OutputS3BucketName": "amzn-s3-demo-bucket", "OutputS3KeyPrefix": "S3-PREFIX", "TimeoutSeconds": 3600 } } } Register a Systems Manager Automation task The following examples demonstrate how to register Systems Manager Automation tasks with a maintenance window using the AWS CLI: AWS CLI command: Linux & macOS aws ssm register-task-with-maintenance-window \ --window-id "mw-0c50858d01EXAMPLE" \ --task-arn "AWS-RestartEC2Instance" \ --service-role-arn arn:aws:iam::123456789012:role/MyMaintenanceWindowServiceRole \ --task-type AUTOMATION \ --task-invocation-parameters "Automation={DocumentVersion=5,Parameters={InstanceId='{{RESOURCE_ID}}'}}" \ --priority 0 --name "My-Restart-EC2-Instances-Automation-Task" \ --description "Automation task to restart EC2 instances" Windows aws ssm register-task-with-maintenance-window ^ --window-id "mw-0c50858d01EXAMPLE" ^ --task-arn "AWS-RestartEC2Instance" ^ --service-role-arn arn:aws:iam::123456789012:role/MyMaintenanceWindowServiceRole ^ Maintenance Windows 1827 AWS Systems Manager User Guide --task-type AUTOMATION ^ --task-invocation-parameters "Automation={DocumentVersion=5,Parameters={InstanceId='{{TARGET_ID}}'}}" ^ --priority 0 --name "My-Restart-EC2-Instances-Automation-Task" ^ --description "Automation task to restart EC2 instances" JSON content to use with --cli-input-json file option: { "WindowId": "mw-0c50858d01EXAMPLE", "TaskArn": "AWS-PatchInstanceWithRollback", "TaskType": "AUTOMATION","TaskInvocationParameters": { "Automation": { "DocumentVersion": "1", "Parameters": { "instanceId": [ "{{RESOURCE_ID}}" ] } } } } Register an AWS Lambda task The following examples demonstrate how to register Lambda function tasks with a maintenance window using the AWS CLI. For these examples, the user who created the Lambda function named it SSMrestart-my- instances and created two parameters called instanceId and targetType. Important The IAM policy for Maintenance Windows requires that you add the prefix SSM to Lambda function (or alias) names. Before you proceed to register
|
systems-manager-ug-528
|
systems-manager-ug.pdf
| 528 |
JSON content to use with --cli-input-json file option: { "WindowId": "mw-0c50858d01EXAMPLE", "TaskArn": "AWS-PatchInstanceWithRollback", "TaskType": "AUTOMATION","TaskInvocationParameters": { "Automation": { "DocumentVersion": "1", "Parameters": { "instanceId": [ "{{RESOURCE_ID}}" ] } } } } Register an AWS Lambda task The following examples demonstrate how to register Lambda function tasks with a maintenance window using the AWS CLI. For these examples, the user who created the Lambda function named it SSMrestart-my- instances and created two parameters called instanceId and targetType. Important The IAM policy for Maintenance Windows requires that you add the prefix SSM to Lambda function (or alias) names. Before you proceed to register this type of task, update its name in AWS Lambda to include SSM. For example, if your Lambda function name is MyLambdaFunction, change it to SSMMyLambdaFunction. AWS CLI command: Maintenance Windows 1828 AWS Systems Manager Linux & macOS Important User Guide If you are using version 2 of the AWS CLI, you must include the option --cli-binary- format raw-in-base64-out in the following command if your Lambda payload is not base64 encoded. The cli_binary_format option is available only in version 2. For information about this and other AWS CLI config file settings, see Supported config file settings in the AWS Command Line Interface User Guide. aws ssm register-task-with-maintenance-window \ --window-id "mw-0c50858d01EXAMPLE" \ --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" \ --priority 2 --max-concurrency 10 --max-errors 5 --name "My-Lambda-Example" \ --description "A description for my LAMBDA example task" --task-type "LAMBDA" \ --task-arn "arn:aws:lambda:region:123456789012:function:serverlessrepo- SSMrestart-my-instances-C4JF9EXAMPLE" \ --task-invocation-parameters '{"Lambda":{"Payload":"{\"InstanceId\": \"{{RESOURCE_ID}}\",\"targetType\":\"{{TARGET_TYPE}}\"}","Qualifier": "$LATEST"}}' PowerShell Important If you are using version 2 of the AWS CLI, you must include the option --cli-binary- format raw-in-base64-out in the following command if your Lambda payload is not base64 encoded. The cli_binary_format option is available only in version 2. For information about this and other AWS CLI config file settings, see Supported config file settings in the AWS Command Line Interface User Guide. aws ssm register-task-with-maintenance-window ` --window-id "mw-0c50858d01EXAMPLE" ` --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ` --priority 2 --max-concurrency 10 --max-errors 5 --name "My-Lambda-Example" ` --description "A description for my LAMBDA example task" --task-type "LAMBDA" ` --task-arn "arn:aws:lambda:region:123456789012:function:serverlessrepo- SSMrestart-my-instances-C4JF9EXAMPLE" ` Maintenance Windows 1829 AWS Systems Manager User Guide --task-invocation-parameters '{\"Lambda\":{\"Payload\":\"{\\\"InstanceId\\\":\\ \"{{RESOURCE_ID}}\\\",\\\"targetType\\\":\\\"{{TARGET_TYPE}}\\\"}\",\"Qualifier\": \"$LATEST\"}}' JSON content to use with --cli-input-json file option: { "WindowId": "mw-0c50858d01EXAMPLE", "Targets": [ { "Key": "WindowTargetIds", "Values": [ "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ] } ], "TaskArn": "SSM_RestartMyInstances", "TaskType": "LAMBDA", "MaxConcurrency": "10", "MaxErrors": "10", "TaskInvocationParameters": { "Lambda": { "ClientContext": "ew0KICAi--truncated--0KIEXAMPLE", "Payload": "{ \"instanceId\": \"{{RESOURCE_ID}}\", \"targetType\": \"{{TARGET_TYPE}}\" }", "Qualifier": "$LATEST" } }, "Name": "My-Lambda-Task", "Description": "A description for my LAMBDA task", "Priority": 5 } Register a Step Functions task The following examples demonstrate how to register Step Functions state machine tasks with a maintenance window using the AWS CLI. Note Maintenance window tasks support Step Functions Standard state machine workflows only. They don't support Express state machine workflows. For information about state machine Maintenance Windows 1830 AWS Systems Manager User Guide workflow types, see Standard vs. Express Workflows in the AWS Step Functions Developer Guide. For these examples, the user who created the Step Functions state machine created a state machine named SSMMyStateMachine with a parameter called instanceId. Important The AWS Identity and Access Management (IAM) policy for Maintenance Windows requires that you prefix Step Functions state machine names with SSM. Before you proceed to register this type of task, you must update its name in AWS Step Functions to include SSM. For example, if your state machine name is MyStateMachine, change it to SSMMyStateMachine. AWS CLI command: Linux & macOS aws ssm register-task-with-maintenance-window \ --window-id "mw-0c50858d01EXAMPLE" \ --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" \ --task-arn arn:aws:states:region:123456789012:stateMachine:SSMMyStateMachine- MggiqEXAMPLE \ --task-type STEP_FUNCTIONS \ --task-invocation-parameters '{"StepFunctions":{"Input":"{\"InstanceId\": \"{{RESOURCE_ID}}\"}", "Name":"{{INVOCATION_ID}}"}}' \ --priority 0 --max-concurrency 10 --max-errors 5 \ --name "My-Step-Functions-Task" --description "A description for my Step Functions task" PowerShell aws ssm register-task-with-maintenance-window ` --window-id "mw-0c50858d01EXAMPLE" ` --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ` --task-arn arn:aws:states:region:123456789012:stateMachine:SSMMyStateMachine- MggiqEXAMPLE ` --task-type STEP_FUNCTIONS ` Maintenance Windows 1831 AWS Systems Manager User Guide --task-invocation-parameters '{\"StepFunctions\":{\"Input\":\"{\\\"InstanceId\\ \":\\\"{{RESOURCE_ID}}\\\"}\", \"Name\":\"{{INVOCATION_ID}}\"}}' ` --priority 0 --max-concurrency 10 --max-errors 5 ` --name "My-Step-Functions-Task" --description "A description for my Step Functions task" JSON content to use with --cli-input-json file option: { "WindowId": "mw-0c50858d01EXAMPLE", "Targets": [ { "Key": "WindowTargetIds", "Values": [ "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ] } ], "TaskArn": "SSM_MyStateMachine", "TaskType": "STEP_FUNCTIONS", "MaxConcurrency": "10", "MaxErrors": "10", "TaskInvocationParameters": { "StepFunctions": { "Input": "{ \"instanceId\": \"{{TARGET_ID}}\" }", "Name": "{{INVOCATION_ID}}" } }, "Name": "My-Step-Functions-Task", "Description": "A description for my Step Functions task", "Priority": 5 } Parameter options for the register-task-with-maintenance-windows command The register-task-with-maintenance-window command provides several options for configuring a task according to your needs. Some are required, some are optional, and some apply to only a single maintenance window task type. This topic provides information about some of these options to help you work with samples in this tutorial section. For information about all command options, see register-task-with-maintenance- window in the AWS CLI Command Reference. Maintenance Windows 1832 AWS Systems Manager Command option: --task-arn User Guide The option --task-arn is used to
|
systems-manager-ug-529
|
systems-manager-ug.pdf
| 529 |
"My-Step-Functions-Task", "Description": "A description for my Step Functions task", "Priority": 5 } Parameter options for the register-task-with-maintenance-windows command The register-task-with-maintenance-window command provides several options for configuring a task according to your needs. Some are required, some are optional, and some apply to only a single maintenance window task type. This topic provides information about some of these options to help you work with samples in this tutorial section. For information about all command options, see register-task-with-maintenance- window in the AWS CLI Command Reference. Maintenance Windows 1832 AWS Systems Manager Command option: --task-arn User Guide The option --task-arn is used to specify the resource that the task operates on. The value that you specify depends on the type of task you're registering, as described in the following table. TaskArn formats for maintenance window tasks Maintenance window task type TaskArn value RUN_COMMAND and AUTOMATION TaskArn is the SSM document name or Amazon Resource Name (ARN). For example: LAMBDA AWS-RunBatchShellScript -or- arn:aws:ssm: region:11112222 . 3333:document/My-Document TaskArn is the function name or ARN. For example: SSMMy-Lambda-Function -or- arn:aws:lambda: region:11112222 3333:function:SSMMyLambdaFu nction . Important The IAM policy for Maintenance Windows requires that you add the prefix SSM to Lambda function (or alias) names. Before you proceed to register this type of task, update its name in AWS Lambda to include SSM. For example, if your Lambda function name is MyLambdaFunction , Maintenance Windows 1833 AWS Systems Manager User Guide Maintenance window task type TaskArn value STEP_FUNCTIONS change it to SSMMyLambdaFunctio n . TaskArn is the state machine ARN. For example: arn:aws:states:us-east-2:11 1122223333:stateMachine:SSM MyStateMachine . Important The IAM policy for maintenance windows requires that you prefix Step Functions state machine names with SSM. Before you register this type of task, you must update its name in AWS Step Functions to include SSM. For example, if your state machine name is MyStateMachine , change it to SSMMyStateMachine . Command option: --service-role-arn The role for AWS Systems Manager to assume when running the maintenance window task. For more information, see Setting up Maintenance Windows Command option: --task-invocation-parameters The --task-invocation-parameters option is used to specify the parameters that are unique to each of the four task types. The supported parameters for each of the four task types are described in the following table. Maintenance Windows 1834 AWS Systems Manager Note User Guide For information about using pseudo parameters in --task-invocation-parameters content, such as {{TARGET_ID}}, see Using pseudo parameters when registering maintenance window tasks. Task invocation parameters options for maintenance window tasks Maintenance window task type Available parameters Example RUN_COMMAND Comment DocumentHash DocumentHashType NotificationConfig OutputS3BucketName OutPutS3KeyPrefix Parameters ServiceRoleArn TimeoutSeconds "TaskInvocationPar ameters": { "RunCommand": { "Comment" : "My Run Command task comment", "Document Hash": "6554ed3d-- truncated--5EXAMPLE", "Document HashType": "Sha256", "Notifica tionConfig": { "Notifica tionArn": "arn:aws: sns: region:12345678 9012:my-sns-topic- name", "NotificationEvents": [ "FAILURE" ], "NotificationType": "Invocation" }, Maintenance Windows 1835 AWS Systems Manager User Guide Maintenance window task type Available parameters Example "OutputS3 BucketName": "amzn-s3- demo-bucket", "OutputS3 KeyPrefix": " S3-PREFIX ", "Paramete rs": { "commands": [ "Get-ChildItem$env: temp-Recurse|Remove- Item-Recurse-force" ] }, "ServiceR oleArn": "arn:aws: iam::123456789012: role/MyMaintenance WindowServiceRole", "TimeoutS econds": 3600 } } Maintenance Windows 1836 AWS Systems Manager User Guide Maintenance window task type Available parameters Example AUTOMATION DocumentVersion Parameters LAMBDA ClientContext Payload Qualifier "TaskInvocationPar ameters": { "Automation": { "Document Version": "3", "Paramete rs": { "instanceid": [ "{{TARGET_ID}}" ] } } } "TaskInvocationPar ameters": { "Lambda": { "ClientCo ntext": "ew0KICAi --truncated--0KIEX AMPLE", "Payload" : "{ \"targetId\": \"{{TARGET_ID}}\", \"targetType\": \"{{TARGET_TYPE}}\ " }", "Qualifie r": "$LATEST" } } Maintenance Windows 1837 AWS Systems Manager User Guide Maintenance window task type STEP_FUNCTIONS Available parameters Example Input Name "TaskInvocationPar ameters": { "StepFunc tions": { "Input": "{ \"targetId\": \"{{TARGET_ID}}\" }", "Name": "{{INVOCATION_ID}}" } } Tutorial: View information about maintenance windows using the AWS CLI This tutorial includes commands to help you update or get information about your maintenance windows, tasks, executions, and invocations. The examples are organized by command to demonstrate how to use command options to filter for the type of detail you want to see. As you follow the steps in this tutorial, replace the values in italicized red text with your own options and IDs. For example, replace the maintenance window ID mw-0c50858d01EXAMPLE and the instance ID i-02573cafcfEXAMPLE with IDs of resources you create. For information about setting up and configuring the AWS Command Line Interface (AWS CLI), see Installing, updating, and uninstalling the AWS CLI and Configuring the AWS CLI. Command examples • Examples for 'describe-maintenance-windows' • Examples for 'describe-maintenance-window-targets' • Examples for 'describe-maintenance-window-tasks' • Examples for 'describe-maintenance-windows-for-target' • Examples for 'describe-maintenance-window-executions' • Examples for 'describe-maintenance-window-schedule' Maintenance Windows 1838 AWS Systems Manager User Guide Examples for 'describe-maintenance-windows' List all maintenance windows in your AWS account Run the following command. aws ssm describe-maintenance-windows The system returns information similar to the following. { "WindowIdentities":[ { "WindowId":"mw-0c50858d01EXAMPLE", "Name":"My-First-Maintenance-Window", "Enabled":true, "Duration":2, "Cutoff":0, "NextExecutionTime": "2019-05-18T17:01:01.137Z" }, { "WindowId":"mw-9a8b7c6d5eEXAMPLE",
|
systems-manager-ug-530
|
systems-manager-ug.pdf
| 530 |
For information about setting up and configuring the AWS Command Line Interface (AWS CLI), see Installing, updating, and uninstalling the AWS CLI and Configuring the AWS CLI. Command examples • Examples for 'describe-maintenance-windows' • Examples for 'describe-maintenance-window-targets' • Examples for 'describe-maintenance-window-tasks' • Examples for 'describe-maintenance-windows-for-target' • Examples for 'describe-maintenance-window-executions' • Examples for 'describe-maintenance-window-schedule' Maintenance Windows 1838 AWS Systems Manager User Guide Examples for 'describe-maintenance-windows' List all maintenance windows in your AWS account Run the following command. aws ssm describe-maintenance-windows The system returns information similar to the following. { "WindowIdentities":[ { "WindowId":"mw-0c50858d01EXAMPLE", "Name":"My-First-Maintenance-Window", "Enabled":true, "Duration":2, "Cutoff":0, "NextExecutionTime": "2019-05-18T17:01:01.137Z" }, { "WindowId":"mw-9a8b7c6d5eEXAMPLE", "Name":"My-Second-Maintenance-Window", "Enabled":true, "Duration":4, "Cutoff":1, "NextExecutionTime": "2019-05-30T03:30:00.137Z" }, ] } List all enabled maintenance windows Run the following command. aws ssm describe-maintenance-windows --filters "Key=Enabled,Values=true" The system returns information similar to the following. { "WindowIdentities":[ Maintenance Windows 1839 User Guide AWS Systems Manager { "WindowId":"mw-0c50858d01EXAMPLE", "Name":"My-First-Maintenance-Window", "Enabled":true, "Duration":2, "Cutoff":0, "NextExecutionTime": "2019-05-18T17:01:01.137Z" }, { "WindowId":"mw-9a8b7c6d5eEXAMPLE", "Name":"My-Second-Maintenance-Window", "Enabled":true, "Duration":4, "Cutoff":1, "NextExecutionTime": "2019-05-30T03:30:00.137Z" }, ] } List all disabled maintenance windows Run the following command. aws ssm describe-maintenance-windows --filters "Key=Enabled,Values=false" The system returns information similar to the following. { "WindowIdentities": [ { "WindowId": "mw-6e5c9d4b7cEXAMPLE", "Name": "My-Disabled-Maintenance-Window", "Enabled": false, "Duration": 2, "Cutoff": 1 } ] } List all maintenance windows having names that start with a certain prefix Run the following command. Maintenance Windows 1840 AWS Systems Manager User Guide aws ssm describe-maintenance-windows --filters "Key=Name,Values=My" The system returns information similar to the following. { "WindowIdentities": [ { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "My-First-Maintenance-Window", "Enabled": true, "Duration": 2, "Cutoff": 0, "NextExecutionTime": "2019-05-18T17:01:01.137Z" }, { "WindowId": "mw-9a8b7c6d5eEXAMPLE", "Name": "My-Second-Maintenance-Window", "Enabled": true, "Duration": 4, "Cutoff": 1, "NextExecutionTime": "2019-05-30T03:30:00.137Z" }, { "WindowId": "mw-6e5c9d4b7cEXAMPLE", "Name": "My-Disabled-Maintenance-Window", "Enabled": false, "Duration": 2, "Cutoff": 1 } ] } Examples for 'describe-maintenance-window-targets' Display the targets for a maintenance window matching a specific owner information value Run the following command. Linux & macOS aws ssm describe-maintenance-window-targets \ --window-id "mw-6e5c9d4b7cEXAMPLE" \ Maintenance Windows 1841 AWS Systems Manager User Guide --filters "Key=OwnerInformation,Values=CostCenter1" Windows aws ssm describe-maintenance-window-targets ^ --window-id "mw-6e5c9d4b7cEXAMPLE" ^ --filters "Key=OwnerInformation,Values=CostCenter1" Note The supported filter keys are Type, WindowTargetId and OwnerInformation. The system returns information similar to the following. { "Targets": [ { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTargetId": "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE", "ResourceType": "INSTANCE", "Targets": [ { "Key": "tag:Name", "Values": [ "Production" ] } ], "OwnerInformation": "CostCenter1", "Name": "Target1" } ] } Examples for 'describe-maintenance-window-tasks' Show all registered tasks that invoke the SSM command document AWS- RunPowerShellScript Run the following command. Maintenance Windows 1842 AWS Systems Manager Linux & macOS User Guide aws ssm describe-maintenance-window-tasks \ --window-id "mw-0c50858d01EXAMPLE" \ --filters "Key=TaskArn,Values=AWS-RunPowerShellScript" Windows aws ssm describe-maintenance-window-tasks ^ --window-id "mw-0c50858d01EXAMPLE" ^ --filters "Key=TaskArn,Values=AWS-RunPowerShellScript" The system returns information similar to the following. { "Tasks":[ { "ServiceRoleArn": "arn:aws:iam::111122223333:role/ MyMaintenanceWindowServiceRole", "MaxErrors":"1", "TaskArn":"AWS-RunPowerShellScript", "MaxConcurrency":"1", "WindowTaskId":"4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", "TaskParameters":{ "commands":{ "Values":[ "driverquery.exe" ] } }, "Priority":3, "Type":"RUN_COMMAND", "Targets":[ { "TaskTargetId":"i-02573cafcfEXAMPLE", "TaskTargetType":"INSTANCE" } ] }, { "ServiceRoleArn":"arn:aws:iam::111122223333:role/ MyMaintenanceWindowServiceRole", Maintenance Windows 1843 AWS Systems Manager User Guide "MaxErrors":"1", "TaskArn":"AWS-RunPowerShellScript", "MaxConcurrency":"1", "WindowTaskId":"4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", "TaskParameters":{ "commands":{ "Values":[ "ipconfig" ] } }, "Priority":1, "Type":"RUN_COMMAND", "Targets":[ { "TaskTargetId":"i-02573cafcfEXAMPLE", "TaskTargetType":"WINDOW_TARGET" } ] } ] } Show all registered tasks that have a priority of "3" Run the following command. Linux & macOS aws ssm describe-maintenance-window-tasks \ --window-id "mw-9a8b7c6d5eEXAMPLE" \ --filters "Key=Priority,Values=3" Windows aws ssm describe-maintenance-window-tasks ^ --window-id "mw-9a8b7c6d5eEXAMPLE" ^ --filters "Key=Priority,Values=3" The system returns information similar to the following. { Maintenance Windows 1844 User Guide AWS Systems Manager "Tasks":[ { "ServiceRoleArn":"arn:aws:iam::111122223333:role/ MyMaintenanceWindowServiceRole", "MaxErrors":"1", "TaskArn":"AWS-RunPowerShellScript", "MaxConcurrency":"1", "WindowTaskId":"4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", "TaskParameters":{ "commands":{ "Values":[ "driverquery.exe" ] } }, "Priority":3, "Type":"RUN_COMMAND", "Targets":[ { "TaskTargetId":"i-02573cafcfEXAMPLE", "TaskTargetType":"INSTANCE" } ] } ] } Show all registered tasks that have a priority of "1" and use Run Command Run the following command. Linux & macOS aws ssm describe-maintenance-window-tasks \ --window-id "mw-0c50858d01EXAMPLE" \ --filters "Key=Priority,Values=1" "Key=TaskType,Values=RUN_COMMAND" Windows aws ssm describe-maintenance-window-tasks ^ --window-id "mw-0c50858d01EXAMPLE" ^ --filters "Key=Priority,Values=1" "Key=TaskType,Values=RUN_COMMAND" Maintenance Windows 1845 AWS Systems Manager User Guide The system returns information similar to the following. { "Tasks": [ { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTaskId": "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", "TaskArn": "AWS-RunShellScript", "Type": "RUN_COMMAND", "Targets": [ { "Key": "InstanceIds", "Values": [ "i-02573cafcfEXAMPLE" ] } ], "TaskParameters": {}, "Priority": 1, "ServiceRoleArn": "arn:aws:iam::111122223333:role/ MyMaintenanceWindowServiceRole", "MaxConcurrency": "1", "MaxErrors": "1" }, { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTaskId": "8a5c4629-31b0-4edd-8aea-33698EXAMPLE", "TaskArn": "AWS-UpdateSSMAgent", "Type": "RUN_COMMAND", "Targets": [ { "Key": "InstanceIds", "Values": [ "i-0471e04240EXAMPLE" ] } ], "TaskParameters": {}, "Priority": 1, "ServiceRoleArn": "arn:aws:iam::111122223333:role/ MyMaintenanceWindowServiceRole", "MaxConcurrency": "1", "MaxErrors": "1", "Name": "My-Run-Command-Task", Maintenance Windows 1846 AWS Systems Manager User Guide "Description": "My Run Command task to update SSM Agent on an instance" } ] } Examples for 'describe-maintenance-windows-for-target' List information about the maintenance window targets or tasks associated with a specific node Run the following command. Linux & macOS aws ssm describe-maintenance-windows-for-target \ --resource-type INSTANCE \ --targets "Key=InstanceIds,Values=i-02573cafcfEXAMPLE" \ --max-results 10 Windows aws ssm describe-maintenance-windows-for-target ^ --resource-type INSTANCE ^ --targets "Key=InstanceIds,Values=i-02573cafcfEXAMPLE" ^ --max-results 10 The system returns information similar to the following. { "WindowIdentities": [ { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "My-First-Maintenance-Window" }, { "WindowId": "mw-9a8b7c6d5eEXAMPLE", "Name": "My-Second-Maintenance-Window" } ] } Maintenance Windows 1847 AWS
|
systems-manager-ug-531
|
systems-manager-ug.pdf
| 531 |
Windows 1846 AWS Systems Manager User Guide "Description": "My Run Command task to update SSM Agent on an instance" } ] } Examples for 'describe-maintenance-windows-for-target' List information about the maintenance window targets or tasks associated with a specific node Run the following command. Linux & macOS aws ssm describe-maintenance-windows-for-target \ --resource-type INSTANCE \ --targets "Key=InstanceIds,Values=i-02573cafcfEXAMPLE" \ --max-results 10 Windows aws ssm describe-maintenance-windows-for-target ^ --resource-type INSTANCE ^ --targets "Key=InstanceIds,Values=i-02573cafcfEXAMPLE" ^ --max-results 10 The system returns information similar to the following. { "WindowIdentities": [ { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "My-First-Maintenance-Window" }, { "WindowId": "mw-9a8b7c6d5eEXAMPLE", "Name": "My-Second-Maintenance-Window" } ] } Maintenance Windows 1847 AWS Systems Manager User Guide Examples for 'describe-maintenance-window-executions' List all tasks run before a certain date Run the following command. Linux & macOS aws ssm describe-maintenance-window-executions \ --window-id "mw-9a8b7c6d5eEXAMPLE" \ --filters "Key=ExecutedBefore,Values=2019-05-12T05:00:00Z" Windows aws ssm describe-maintenance-window-executions ^ --window-id "mw-9a8b7c6d5eEXAMPLE" ^ --filters "Key=ExecutedBefore,Values=2019-05-12T05:00:00Z" The system returns information similar to the following. { "WindowExecutions": [ { "WindowId": "mw-0c50858d01EXAMPLE", "WindowExecutionId": "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE", "Status": "FAILED", "StatusDetails": "The following SSM parameters are invalid: LevelUp", "StartTime": 1557617747.993, "EndTime": 1557617748.101 }, { "WindowId": "mw-9a8b7c6d5eEXAMPLE", "WindowExecutionId": "791b72e0-f0da-4021-8b35-f95dfEXAMPLE", "Status": "SUCCESS", "StartTime": 1557594085.428, "EndTime": 1557594090.978 }, { "WindowId": "mw-0c50858d01EXAMPLE", "WindowExecutionId": "ecec60fa-6bb0-4d26-98c7-140308EXAMPLE", "Status": "SUCCESS", "StartTime": 1557593793.483, Maintenance Windows 1848 AWS Systems Manager User Guide "EndTime": 1557593798.978 } ] } List all tasks run after a certain date Run the following command. Linux & macOS aws ssm describe-maintenance-window-executions \ --window-id "mw-9a8b7c6d5eEXAMPLE" \ --filters "Key=ExecutedAfter,Values=2018-12-31T17:00:00Z" Windows aws ssm describe-maintenance-window-executions ^ --window-id "mw-9a8b7c6d5eEXAMPLE" ^ --filters "Key=ExecutedAfter,Values=2018-12-31T17:00:00Z" The system returns information similar to the following. { "WindowExecutions": [ { "WindowId": "mw-0c50858d01EXAMPLE", "WindowExecutionId": "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE", "Status": "FAILED", "StatusDetails": "The following SSM parameters are invalid: LevelUp", "StartTime": 1557617747.993, "EndTime": 1557617748.101 }, { "WindowId": "mw-9a8b7c6d5eEXAMPLE", "WindowExecutionId": "791b72e0-f0da-4021-8b35-f95dfEXAMPLE", "Status": "SUCCESS", "StartTime": 1557594085.428, "EndTime": 1557594090.978 }, { "WindowId": "mw-0c50858d01EXAMPLE", Maintenance Windows 1849 AWS Systems Manager User Guide "WindowExecutionId": "ecec60fa-6bb0-4d26-98c7-140308EXAMPLE", "Status": "SUCCESS", "StartTime": 1557593793.483, "EndTime": 1557593798.978 } ] } Examples for 'describe-maintenance-window-schedule' Display the next ten scheduled maintenance window runs for a particular node Run the following command. Linux & macOS aws ssm describe-maintenance-window-schedule \ --resource-type INSTANCE \ --targets "Key=InstanceIds,Values=i-07782c72faEXAMPLE" \ --max-results 10 Windows aws ssm describe-maintenance-window-schedule ^ --resource-type INSTANCE ^ --targets "Key=InstanceIds,Values=i-07782c72faEXAMPLE" ^ --max-results 10 The system returns information similar to the following. { "ScheduledWindowExecutions": [ { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "My-First-Maintenance-Window", "ExecutionTime": "2019-05-18T23:35:24.902Z" }, { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "My-First-Maintenance-Window", "ExecutionTime": "2019-05-25T23:35:24.902Z" }, Maintenance Windows 1850 AWS Systems Manager { User Guide "WindowId": "mw-0c50858d01EXAMPLE", "Name": "My-First-Maintenance-Window", "ExecutionTime": "2019-06-01T23:35:24.902Z" }, { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "My-First-Maintenance-Window", "ExecutionTime": "2019-06-08T23:35:24.902Z" }, { "WindowId": "mw-9a8b7c6d5eEXAMPLE", "Name": "My-Second-Maintenance-Window", "ExecutionTime": "2019-06-15T23:35:24.902Z" }, { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "My-First-Maintenance-Window", "ExecutionTime": "2019-06-22T23:35:24.902Z" }, { "WindowId": "mw-9a8b7c6d5eEXAMPLE", "Name": "My-Second-Maintenance-Window", "ExecutionTime": "2019-06-29T23:35:24.902Z" }, { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "My-First-Maintenance-Window", "ExecutionTime": "2019-07-06T23:35:24.902Z" }, { "WindowId": "mw-9a8b7c6d5eEXAMPLE", "Name": "My-Second-Maintenance-Window", "ExecutionTime": "2019-07-13T23:35:24.902Z" }, { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "My-First-Maintenance-Window", "ExecutionTime": "2019-07-20T23:35:24.902Z" } ], "NextToken": "AAEABUXdceT92FvtKld/dGHELj5Mi+GKW/EXAMPLE" } Maintenance Windows 1851 AWS Systems Manager User Guide Display the maintenance window schedule for nodes tagged with a certain key-value pair Run the following command. Linux & macOS aws ssm describe-maintenance-window-schedule \ --resource-type INSTANCE \ --targets "Key=tag:prod,Values=rhel7" Windows aws ssm describe-maintenance-window-schedule ^ --resource-type INSTANCE ^ --targets "Key=tag:prod,Values=rhel7" The system returns information similar to the following. { "ScheduledWindowExecutions": [ { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "DemoRateStartDate", "ExecutionTime": "2019-10-20T05:34:56-07:00" }, { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "DemoRateStartDate", "ExecutionTime": "2019-10-21T05:34:56-07:00" }, { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "DemoRateStartDate", "ExecutionTime": "2019-10-22T05:34:56-07:00" }, { "WindowId": "mw-0c50858d01EXAMPLE", "Name": "DemoRateStartDate", "ExecutionTime": "2019-10-23T05:34:56-07:00" }, { "WindowId": "mw-0c50858d01EXAMPLE", Maintenance Windows 1852 AWS Systems Manager User Guide "Name": "DemoRateStartDate", "ExecutionTime": "2019-10-24T05:34:56-07:00" } ], "NextToken": "AAEABccwSXqQRGKiTZ1yzGELR6cxW4W/EXAMPLE" } Display start times for next four runs of a maintenance window Run the following command. Linux & macOS aws ssm describe-maintenance-window-schedule \ --window-id "mw-0c50858d01EXAMPLE" \ --max-results "4" Windows aws ssm describe-maintenance-window-schedule ^ --window-id "mw-0c50858d01EXAMPLE" ^ --max-results "4" The system returns information similar to the following. { "WindowSchedule": [ { "ScheduledWindowExecutions": [ { "ExecutionTime": "2019-10-04T10:10:10Z", "Name": "My-First-Maintenance-Window", "WindowId": "mw-0c50858d01EXAMPLE" }, { "ExecutionTime": "2019-10-11T10:10:10Z", "Name": "My-First-Maintenance-Window", "WindowId": "mw-0c50858d01EXAMPLE" }, { "ExecutionTime": "2019-10-18T10:10:10Z", "Name": "My-First-Maintenance-Window", Maintenance Windows 1853 AWS Systems Manager User Guide "WindowId": "mw-0c50858d01EXAMPLE" }, { "ExecutionTime": "2019-10-25T10:10:10Z", "Name": "My-First-Maintenance-Window", "WindowId": "mw-0c50858d01EXAMPLE" } ] } ] } Tutorial: View information about tasks and task executions using the AWS CLI This tutorial demonstrates how to use the AWS Command Line Interface (AWS CLI) to view details about your completed maintenance window tasks. If you're continuing directly from Tutorial: Create and configure a maintenance window using the AWS CLI, make sure you have allowed enough time for your maintenance window to run at least once in order to see its execution results. As you follow the steps in this tutorial, replace the values in italicized red text with your own options and IDs. For example, replace the maintenance window ID mw-0c50858d01EXAMPLE and the instance ID i-02573cafcfEXAMPLE with IDs of resources you create. To view information about tasks and task executions using the AWS CLI 1. Run the following command to view a list of task executions for a specific
|
systems-manager-ug-532
|
systems-manager-ug.pdf
| 532 |
Create and configure a maintenance window using the AWS CLI, make sure you have allowed enough time for your maintenance window to run at least once in order to see its execution results. As you follow the steps in this tutorial, replace the values in italicized red text with your own options and IDs. For example, replace the maintenance window ID mw-0c50858d01EXAMPLE and the instance ID i-02573cafcfEXAMPLE with IDs of resources you create. To view information about tasks and task executions using the AWS CLI 1. Run the following command to view a list of task executions for a specific maintenance window. Linux & macOS aws ssm describe-maintenance-window-executions \ --window-id "mw-0c50858d01EXAMPLE" Windows aws ssm describe-maintenance-window-executions ^ --window-id "mw-0c50858d01EXAMPLE" The system returns information similar to the following. Maintenance Windows 1854 AWS Systems Manager User Guide { "WindowExecutions": [ { "WindowId": "mw-0c50858d01EXAMPLE", "WindowExecutionId": "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE", "Status": "SUCCESS", "StartTime": 1557593793.483, "EndTime": 1557593798.978 }, { "WindowId": "mw-0c50858d01EXAMPLE", "WindowExecutionId": "791b72e0-f0da-4021-8b35-f95dfEXAMPLE", "Status": "SUCCESS", "StartTime": 1557593493.096, "EndTime": 1557593498.611 }, { "WindowId": "mw-0c50858d01EXAMPLE", "WindowExecutionId": "ecec60fa-6bb0-4d26-98c7-140308EXAMPLE", "Status": "SUCCESS", "StatusDetails": "No tasks to execute.", "StartTime": 1557593193.309, "EndTime": 1557593193.334 } ] } 2. Run the following command to get information about a maintenance window task execution. Linux & macOS aws ssm get-maintenance-window-execution \ --window-execution-id "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE" Windows aws ssm get-maintenance-window-execution ^ --window-execution-id "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE" The system returns information similar to the following. Maintenance Windows 1855 AWS Systems Manager User Guide { "WindowExecutionId": "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE", "TaskIds": [ "c9b05aba-197f-4d8d-be34-e73fbEXAMPLE" ], "Status": "SUCCESS", "StartTime": 1557593493.096, "EndTime": 1557593498.611 } 3. Run the following command to list the tasks run as part of a maintenance window execution. Linux & macOS aws ssm describe-maintenance-window-execution-tasks \ --window-execution-id "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE" Windows aws ssm describe-maintenance-window-execution-tasks ^ --window-execution-id "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE" The system returns information similar to the following. { "WindowExecutionTaskIdentities": [ { "WindowExecutionId": "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE", "TaskExecutionId": "c9b05aba-197f-4d8d-be34-e73fbEXAMPLE", "Status": "SUCCESS", "StartTime": 1557593493.162, "EndTime": 1557593498.57, "TaskArn": "AWS-RunShellScript", "TaskType": "RUN_COMMAND" } ] } 4. Run the following command to get the details of a task execution. Maintenance Windows 1856 AWS Systems Manager Linux & macOS User Guide aws ssm get-maintenance-window-execution-task \ --window-execution-id "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE" \ --task-id "c9b05aba-197f-4d8d-be34-e73fbEXAMPLE" Windows aws ssm get-maintenance-window-execution-task ^ --window-execution-id "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE" ^ --task-id "c9b05aba-197f-4d8d-be34-e73fbEXAMPLE" The system returns information similar to the following. { "WindowExecutionId": "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE", "TaskExecutionId": "c9b05aba-197f-4d8d-be34-e73fbEXAMPLE", "TaskArn": "AWS-RunShellScript", "ServiceRole": "arn:aws:iam::111122223333:role/MyMaintenanceWindowServiceRole", "Type": "RUN_COMMAND", "TaskParameters": [ { "aws:InstanceId": { "Values": [ "i-02573cafcfEXAMPLE" ] }, "commands": { "Values": [ "df" ] } } ], "Priority": 10, "MaxConcurrency": "1", "MaxErrors": "1", "Status": "SUCCESS", "StartTime": 1557593493.162, "EndTime": 1557593498.57 Maintenance Windows 1857 AWS Systems Manager } User Guide 5. Run the following command to get the specific task invocations performed for a task execution. Linux & macOS aws ssm describe-maintenance-window-execution-task-invocations \ --window-execution-id "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE" \ --task-id "c9b05aba-197f-4d8d-be34-e73fbEXAMPLE" Windows aws ssm describe-maintenance-window-execution-task-invocations ^ --window-execution-id "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE" ^ --task-id "c9b05aba-197f-4d8d-be34-e73fbEXAMPLE" The system returns information similar to the following. { "WindowExecutionTaskInvocationIdentities": [ { "WindowExecutionId": "14bea65d-5ccc-462d-a2f3-e99c8EXAMPLE", "TaskExecutionId": "c9b05aba-197f-4d8d-be34-e73fbEXAMPLE", "InvocationId": "c336d2ab-09de-44ba-8f6a-6136cEXAMPLE", "ExecutionId": "76a5a04f-caf6-490c-b448-92c02EXAMPLE", "TaskType": "RUN_COMMAND", "Parameters": "{\"documentName\":\"AWS-RunShellScript\",\"instanceIds \":[\"i-02573cafcfEXAMPLE\"],\"maxConcurrency\":\"1\",\"maxErrors\":\"1\", \"parameters\":{\"commands\":[\"df\"]}}", "Status": "SUCCESS", "StatusDetails": "Success", "StartTime": 1557593493.222, "EndTime": 1557593498.466 } ] } Maintenance Windows 1858 AWS Systems Manager User Guide Tutorial: Update a maintenance window using the AWS CLI This tutorial demonstrates how to use the AWS Command Line Interface (AWS CLI) to update a maintenance window. It also shows you how to update different task types, including those for AWS Systems Manager Run Command and Automation, AWS Lambda, and AWS Step Functions. The examples in this section use the following Systems Manager actions for updating a maintenance window: • UpdateMaintenanceWindow • UpdateMaintenanceWindowTarget • UpdateMaintenanceWindowTask • DeregisterTargetFromMaintenanceWindow For information about using the Systems Manager console to update a maintenance window, see Update or delete maintenance window resources using the console. As you follow the steps in this tutorial, replace the values in italicized red text with your own options and IDs. For example, replace the maintenance window ID mw-0c50858d01EXAMPLE and the instance ID i-02573cafcfEXAMPLE with IDs of resources you create. To update a maintenance window using the AWS CLI 1. Open the AWS CLI and run the following command to update a target to include a name and a description. Linux & macOS aws ssm update-maintenance-window-target \ --window-id "mw-0c50858d01EXAMPLE" \ --window-target-id "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" \ --name "My-Maintenance-Window-Target" \ --description "Description for my maintenance window target" Windows aws ssm update-maintenance-window-target ^ --window-id "mw-0c50858d01EXAMPLE" ^ --window-target-id "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ^ Maintenance Windows 1859 AWS Systems Manager User Guide --name "My-Maintenance-Window-Target" ^ --description "Description for my maintenance window target" The system returns information similar to the following. { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTargetId": "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE", "Targets": [ { "Key": "InstanceIds", "Values": [ "i-02573cafcfEXAMPLE" ] } ], "Name": "My-Maintenance-Window-Target", "Description": "Description for my maintenance window target" } 2. Run the following command to use the replace option to remove the description field and add an additional target. The description field is removed, because the update doesn't include the field (a null value). Be sure to specify an additional node that has been configured for use with Systems Manager. Linux & macOS aws ssm update-maintenance-window-target
|
systems-manager-ug-533
|
systems-manager-ug.pdf
| 533 |
"My-Maintenance-Window-Target" ^ --description "Description for my maintenance window target" The system returns information similar to the following. { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTargetId": "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE", "Targets": [ { "Key": "InstanceIds", "Values": [ "i-02573cafcfEXAMPLE" ] } ], "Name": "My-Maintenance-Window-Target", "Description": "Description for my maintenance window target" } 2. Run the following command to use the replace option to remove the description field and add an additional target. The description field is removed, because the update doesn't include the field (a null value). Be sure to specify an additional node that has been configured for use with Systems Manager. Linux & macOS aws ssm update-maintenance-window-target \ --window-id "mw-0c50858d01EXAMPLE" \ --window-target-id "d208dedf-3f6b-41ff-ace8-8e751EXAMPLE" \ --targets "Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE" \ --name "My-Maintenance-Window-Target" \ --replace Windows aws ssm update-maintenance-window-target ^ --window-id "mw-0c50858d01EXAMPLE" ^ --window-target-id "d208dedf-3f6b-41ff-ace8-8e751EXAMPLE" ^ --targets "Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE" ^ --name "My-Maintenance-Window-Target" ^ Maintenance Windows 1860 AWS Systems Manager --replace User Guide The system returns information similar to the following. { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTargetId": "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE", "Targets": [ { "Key": "InstanceIds", "Values": [ "i-02573cafcfEXAMPLE", "i-0471e04240EXAMPLE" ] } ], "Name": "My-Maintenance-Window-Target" } 3. The start-date option allows you to delay activation of a maintenance window until a specified future date. The end-date option allows you to set a date and time in the future after which the maintenance window no longer runs. Specify the options in ISO-8601 Extended format. Run the following command to specify a date and time range for regularly scheduled maintenance window executions. Linux & macOS aws ssm update-maintenance-window \ --window-id "mw-0c50858d01EXAMPLE" \ --start-date "2020-10-01T10:10:10Z" \ --end-date "2020-11-01T10:10:10Z" Windows aws ssm update-maintenance-window ^ --window-id "mw-0c50858d01EXAMPLE" ^ --start-date "2020-10-01T10:10:10Z" ^ --end-date "2020-11-01T10:10:10Z" Maintenance Windows 1861 AWS Systems Manager User Guide 4. Run the following command to update a Run Command task. Tip If your target is an Amazon Elastic Compute Cloud (Amazon EC2) instance for Windows Server, change df to ipconfig, and AWS-RunShellScript to AWS- RunPowerShellScript in the following command. Linux & macOS aws ssm update-maintenance-window-task \ --window-id "mw-0c50858d01EXAMPLE" \ --window-task-id "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE" \ --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" \ --task-arn "AWS-RunShellScript" \ --service-role-arn "arn:aws:iam::account-id:role/MaintenanceWindowsRole" \ --task-invocation-parameters "RunCommand={Comment=Revising my Run Command task,Parameters={commands=df}}" \ --priority 1 --max-concurrency 10 --max-errors 4 \ --name "My-Task-Name" --description "A description for my Run Command task" Windows aws ssm update-maintenance-window-task ^ --window-id "mw-0c50858d01EXAMPLE" ^ --window-task-id "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE" ^ --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ^ --task-arn "AWS-RunShellScript" ^ --service-role-arn "arn:aws:iam::account-id:role/MaintenanceWindowsRole" ^ --task-invocation-parameters "RunCommand={Comment=Revising my Run Command task,Parameters={commands=df}}" ^ --priority 1 --max-concurrency 10 --max-errors 4 ^ --name "My-Task-Name" --description "A description for my Run Command task" The system returns information similar to the following. { Maintenance Windows 1862 AWS Systems Manager User Guide "WindowId": "mw-0c50858d01EXAMPLE", "WindowTaskId": "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", "Targets": [ { "Key": "WindowTargetIds", "Values": [ "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ] } ], "TaskArn": "AWS-RunShellScript", "ServiceRoleArn": "arn:aws:iam::111122223333:role/MaintenanceWindowsRole", "TaskParameters": {}, "TaskInvocationParameters": { "RunCommand": { "Comment": "Revising my Run Command task", "Parameters": { "commands": [ "df" ] } } }, "Priority": 1, "MaxConcurrency": "10", "MaxErrors": "4", "Name": "My-Task-Name", "Description": "A description for my Run Command task" } 5. Adapt and run the following command to update a Lambda task. Linux & macOS aws ssm update-maintenance-window-task \ --window-id mw-0c50858d01EXAMPLE \ --window-task-id 4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE \ --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" \ --task-arn "arn:aws:lambda:region:111122223333:function:SSMTestLambda" \ --service-role-arn "arn:aws:iam:account-id:role/MaintenanceWindowsRole" \ --task-invocation-parameters '{"Lambda":{"Payload":"{\"InstanceId\": \"{{RESOURCE_ID}}\",\"targetType\":\"{{TARGET_TYPE}}\"}"}}' \ --priority 1 --max-concurrency 10 --max-errors 5 \ Maintenance Windows 1863 AWS Systems Manager User Guide --name "New-Lambda-Task-Name" \ --description "A description for my Lambda task" Windows aws ssm update-maintenance-window-task ^ --window-id mw-0c50858d01EXAMPLE ^ --window-task-id 4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE ^ --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ^ --task-arn --task-arn "arn:aws:lambda:region:111122223333:function:SSMTestLambda" ^ --service-role-arn "arn:aws:iam:account-id:role/MaintenanceWindowsRole" ^ --task-invocation-parameters '{"Lambda":{"Payload":"{\"InstanceId\": \"{{RESOURCE_ID}}\",\"targetType\":\"{{TARGET_TYPE}}\"}"}}' ^ --priority 1 --max-concurrency 10 --max-errors 5 ^ --name "New-Lambda-Task-Name" ^ --description "A description for my Lambda task" The system returns information similar to the following. { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTaskId": "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", "Targets": [ { "Key": "WindowTargetIds", "Values": "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" } ], "TaskArn": "arn:aws:lambda:us-east-2:111122223333:function:SSMTestLambda", "ServiceRoleArn": "arn:aws:iam::111122223333:role/MaintenanceWindowsRole", "TaskParameters": {}, "TaskInvocationParameters": { "Lambda": { "Payload": "e30=" } }, "Priority": 1, "MaxConcurrency": "10", "MaxErrors": "5", "Name": "New-Lambda-Task-Name", Maintenance Windows 1864 AWS Systems Manager User Guide "Description": "A description for my Lambda task" } 6. If you're updating a Step Functions task, adapt and run the following command to update its task-invocation-parameters. Linux & macOS aws ssm update-maintenance-window-task \ --window-id "mw-0c50858d01EXAMPLE" \ --window-task-id "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE" \ --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" \ --task-arn "arn:aws:states:region:execution:SSMStepFunctionTest" \ --service-role-arn "arn:aws:iam:account-id:role/MaintenanceWindowsRole" \ --task-invocation-parameters '{"StepFunctions":{"Input":"{\"InstanceId\": \"{{RESOURCE_ID}}\"}"}}' \ --priority 0 --max-concurrency 10 --max-errors 5 \ --name "My-Step-Functions-Task" \ --description "A description for my Step Functions task" Windows aws ssm update-maintenance-window-task ^ --window-id "mw-0c50858d01EXAMPLE" ^ --window-task-id "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE" ^ --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ^ --task-arn "arn:aws:states:region:execution:SSMStepFunctionTest" ^ --service-role-arn "arn:aws:iam:account-id:role/MaintenanceWindowsRole" ^ --task-invocation-parameters '{"StepFunctions":{"Input":"{\"InstanceId\": \"{{RESOURCE_ID}}\"}"}}' ^ --priority 0 --max-concurrency 10 --max-errors 5 ^ --name "My-Step-Functions-Task" ^ --description "A description for my Step Functions task" The system returns information similar to the following. { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTaskId": "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", Maintenance Windows 1865 AWS Systems Manager User Guide "Targets": [ { "Key": "WindowTargetIds", "Values": [ "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ] } ], "TaskArn": "arn:aws:states:us- east-2:111122223333:execution:SSMStepFunctionTest", "ServiceRoleArn": "arn:aws:iam::111122223333:role/MaintenanceWindowsRole", "TaskParameters": {}, "TaskInvocationParameters": { "StepFunctions": { "Input": "{\"instanceId\":\"{{RESOURCE_ID}}\"}" } }, "Priority": 0, "MaxConcurrency": "10", "MaxErrors": "5", "Name": "My-Step-Functions-Task", "Description": "A description for
|
systems-manager-ug-534
|
systems-manager-ug.pdf
| 534 |
aws ssm update-maintenance-window-task ^ --window-id "mw-0c50858d01EXAMPLE" ^ --window-task-id "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE" ^ --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ^ --task-arn "arn:aws:states:region:execution:SSMStepFunctionTest" ^ --service-role-arn "arn:aws:iam:account-id:role/MaintenanceWindowsRole" ^ --task-invocation-parameters '{"StepFunctions":{"Input":"{\"InstanceId\": \"{{RESOURCE_ID}}\"}"}}' ^ --priority 0 --max-concurrency 10 --max-errors 5 ^ --name "My-Step-Functions-Task" ^ --description "A description for my Step Functions task" The system returns information similar to the following. { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTaskId": "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", Maintenance Windows 1865 AWS Systems Manager User Guide "Targets": [ { "Key": "WindowTargetIds", "Values": [ "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ] } ], "TaskArn": "arn:aws:states:us- east-2:111122223333:execution:SSMStepFunctionTest", "ServiceRoleArn": "arn:aws:iam::111122223333:role/MaintenanceWindowsRole", "TaskParameters": {}, "TaskInvocationParameters": { "StepFunctions": { "Input": "{\"instanceId\":\"{{RESOURCE_ID}}\"}" } }, "Priority": 0, "MaxConcurrency": "10", "MaxErrors": "5", "Name": "My-Step-Functions-Task", "Description": "A description for my Step Functions task" } 7. Run the following command to unregister a target from a maintenance window. This example uses the safe parameter to determine if the target is referenced by any tasks and therefore safe to unregister. Linux & macOS aws ssm deregister-target-from-maintenance-window \ --window-id "mw-0c50858d01EXAMPLE" \ --window-target-id "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" \ --safe Windows aws ssm deregister-target-from-maintenance-window ^ --window-id "mw-0c50858d01EXAMPLE" ^ --window-target-id "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ^ --safe Maintenance Windows 1866 AWS Systems Manager User Guide The system returns information similar to the following. An error occurred (TargetInUseException) when calling the DeregisterTargetFromMaintenanceWindow operation: This Target cannot be deregistered because it is still referenced in Task: 4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE 8. Run the following command to unregister a target from a maintenance window even if the target is referenced by a task. You can force the unregister operation by using the no-safe parameter. Linux & macOS aws ssm deregister-target-from-maintenance-window \ --window-id "mw-0c50858d01EXAMPLE" \ --window-target-id "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" \ --no-safe Windows aws ssm deregister-target-from-maintenance-window ^ --window-id "mw-0c50858d01EXAMPLE" ^ --window-target-id "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ^ --no-safe The system returns information similar to the following. { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTargetId": "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" } 9. Run the following command to update a Run Command task. This example uses a Systems Manager Parameter Store parameter called UpdateLevel, which is formatted as follows: '{{ssm:UpdateLevel}}' Maintenance Windows 1867 AWS Systems Manager Linux & macOS User Guide aws ssm update-maintenance-window-task \ --window-id "mw-0c50858d01EXAMPLE" \ --window-task-id "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE" \ --targets "Key=InstanceIds,Values=i-02573cafcfEXAMPLE" \ --task-invocation-parameters "RunCommand={Comment=A comment for my task update,Parameters={UpdateLevel='{{ssm:UpdateLevel}}'}}" Windows aws ssm update-maintenance-window-task ^ --window-id "mw-0c50858d01EXAMPLE" ^ --window-task-id "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE" ^ --targets "Key=InstanceIds,Values=i-02573cafcfEXAMPLE" ^ --task-invocation-parameters "RunCommand={Comment=A comment for my task update,Parameters={UpdateLevel='{{ssm:UpdateLevel}}'}}" The system returns information similar to the following. { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTaskId": "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", "Targets": [ { "Key": "InstanceIds", "Values": [ "i-02573cafcfEXAMPLE" ] } ], "TaskArn": "AWS-RunShellScript", "ServiceRoleArn": "arn:aws:iam::111122223333:role/ MyMaintenanceWindowServiceRole", "TaskParameters": {}, "TaskInvocationParameters": { "RunCommand": { "Comment": "A comment for my task update", "Parameters": { "UpdateLevel": [ Maintenance Windows 1868 AWS Systems Manager User Guide "{{ssm:UpdateLevel}}" ] } } }, "Priority": 10, "MaxConcurrency": "1", "MaxErrors": "1" } 10. Run the following command to update an Automation task to specify WINDOW_ID and WINDOW_TASK_ID parameters for the task-invocation-parameters parameter: Linux & macOS aws ssm update-maintenance-window-task \ --window-id "mw-0c50858d01EXAMPLE" \ --window-task-id "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE" \ --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE \ --task-arn "AutoTestDoc" \ --service-role-arn "arn:aws:iam:account-id:role/ MyMaintenanceWindowServiceRole \ --task-invocation-parameters "Automation={Parameters={InstanceId='{{RESOURCE_ID}}',initiator='{{WINDOW_ID}}.Task- {{WINDOW_TASK_ID}}'}}" \ --priority 3 --max-concurrency 10 --max-errors 5 Windows aws ssm update-maintenance-window-task ^ --window-id "mw-0c50858d01EXAMPLE" ^ --window-task-id "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE" ^ --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE ^ --task-arn "AutoTestDoc" ^ --service-role-arn "arn:aws:iam:account-id:role/ MyMaintenanceWindowServiceRole ^ --task-invocation-parameters "Automation={Parameters={InstanceId='{{RESOURCE_ID}}',initiator='{{WINDOW_ID}}.Task- {{WINDOW_TASK_ID}}'}}" ^ --priority 3 --max-concurrency 10 --max-errors 5 Maintenance Windows 1869 AWS Systems Manager User Guide The system returns information similar to the following. { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTaskId": "4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE", "Targets": [ { "Key": "WindowTargetIds", "Values": [ "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ] } ], "TaskArn": "AutoTestDoc", "ServiceRoleArn": "arn:aws:iam::111122223333:role/ MyMaintenanceWindowServiceRole", "TaskParameters": {}, "TaskInvocationParameters": { "Automation": { "Parameters": { "multi": [ "{{WINDOW_TASK_ID}}" ], "single": [ "{{WINDOW_ID}}" ] } } }, "Priority": 0, "MaxConcurrency": "10", "MaxErrors": "5", "Name": "My-Automation-Task", "Description": "A description for my Automation task" } Tutorial: Delete a maintenance window using the AWS CLI To delete a maintenance window you created in these tutorials, run the following command. Maintenance Windows 1870 AWS Systems Manager User Guide aws ssm delete-maintenance-window --window-id "mw-0c50858d01EXAMPLE" The system returns information similar to the following. { "WindowId":"mw-0c50858d01EXAMPLE" } Tutorial: Create a maintenance window for patching using the console Important You can continue to use this legacy topic to create a maintenance window for patching. However, we recommend that you use a patch policy instead. For more information, see Patch policy configurations in Quick Setup and Configure patching for instances in an organization using a Quick Setup patch policy. To minimize the impact on your server availability, we recommend that you configure a maintenance window to run patching during times that won't interrupt your business operations. You must configure roles and permissions for Maintenance Windows, a tool in AWS Systems Manager, before beginning this procedure. For more information, see Setting up Maintenance Windows. To create a maintenance window for patching 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Maintenance Windows. 3. Choose Create maintenance window. 4. For Name, enter a name that designates this as a maintenance window for patching critical and important updates. 5. (Optional) For Description, enter a description. 6. Choose Allow unregistered targets
|
systems-manager-ug-535
|
systems-manager-ug.pdf
| 535 |
window to run patching during times that won't interrupt your business operations. You must configure roles and permissions for Maintenance Windows, a tool in AWS Systems Manager, before beginning this procedure. For more information, see Setting up Maintenance Windows. To create a maintenance window for patching 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Maintenance Windows. 3. Choose Create maintenance window. 4. For Name, enter a name that designates this as a maintenance window for patching critical and important updates. 5. (Optional) For Description, enter a description. 6. Choose Allow unregistered targets if you want to allow a maintenance window task to run on managed nodes, even if you haven't registered those nodes as targets. Maintenance Windows 1871 AWS Systems Manager User Guide If you choose this option, then you can choose the unregistered nodes (by node ID) when you register a task with the maintenance window. If you don't choose this option, then you must choose previously-registered targets when you register a task with the maintenance window. 7. In the top of the Schedule section, specify a schedule for the maintenance window by using one of the three scheduling options. For information about building cron/rate expressions, see Reference: Cron and rate expressions for Systems Manager. 8. For Duration, enter the number of hours the maintenance window will run. The value you specify determines the specific end time for the maintenance window based on the time it begins. No maintenance window tasks are permitted to start after the resulting endtime minus the number of hours you specify for Stop initiating tasks in the next step. For example, if the maintenance window starts at 3 PM, the duration is three hours, and the Stop initiating tasks value is one hour, no maintenance window tasks can start after 5 PM. 9. For Stop initiating tasks, enter the number of hours before the end of the maintenance window that the system should stop scheduling new tasks to run. 10. (Optional) For Window start date, specify a date and time, in ISO-8601 Extended format, for when you want the maintenance window to become active. This allows you to delay activation of the maintenance window until the specified future date. 11. (Optional) For Window end date, specify a date and time, in ISO-8601 Extended format, for when you want the maintenance window to become inactive. This allows you to set a date and time in the future after which the maintenance window no longer runs. 12. (Optional) For Schedule timezone, specify the time zone to base scheduled maintenance window executions on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For more information about valid formats, see the Time Zone Database on the IANA website. 13. (Optional) In the Manage tags area, apply one or more tag key name/value pairs to the maintenance window. Tags are optional metadata that you assign to a resource. Tags allow you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might Maintenance Windows 1872 AWS Systems Manager User Guide want to tag this maintenance window to identify the type of tasks it runs. In this case, you could specify the following key name/value pair: • Key=TaskType,Value=Patching 14. Choose Create maintenance window. 15. In the maintenance windows list, choose the maintenance window you just created, and then choose Actions, Register targets. 16. (Optional) In the Maintenance window target details section, provide a name, a description, and owner information (your name or alias) for this target. 17. For Target selection, choose Specify instance tags. 18. For Specify instance tags, enter a tag key and a tag value to identify the nodes to register with the maintenance window, and then choose Add. 19. Choose Register target. The system creates a maintenance window target. 20. In the details page of the maintenance window you created, choose Actions, Register Run command task. 21. (Optional) For Maintenance window task details, provide a name and description for this task. 22. For Command document, choose AWS-RunPatchBaseline. 23. For Task priority, choose a priority. Zero (0) is the highest priority. 24. For Targets, under Target by, choose the maintenance window target you created earlier in this procedure. 25. For Rate control: • For Concurrency, specify either a number or a percentage of managed nodes on which to run the command at the same time. Note If you selected targets by specifying tags applied to managed nodes or by specifying AWS resource groups, and you aren't certain how many managed nodes are targeted, then restrict the number of targets that can run the document at the same time by specifying a percentage. • For Error threshold, specify when to stop running the command on other managed nodes after it
|
systems-manager-ug-536
|
systems-manager-ug.pdf
| 536 |
maintenance window target you created earlier in this procedure. 25. For Rate control: • For Concurrency, specify either a number or a percentage of managed nodes on which to run the command at the same time. Note If you selected targets by specifying tags applied to managed nodes or by specifying AWS resource groups, and you aren't certain how many managed nodes are targeted, then restrict the number of targets that can run the document at the same time by specifying a percentage. • For Error threshold, specify when to stop running the command on other managed nodes after it fails on either a number or a percentage of nodes. For example, if you specify three Maintenance Windows 1873 AWS Systems Manager User Guide errors, then Systems Manager stops sending the command when the fourth error is received. Managed nodes still processing the command might also send errors. 26. (Optional) For IAM service role, choose a role to provide permissions for Systems Manager to assume when running a maintenance window task. If you don't specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it's created when the task is registered successfully. Note For an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see Setting up Maintenance Windows. 27. (Optional) For Output options, to save the command output to a file, select the Enable writing output to S3 box. Enter the bucket and prefix (folder) names in the boxes. Note The S3 permissions that grant the ability to write the data to an S3 bucket are those of the instance profile assigned to the managed node, not those of the IAM user performing this task. For more information, see Configure instance permissions required for Systems Manager or Create an IAM service role for a hybrid environment. In addition, if the specified S3 bucket is in a different AWS account, verify that the instance profile or IAM service role associated with the managed node has the necessary permissions to write to that bucket. To stream the output to an Amazon CloudWatch Logs log group, select the CloudWatch output box. Enter the log group name in the box. 28. In the SNS notifications section, if you want notifications sent about the status of the command execution, select the Enable SNS notifications check box. For more information about configuring Amazon SNS notifications for Run Command, see Monitoring Systems Manager status changes using Amazon SNS notifications. Maintenance Windows 1874 AWS Systems Manager 29. For Parameters: User Guide • For Operation, choose Scan to scan for missing patches, or choose Install to scan for and install missing patches. • You don't need to enter anything in the Snapshot Id field. This system automatically generates and provides this parameter. • You don't need to enter anything in the Install Override List field unless you want Patch Manager to use a different patch set than is specified for the patch baseline. For information, see Parameter name: InstallOverrideList. • For RebootOption, specify whether you want nodes to reboot if patches are installed during the Install operation, or if Patch Manager detects other patches that were installed since the last node reboot. For information, see Parameter name: RebootOption. • (Optional) For Comment, enter a tracking note or reminder about this command. • For Timeout (seconds), enter the number of seconds the system should wait for the operation to finish before it is considered unsuccessful. 30. Choose Register Run command task. After the maintenance window task is complete, you can view patch compliance details in the Systems Manager console in the Fleet Manager tool. You can also view compliance information in the Patch Manager tool, on the Compliance reporting tab. You can also use the DescribePatchGroupState and DescribeInstancePatchStatesForPatchGroup APIs to view compliance details. For information about patch compliance data, see About patch compliance. Patching schedules using maintenance windows After you configure a patch baseline (and optionally a patch group), you can apply patches to your node by using a maintenance window. A maintenance window can reduce the impact on server availability by letting you specify a time to perform the patching process that doesn't interrupt business operations. A maintenance window works like this: 1. Create a maintenance window with a schedule for your patching operations. 2. Choose the targets for the maintenance window by specifying the Patch Group or PatchGroup tag for the tag name, and any value for which you have defined Amazon Elastic Maintenance Windows 1875 AWS Systems Manager User Guide Compute Cloud (Amazon EC2) tags, for example, "web servers"
|
systems-manager-ug-537
|
systems-manager-ug.pdf
| 537 |
patches to your node by using a maintenance window. A maintenance window can reduce the impact on server availability by letting you specify a time to perform the patching process that doesn't interrupt business operations. A maintenance window works like this: 1. Create a maintenance window with a schedule for your patching operations. 2. Choose the targets for the maintenance window by specifying the Patch Group or PatchGroup tag for the tag name, and any value for which you have defined Amazon Elastic Maintenance Windows 1875 AWS Systems Manager User Guide Compute Cloud (Amazon EC2) tags, for example, "web servers" or "US-EAST-PROD. (You must use PatchGroup, without a space, if you have allowed tags in EC2 instance metadata. 3. Create a new maintenance window task, and specify the AWS-RunPatchBaseline document. When you configure the task, you can choose to either scan nodes or scan and install patches on the nodes. If you choose to scan nodes, Patch Manager, a tool in AWS Systems Manager, scans each node and generates a list of missing patches for you to review. If you choose to scan and install patches, Patch Manager scans each node and compares the list of installed patches against the list of approved patches in the baseline. Patch Manager identifies missing patches, and then downloads and installs all missing and approved patches. If you want to perform a one-time scan or install to fix an issue, you can use Run Command to call the AWS-RunPatchBaseline document directly. Important After installing patches, Systems Manager reboots each node. The reboot is required to make sure that patches are installed correctly and to ensure that the system didn't leave the node in a potentially bad state. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) Using pseudo parameters when registering maintenance window tasks When you register a task in Maintenance Windows, a tool in AWS Systems Manager, you specify the parameters that are unique to each of the four task types. (In CLI commands, these are provided using the --task-invocation-parameters option.) You can also reference certain values using pseudo parameter syntax, such as {{RESOURCE_ID}}, {{TARGET_TYPE}}, and {{WINDOW_TARGET_ID}}. When the maintenance window task runs, it passes the correct values instead of the pseudo parameter placeholders. The full list of pseudo parameters you can use is provided later in this topic in Supported pseudo parameters. Important For the target type RESOURCE_GROUP, depending on the ID format needed for the task, you can choose between using {{TARGET_ID}} and {{RESOURCE_ID}} to reference Maintenance Windows 1876 AWS Systems Manager User Guide the resource when your task runs. {{TARGET_ID}} returns the full ARN of the resource. {{RESOURCE_ID}} returns only a shorter name or ID of the resource, as shown in these examples. • {{TARGET_ID}} format: arn:aws:ec2:us-east-1:123456789012:instance/ i-02573cafcfEXAMPLE • {{RESOURCE_ID}} format: i-02573cafcfEXAMPLE For target type INSTANCE, both the {{TARGET_ID}} and {{RESOURCE_ID}} parameters yield the instance ID only. For more information, see Supported pseudo parameters. {{TARGET_ID}} and {{RESOURCE_ID}} can be used to pass IDs of AWS resources only to Automation, Lambda, and Step Functions tasks. These two pseudo parameters can't be used with Run Command tasks. Pseudo parameter examples Suppose that your payload for an AWS Lambda task needs to reference an instance by its ID. Whether you’re using an INSTANCE or a RESOURCE_GROUP maintenance window target, this can be achieved by using the {{RESOURCE_ID}} pseudo parameter. For example: "TaskArn": "arn:aws:lambda:us-east-2:111122223333:function:SSMTestFunction", "TaskType": "LAMBDA", "TaskInvocationParameters": { "Lambda": { "ClientContext": "ew0KICAi--truncated--0KIEXAMPLE", "Payload": "{ \"instanceId\": \"{{RESOURCE_ID}}\" }", "Qualifier": "$LATEST" } } If your Lambda task is intended to run against another supported target type in addition to Amazon Elastic Compute Cloud (Amazon EC2) instances, such as an Amazon DynamoDB table, the same syntax can be used, and {{RESOURCE_ID}} yields the name of the table only. However, if you require the full ARN of the table, use {{TARGET_ID}}, as shown in the following example. "TaskArn": "arn:aws:lambda:us-east-2:111122223333:function:SSMTestFunction", "TaskType": "LAMBDA", Maintenance Windows 1877 AWS Systems Manager User Guide "TaskInvocationParameters": { "Lambda": { "ClientContext": "ew0KICAi--truncated--0KIEXAMPLE", "Payload": "{ \"tableArn\": \"{{TARGET_ID}}\" }", "Qualifier": "$LATEST" } } The same syntax works for targeting instances or other resource types. When multiple resource types have been added to a resource group, the task runs against each of the appropriate resources. Important Not all resource types that might be included in a resource group yield a value for the {{RESOURCE_ID}} parameter. For a list of supported resource types, see Supported pseudo parameters. As another example, to run an Automation task that stops your EC2 instances, you specify the AWS-StopEC2Instance Systems Manager document (SSM document) as the TaskArn value and use the {{RESOURCE_ID}} pseudo parameter: "TaskArn": "AWS-StopEC2Instance", "TaskType": "AUTOMATION" "TaskInvocationParameters": { "Automation": { "DocumentVersion": "1", "Parameters": { "instanceId": [ "{{RESOURCE_ID}}" ] } } } To
|
systems-manager-ug-538
|
systems-manager-ug.pdf
| 538 |
types have been added to a resource group, the task runs against each of the appropriate resources. Important Not all resource types that might be included in a resource group yield a value for the {{RESOURCE_ID}} parameter. For a list of supported resource types, see Supported pseudo parameters. As another example, to run an Automation task that stops your EC2 instances, you specify the AWS-StopEC2Instance Systems Manager document (SSM document) as the TaskArn value and use the {{RESOURCE_ID}} pseudo parameter: "TaskArn": "AWS-StopEC2Instance", "TaskType": "AUTOMATION" "TaskInvocationParameters": { "Automation": { "DocumentVersion": "1", "Parameters": { "instanceId": [ "{{RESOURCE_ID}}" ] } } } To run an Automation task that copies a snapshot of an Amazon Elastic Block Store (Amazon EBS) volume, you specify the AWS-CopySnapshot SSM document as the TaskArn value and use the {{RESOURCE_ID}} pseudo parameter. "TaskArn": "AWS-CopySnapshot", Maintenance Windows 1878 AWS Systems Manager User Guide "TaskType": "AUTOMATION" "TaskInvocationParameters": { "Automation": { "DocumentVersion": "1", "Parameters": { "SourceRegion": "us-east-2", "targetType":"RESOURCE_GROUP", "SnapshotId": [ "{{RESOURCE_ID}}" ] } } } Supported pseudo parameters The following list describes the pseudo parameters that you can specify using the {{PSEUDO_PARAMETER}} syntax in the --task-invocation-parameters option. • WINDOW_ID: The ID of the target maintenance window. • WINDOW_TASK_ID: The ID of the window task that is running. • WINDOW_TARGET_ID: The ID of the window target that includes the target (target ID). • WINDOW_EXECUTION_ID: The ID of the current window execution. • TASK_EXECUTION_ID: The ID of the current task execution. • INVOCATION_ID: The ID of the current invocation. • TARGET_TYPE: The type of target. Supported types include RESOURCE_GROUP and INSTANCE. • TARGET_ID: If the target type you specify is INSTANCE, the TARGET_ID pseudo parameter is replaced by the ID of the instance. For example, i-078a280217EXAMPLE. If the target type you specify is RESOURCE_GROUP, the value referenced for the task execution is the full ARN of the resource. For example: arn:aws:ec2:us- east-1:123456789012:instance/i-078a280217EXAMPLE. The following table provides sample TARGET_ID values for particular resource types in a resource group. Maintenance Windows 1879 AWS Systems Manager Note TARGET_ID isn't supported for Run Command tasks. User Guide Resource type Example TARGET_ID AWS::CloudWatch::A arn:aws:cloudwatch larm :us-east-1:1234567 89012:alarm:MyClou dWatchAlarm i-078a280 217EXAMPLE AWS::DynamoDB::Table arn:aws:dynamodb:u s-east-1:123456789 012:table/MyTable AWS::EC2::Instance arn:aws:ec2:us-eas t-1:123456789012:i nstance/ i-078a280 217EXAMPLE AWS::EC2::Image arn:aws:ec2:us-eas t-1:123456789012:i mage/ami-02250b373 2EXAMPLE AWS::EC2::Security arn:aws:ec2:us-eas Group t-1:123456789012:s ecurity-group/sg-c EXAMPLE AWS::EC2::Snapshot arn:aws:ec2:us-eas t-1:123456789012:s napshot/snap-03866 bf003EXAMPLE Maintenance Windows 1880 AWS Systems Manager User Guide Resource type Example TARGET_ID AWS::EC2::Volume arn:aws:ec2:us-eas t-1:123456789012:v olume/vol-0912e04d 78EXAMPLE AWS::ECS::Service arn:aws:ecs:us-eas t-1:123456789012:s ervice/my-ecs-serv ice AWS::RDS::DBCluster arn:aws:rds:us-eas t-2:123456789012:c luster:My-Cluster AWS::RDS::DBInstance arn:aws:rds:us-eas t-1:123456789012:d b:My-SQL-Instance AWS::S3::Bucket arn:aws:s3:::amzn- s3-demo-bucket AWS::SSM::ManagedI arn:aws:ssm:us-eas nstance t-1:123456789012:m anaged-instance/mi -0feadcf2d9EXAMPLE • RESOURCE_ID: The short ID of a resource type contained in a resource group. The following table provides sample RESOURCE_ID values for particular resource types in a resource group. Note RESOURCE_ID isn't supported for Run Command tasks. Maintenance Windows 1881 AWS Systems Manager User Guide Resource type Example RESOURCE_ID AWS::CloudWatch::A MyCloudWatchAlarm larm AWS::DynamoDB::Table MyTable AWS::EC2::Instance i-078a280217EXAMPLE AWS::EC2::Image ami-02250b3732EXAM PLE AWS::EC2::Security sg-cEXAMPLE Group AWS::EC2::Snapshot snap-03866bf003EXA MPLE AWS::EC2::Volume vol-0912e04d78EXAM PLE AWS::ECS::Service my-ecs-service AWS::RDS::DBCluster My-Cluster AWS::RDS::DBInstance My-SQL-Instance AWS::S3::Bucket amzn-s3-demo-bucket AWS::SSM::ManagedI mi-0feadcf2d9EXAMPLE nstance Note If the AWS resource group you specify includes resource types that don't yield a RESOURCE_ID value, and aren't listed in the preceding table, then the RESOURCE_ID parameter isn't populated. An execution invocation will still occur for that resource. In Maintenance Windows 1882 AWS Systems Manager User Guide these cases, use the TARGET_ID pseudo parameter instead, which will be replaced with the full ARN of the resource. Maintenance window scheduling and active period options When you create a maintenance window, you must specify how often the maintenance window runs by using a Cron or rate expression. Optionally, you can specify a date range during which the maintenance window can run on its regular schedule and a time zone on which to base that regular schedule. Be aware, however, that the time zone option and the start date and end date options don't influence each other. Any start date and end date times that you specify (with or without an offset for your time zone) determine only the valid period during which the maintenance window can run on its schedule. A time zone option determines the international time zone that the maintenance window schedule is based on during its valid period. Note You specify start and end dates in ISO-8601 timestamp format. For example: 2021-04-07T14:29:00-08:00 You specify time zones in Internet Assigned Numbers Authority (IANA) format. For example: America/Chicago, Europe/Berlin or Asia/Tokyo Examples • Example 1: Specify a maintenance window start date • Example 2: Specify a maintenance window start date and end date • Example 3: Create a maintenance window that runs only once • Example 4: Specify the number of schedule offset days for a maintenance window Example 1: Specify a maintenance window start date Say that you use the AWS Command Line Interface (AWS CLI) to create a maintenance window with the following
|
systems-manager-ug-539
|
systems-manager-ug.pdf
| 539 |
end dates in ISO-8601 timestamp format. For example: 2021-04-07T14:29:00-08:00 You specify time zones in Internet Assigned Numbers Authority (IANA) format. For example: America/Chicago, Europe/Berlin or Asia/Tokyo Examples • Example 1: Specify a maintenance window start date • Example 2: Specify a maintenance window start date and end date • Example 3: Create a maintenance window that runs only once • Example 4: Specify the number of schedule offset days for a maintenance window Example 1: Specify a maintenance window start date Say that you use the AWS Command Line Interface (AWS CLI) to create a maintenance window with the following options: • --start-date 2021-01-01T00:00:00-08:00 Maintenance Windows 1883 AWS Systems Manager User Guide • --schedule-timezone "America/Los_Angeles" • --schedule "cron(0 09 ? * WED *)" For example: Linux & macOS aws ssm create-maintenance-window \ --name "My-LAX-Maintenance-Window" \ --allow-unassociated-targets \ --duration 3 \ --cutoff 1 \ --start-date 2021-01-01T00:00:00-08:00 \ --schedule-timezone "America/Los_Angeles" \ --schedule "cron(0 09 ? * WED *)" Windows aws ssm create-maintenance-window ^ --name "My-LAX-Maintenance-Window" ^ --allow-unassociated-targets ^ --duration 3 ^ --cutoff 1 ^ --start-date 2021-01-01T00:00:00-08:00 ^ --schedule-timezone "America/Los_Angeles" ^ --schedule "cron(0 09 ? * WED *)" This means that the first run of the maintenance window won't occur until after its specified start date and time, which is at 12:00 AM US Pacific Time on Friday, January 1, 2021. (This time zone is eight hours behind UTC time.) In this case, the start date and time of the window period don't represent when the maintenance windows first runs. Taken together, the --schedule-timezone and --schedule values mean that the maintenance window runs at 9 AM every Wednesday in the US Pacific Time Zone (represented by "America/Los Angeles" in IANA format). The first execution in the allowed period will be on Wednesday, January 4, 2021, at 9 AM US Pacific Time. Example 2: Specify a maintenance window start date and end date Suppose that next you create a maintenance window with these options: • --start-date 2019-01-01T00:03:15+09:00 Maintenance Windows 1884 AWS Systems Manager User Guide • --end-date 2019-06-30T00:06:15+09:00 • --schedule-timezone "Asia/Tokyo" • --schedule "rate(7 days)" For example: Linux & macOS aws ssm create-maintenance-window \ --name "My-NRT-Maintenance-Window" \ --allow-unassociated-targets \ --duration 3 \ --cutoff 1 \ --start-date 2019-01-01T00:03:15+09:00 \ --end-date 2019-06-30T00:06:15+09:00 \ --schedule-timezone "Asia/Tokyo" \ --schedule "rate(7 days)" Windows aws ssm create-maintenance-window ^ --name "My-NRT-Maintenance-Window" ^ --allow-unassociated-targets ^ --duration 3 ^ --cutoff 1 ^ --start-date 2019-01-01T00:03:15+09:00 ^ --end-date 2019-06-30T00:06:15+09:00 ^ --schedule-timezone "Asia/Tokyo" ^ --schedule "rate(7 days)" The allowed period for this maintenance window begins at 3:15 AM Japan Standard Time on January 1, 2019. The valid period for this maintenance window ends at 6:15 AM Japan Standard Time on Sunday, June 30, 2019. (This time zone is nine hours ahead of UTC time.) Taken together, the --schedule-timezone and --schedule values mean that the maintenance window runs at 3:15 AM every Tuesday in the Japan Standard Time Zone (represented by "Asia/Tokyo" in IANA format). This is because the maintenance window runs every seven days, and it becomes active at 3:15 AM on Tuesday, January 1. The last execution is at 3:15 AM Japan Standard Time on Tuesday, June 25, 2019. This is the last Tuesday before the allowed maintenance window period ends five days later. Maintenance Windows 1885 AWS Systems Manager User Guide Example 3: Create a maintenance window that runs only once Now you create a maintenance window with this option: • --schedule "at(2020-07-07T15:55:00)" For example: Linux & macOS aws ssm create-maintenance-window \ --name "My-One-Time-Maintenance-Window" \ --schedule "at(2020-07-07T15:55:00)" \ --duration 5 \ --cutoff 2 \ --allow-unassociated-targets Windows aws ssm create-maintenance-window ^ --name "My-One-Time-Maintenance-Window" ^ --schedule "at(2020-07-07T15:55:00)" ^ --duration 5 ^ --cutoff 2 ^ --allow-unassociated-targets This maintenance window runs just once, at 3:55 PM UTC time on July 7, 2020. The maintenance window is allowed to run up to five hours, as needed, but new tasks are prevented from starting two hours before the end of the maintenance window period. Example 4: Specify the number of schedule offset days for a maintenance window Now you create a maintenance window with this option: --schedule-offset 2 For example: Linux & macOS aws ssm create-maintenance-window \ Maintenance Windows 1886 AWS Systems Manager User Guide --name "My-Cron-Offset-Maintenance-Window" \ --schedule "cron(0 30 23 ? * TUE#3 *)" \ --duration 4 \ --cutoff 1 \ --schedule-offset 2 \ --allow-unassociated-targets Windows aws ssm create-maintenance-window ^ --name "My-Cron-Offset-Maintenance-Window" ^ --schedule "cron(0 30 23 ? * TUE#3 *)" ^ --duration 4 ^ --cutoff 1 ^ --schedule-offset 2 ^ --allow-unassociated-targets A schedule offset is the number of days to wait after the date and time specified by a CRON expression before running the maintenance window. In the preceding example, the CRON expression schedules a maintenance window to run the third Tuesday of every month at 11:30 PM: --schedule "cron(0 30 23 ? * TUE#3 *) However, including --schedule-offset 2 means that the maintenance window won't run
|
systems-manager-ug-540
|
systems-manager-ug.pdf
| 540 |
--cutoff 1 \ --schedule-offset 2 \ --allow-unassociated-targets Windows aws ssm create-maintenance-window ^ --name "My-Cron-Offset-Maintenance-Window" ^ --schedule "cron(0 30 23 ? * TUE#3 *)" ^ --duration 4 ^ --cutoff 1 ^ --schedule-offset 2 ^ --allow-unassociated-targets A schedule offset is the number of days to wait after the date and time specified by a CRON expression before running the maintenance window. In the preceding example, the CRON expression schedules a maintenance window to run the third Tuesday of every month at 11:30 PM: --schedule "cron(0 30 23 ? * TUE#3 *) However, including --schedule-offset 2 means that the maintenance window won't run until 11:30 PM two days after the third Tuesday of each month. Schedule offsets are supported for CRON expressions only. More info • Reference: Cron and rate expressions for Systems Manager • Create a maintenance window using the console • Tutorial: Create and configure a maintenance window using the AWS CLI • CreateMaintenanceWindow in the AWS Systems Manager API Reference • create-maintenance-window in the AWS Systems Manager section of the AWS CLI Command Reference Maintenance Windows 1887 AWS Systems Manager User Guide • Time Zone Database on the IANA website Registering maintenance window tasks without targets For each maintenance window you create, you can specify one or more tasks to perform when the maintenance window runs. In most cases, you must specify the resources, or targets, that the task is to run on. In some cases, however, you don't need to specify targets explicitly in the task. One or more targets must be specified for maintenance window Systems Manager Run Command- type tasks. Depending on the nature of the task, targets are optional for other maintenance window task types (Systems Manager Automation, AWS Lambda, and AWS Step Functions). For Lambda and Step Functions task types, whether a target is required depends on the content of the function or state machine you have created. Note When a task has registered targets, Automation, AWS Lambda, and AWS Step Functions tasks resolve the targets from resource groups and tags and send one invocation per resolved resource, which results in multiple task invocations. But say, for example, that you want only one invocation for a Lambda task that's registered with a resource group containing more than one instance. In this case, if you are working in the AWS Management Console, choose the option Task target not required in the Register Lambda task or Edit Lambda task page. If you are using the AWS CLI command, do not specify targets using the --targets parameter when running the register-task-with-maintenance-window command or update-maintenance-window-task command. In many cases, you don't need to explicitly specify a target for an automation task. For example, say that you're creating an Automation-type task to update an Amazon Machine Image (AMI) for Linux using the AWS-UpdateLinuxAmi runbook. When the task runs, the AMI is updated with the latest available Linux distribution packages and Amazon software. New instances created from the AMI already have these updates installed. Because the ID of the AMI to be updated is specified in the input parameters for the runbook, there is no need to specify a target again in the maintenance window task. Similarly, suppose you're using the AWS Command Line Interface (AWS CLI) to register a maintenance window Automation task that uses the AWS-RestartEC2Instance runbook. Maintenance Windows 1888 AWS Systems Manager User Guide Because the node to restart is specified in the --task-invocation-parameters argument, you don't need to also specify a --targets option. Note For maintenance window tasks without a target specified, you can't supply values for -- max-errors and --max-concurrency. Instead, the system inserts a placeholder value of 1, which might be reported in the response to commands such as describe-maintenance- window-tasks and get-maintenance-window-task. These values don't affect the running of your task and can be ignored. The following example demonstrates omitting the --targets, --max-errors, and --max- concurrency options for a targetless maintenance window task. Linux & macOS aws ssm register-task-with-maintenance-window \ --window-id "mw-ab12cd34eEXAMPLE" \ --service-role-arn "arn:aws:iam::123456789012:role/ MaintenanceWindowAndAutomationRole" \ --task-type "AUTOMATION" \ --name "RestartInstanceWithoutTarget" \ --task-arn "AWS-RestartEC2Instance" \ --task-invocation-parameters "{\"Automation\":{\"Parameters\":{\"InstanceId\": [\"i-02573cafcfEXAMPLE\"]}}}" \ --priority 10 Windows aws ssm register-task-with-maintenance-window ^ --window-id "mw-ab12cd34eEXAMPLE" ^ --service-role-arn "arn:aws:iam::123456789012:role/ MaintenanceWindowAndAutomationRole" ^ --task-type "AUTOMATION" ^ --name "RestartInstanceWithoutTarget" ^ --task-arn "AWS-RestartEC2Instance" ^ --task-invocation-parameters "{\"Automation\":{\"Parameters\":{\"InstanceId\": [\"i-02573cafcfEXAMPLE\"]}}}" ^ --priority 10 Maintenance Windows 1889 AWS Systems Manager Note User Guide For maintenance window tasks registered before December 23, 2020: If you specified targets for the task and one is no longer required, you can update that task to remove the targets using the Systems Manager console or the update-maintenance-window-task AWS CLI command. More info • Error messages: "Maintenance window tasks without targets don't support MaxConcurrency values" and "Maintenance window tasks without targets don't support MaxErrors values" Troubleshooting maintenance windows Use the following information to help you troubleshoot problems with maintenance windows. Topics • Edit task error:
|
systems-manager-ug-541
|
systems-manager-ug.pdf
| 541 |
"{\"Automation\":{\"Parameters\":{\"InstanceId\": [\"i-02573cafcfEXAMPLE\"]}}}" ^ --priority 10 Maintenance Windows 1889 AWS Systems Manager Note User Guide For maintenance window tasks registered before December 23, 2020: If you specified targets for the task and one is no longer required, you can update that task to remove the targets using the Systems Manager console or the update-maintenance-window-task AWS CLI command. More info • Error messages: "Maintenance window tasks without targets don't support MaxConcurrency values" and "Maintenance window tasks without targets don't support MaxErrors values" Troubleshooting maintenance windows Use the following information to help you troubleshoot problems with maintenance windows. Topics • Edit task error: On the page for editing a maintenance window task, the IAM role list returns an error message: "We couldn't find the IAM maintenance window role specified for this task. It might have been deleted, or it might not have been created yet." • Not all maintenance window targets are updated • Task fails with task invocation status: "The provided role does not contain the correct SSM permissions." • Task fails with error message: "Step fails when it is validating and resolving the step inputs" • Error messages: "Maintenance window tasks without targets don't support MaxConcurrency values" and "Maintenance window tasks without targets don't support MaxErrors values" Edit task error: On the page for editing a maintenance window task, the IAM role list returns an error message: "We couldn't find the IAM maintenance window role specified for this task. It might have been deleted, or it might not have been created yet." Problem 1: The AWS Identity and Access Management (IAM) maintenance window role you originally specified was deleted after you created the task. Possible fix: 1) Select a different IAM maintenance window role, if one exists in your account, or create a new one and select it for the task. Maintenance Windows 1890 AWS Systems Manager User Guide Problem 2: If the task was created using the AWS Command Line Interface (AWS CLI), AWS Tools for Windows PowerShell, or an AWS SDK, a non-existent IAM maintenance window role name could have been specified. For example, the IAM maintenance window role could have been deleted before you created the task, or the role name could have been typed incorrectly, such as myrole instead of my-role. Possible fix: Select the correct name of the IAM maintenance window role you want to use, or create a new one to specify for the task. Not all maintenance window targets are updated Problem: You notice that maintenance window tasks didn't run on all the resources targeted by your maintenance window. For example, in the maintenance window run results, the task for that resource is marked as failed or timed out. Solution: The most common reasons for a maintenance window task not running on a target resource involve connectivity and availability. For example: • Systems Manager lost connection to the resource before or during the maintenance window operation. • The resource was offline or stopped during the maintenance window operation. You can wait for the next scheduled maintenance window time to run tasks on the resources. You can manually run the maintenance window tasks on the resources that weren't available or were offline. Task fails with task invocation status: "The provided role does not contain the correct SSM permissions." Problem: You have specified a maintenance window service role for a task, but the task fails to run successfully and the task invocation status reports that "The provided role does not contain the correct SSM permissions." • Solution: In Task 1: Create a custom policy for your maintenance window service role using the console, we provide a basic policy you can attach to your custom maintenance window service role. The policy includes the permissions needed for many task scenarios. However, due to the wide variety of tasks you can run, you might need to provide additional permissions in the policy for your maintenance window role. Maintenance Windows 1891 AWS Systems Manager User Guide For example, some Automation actions work with AWS CloudFormation stacks. Therefore, you might need to add the additional permissions cloudformation:CreateStack, cloudformation:DescribeStacks, and cloudformation:DeleteStack to the policy for your maintenance window service role. For another example, the Automation runbook AWS-CopySnapshot requires permissions to create an Amazon Elastic Block Store (Amazon EBS) snapshot. Therefore, you might need to add the permission ec2:CreateSnapshot. For information about the role permissions needed by an AWS managed Automation runbook, see the runbook descriptions in the AWS Systems Manager Automation runbook reference. For information about the role permissions needed by an AWS managed SSM document, review the content of the document in the Documents section Systems Manager console. For information about the role permissions needed for Step Functions tasks, Lambda tasks, and custom Automation runbooks and SSM documents, verify permission requirements with the author of those resources. Task fails with error
|
systems-manager-ug-542
|
systems-manager-ug.pdf
| 542 |
Amazon Elastic Block Store (Amazon EBS) snapshot. Therefore, you might need to add the permission ec2:CreateSnapshot. For information about the role permissions needed by an AWS managed Automation runbook, see the runbook descriptions in the AWS Systems Manager Automation runbook reference. For information about the role permissions needed by an AWS managed SSM document, review the content of the document in the Documents section Systems Manager console. For information about the role permissions needed for Step Functions tasks, Lambda tasks, and custom Automation runbooks and SSM documents, verify permission requirements with the author of those resources. Task fails with error message: "Step fails when it is validating and resolving the step inputs" Problem: An Automation runbook or Systems Manager Command document you're using in a task requires that you specify inputs such as InstanceId or SnapshotId, but a value isn't supplied or isn't supplied correctly. • Solution 1: If your task is targeting a single resource, such as a single node or single snapshot, enter its ID in the input parameters for the task. • Solution 2: If your task is targeting multiple resources, such as creating images from multiple nodes when you use the runbook AWS-CreateImage, you can use one of the pseudo parameters supported for maintenance window tasks in the input parameters to represent node IDs in the command. The following commands register a Systems Manager Automation task with a maintenance window using the AWS CLI. The --targets value indicates a maintenance window target ID. Also, even though the --targets parameter specifies a window target ID, parameters of the Automation runbook require that a node ID be provided. In this case, the command uses the pseudo parameter {{RESOURCE_ID}} as the InstanceId value. Maintenance Windows 1892 AWS Systems Manager AWS CLI command: Linux & macOS User Guide The following example command restarts Amazon Elastic Compute Cloud (Amazon EC2) instances that belong to the maintenance window target group with the ID e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE. aws ssm register-task-with-maintenance-window \ --window-id "mw-0c50858d01EXAMPLE" \ --targets Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE \ --task-arn "AWS-RestartEC2Instance" \ --service-role-arn arn:aws:iam::123456789012:role/ MyMaintenanceWindowServiceRole \ --task-type AUTOMATION \ --task-invocation-parameters "Automation={DocumentVersion=5,Parameters={InstanceId='{{RESOURCE_ID}}'}}" \ --priority 0 --max-concurrency 10 --max-errors 5 --name "My-Restart-EC2- Instances-Automation-Task" \ --description "Automation task to restart EC2 instances" Windows aws ssm register-task-with-maintenance-window ^ --window-id "mw-0c50858d01EXAMPLE" ^ --targets Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE ^ --task-arn "AWS-RestartEC2Instance" ^ --service-role-arn arn:aws:iam::123456789012:role/ MyMaintenanceWindowServiceRole ^ --task-type AUTOMATION ^ --task-invocation-parameters "Automation={DocumentVersion=5,Parameters={InstanceId='{{RESOURCE_ID}}'}}" ^ --priority 0 --max-concurrency 10 --max-errors 5 --name "My-Restart-EC2- Instances-Automation-Task" ^ --description "Automation task to restart EC2 instances" For more information about working with pseudo parameters for maintenance window tasks, see Using pseudo parameters when registering maintenance window tasks and Task registration examples. Maintenance Windows 1893 AWS Systems Manager User Guide Error messages: "Maintenance window tasks without targets don't support MaxConcurrency values" and "Maintenance window tasks without targets don't support MaxErrors values" Problem: When you register a Run Command-type task, you must specify at least one target for the task to run on. For other task types (Automation, AWS Lambda, and AWS Step Functions), depending on the nature of the task, targets are optional. The options MaxConcurrency (the number of resources to run a task on at the same time) and MaxErrors (the number of failures to run the task on target resources before the task fails) aren't required or supported for maintenance window tasks that don't specify targets. The system generates these error messages if values are specified for either of these options when no task target is specified. Solution: If you receive either of these errors, remove the values for concurrency and error threshold before continuing to register or update the maintenance window task. For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the AWS Systems Manager User Guide. AWS Systems Manager Quick Setup Use Quick Setup, a tool in AWS Systems Manager, to quickly configure frequently used Amazon Web Services services and features with recommended best practices. Quick Setup simplifies setting up services, including Systems Manager, by automating common or recommended tasks. These tasks include, for example, creating required AWS Identity and Access Management (IAM) instance profile roles and setting up operational best practices, such as periodic patch scans and inventory collection. There is no cost to use Quick Setup. However, costs can be incurred based on the type of services you set up and the usage limits with no fees for the services used to set up your service. To get started with Quick Setup, open the Systems Manager console. In the navigation pane, choose Quick Setup. Note If you were directed to Quick Setup to help you configure your instances to be managed by Systems Manager, complete the procedure in Set up Amazon EC2 host management using Quick Setup. What are the benefits of Quick Setup? Benefits of Quick Setup include the following: Quick Setup 1894 AWS Systems Manager User Guide
|
systems-manager-ug-543
|
systems-manager-ug.pdf
| 543 |
be incurred based on the type of services you set up and the usage limits with no fees for the services used to set up your service. To get started with Quick Setup, open the Systems Manager console. In the navigation pane, choose Quick Setup. Note If you were directed to Quick Setup to help you configure your instances to be managed by Systems Manager, complete the procedure in Set up Amazon EC2 host management using Quick Setup. What are the benefits of Quick Setup? Benefits of Quick Setup include the following: Quick Setup 1894 AWS Systems Manager User Guide • Simplify service and feature configuration Quick Setup walks you through configuring operational best practices and automatically deploys those configurations. The Quick Setup dashboard displays a real-time view of your configuration deployment status. • Deploy configurations automatically across multiple accounts You can use Quick Setup in an individual AWS account or across multiple AWS accounts and AWS Regions by integrating with AWS Organizations. Using Quick Setup across multiple accounts helps to ensure that your organization maintains consistent configurations. • Eliminate configuration drift Configuration drift occurs whenever a user makes any change to a service or feature that conflicts with the selections made through Quick Setup. Quick Setup periodically checks for configuration drift and attempts to remediate it. Who should use Quick Setup? Quick Setup is most beneficial for customers who already have some experience with the services and features they're setting up, and want to simplify their setup process. If you're unfamiliar with the AWS service you're configuring with Quick Setup, we recommend that you learn more about the service. Review the content in the relevant User Guide before you create a configuration with Quick Setup. Availability of Quick Setup in AWS Regions In the following AWS Regions, you can use all Quick Setup configuration types for an entire organization, as configured in AWS Organizations, or for only the organizational accounts and Regions you choose. You can also use Quick Setup with just a single account in these Regions. • US East (Ohio) • US East (N. Virginia) • US West (N. California) • US West (Oregon) • Asia Pacific (Mumbai) • Asia Pacific (Seoul) Quick Setup 1895 User Guide AWS Systems Manager • Asia Pacific (Singapore) • Asia Pacific (Sydney) • Asia Pacific (Tokyo) • Canada (Central) • Europe (Frankfurt) • Europe (Stockholm) • Europe (Ireland) • Europe (London) • Europe (Paris) • South America (São Paulo) In the following Regions, only the Host Management configuration type is available for individual accounts: • Europe (Milan) • Asia Pacific (Hong Kong) • Middle East (Bahrain) • China (Beijing) • China (Ningxia) • AWS GovCloud (US-East) • AWS GovCloud (US-West) For a list of all supported Regions for Systems Manager, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. Getting started with Quick Setup Use the information in this topic to help you prepare to use Quick Setup. Topics • IAM roles and permissions for Quick Setup onboarding • Manual onboarding for working with Quick Setup API programatically Quick Setup 1896 AWS Systems Manager User Guide IAM roles and permissions for Quick Setup onboarding Quick Setup launched a new console experience and a new API. Now you can interact with this API using the console, AWS CLI, AWS CloudFormation, and SDKs. If you opt in to the new experience, your existing configurations are recreated using the new API. Depending on the number of existing configurations in your account, this process can take several minutes. To use the new Quick Setup console, you must have permissions for the following actions: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm-quicksetup:*", "cloudformation:DescribeStackSetOperation", "cloudformation:ListStacks", "cloudformation:DescribeStacks", "cloudformation:DescribeStackResources", "cloudformation:ListStackSetOperations", "cloudformation:ListStackInstances", "cloudformation:DescribeStackSet", "cloudformation:ListStackSets", "cloudformation:DescribeStackInstance", "cloudformation:DescribeOrganizationsAccess", "cloudformation:ActivateOrganizationsAccess", "cloudformation:GetTemplate", "cloudformation:ListStackSetOperationResults", "cloudformation:DescribeStackEvents", "cloudformation:UntagResource", "ec2:DescribeInstances", "ssm:DescribeAutomationExecutions", "ssm:GetAutomationExecution", "ssm:ListAssociations", "ssm:DescribeAssociation", "ssm:GetDocument", "ssm:ListDocuments", "ssm:DescribeDocument", "ssm:ListResourceDataSync", "ssm:DescribePatchBaselines", "ssm:GetPatchBaseline", "ssm:DescribeMaintenanceWindows", Quick Setup 1897 AWS Systems Manager User Guide "ssm:DescribeMaintenanceWindowTasks", "ssm:GetOpsSummary", "organizations:DeregisterDelegatedAdministrator", "organizations:DescribeAccount", "organizations:DescribeOrganization", "organizations:ListDelegatedAdministrators", "organizations:ListRoots", "organizations:ListParents", "organizations:ListOrganizationalUnitsForParent", "organizations:DescribeOrganizationalUnit", "organizations:ListAWSServiceAccessForOrganization", "s3:GetBucketLocation", "s3:ListAllMyBuckets", "s3:ListBucket", "resource-groups:ListGroups", "iam:ListRoles", "iam:ListRolePolicies", "iam:GetRole", "iam:CreatePolicy", "organizations:RegisterDelegatedAdministrator", "organizations:EnableAWSServiceAccess", "cloudformation:TagResource" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "cloudformation:RollbackStack", "cloudformation:CreateStack", "cloudformation:UpdateStack", "cloudformation:DeleteStack" ], "Resource": [ "arn:aws:cloudformation:*:*:stack/StackSet-AWS-QuickSetup-*", "arn:aws:cloudformation:*:*:stack/AWS-QuickSetup-*", "arn:aws:cloudformation:*:*:type/resource/*", "arn:aws:cloudformation:*:*:stack/StackSet-SSMQuickSetup" ] }, { "Effect": "Allow", "Action": [ "cloudformation:CreateStackSet", Quick Setup 1898 AWS Systems Manager User Guide "cloudformation:UpdateStackSet", "cloudformation:DeleteStackSet", "cloudformation:DeleteStackInstances", "cloudformation:CreateStackInstances", "cloudformation:StopStackSetOperation" ], "Resource": [ "arn:aws:cloudformation:*:*:stackset/AWS-QuickSetup-*", "arn:aws:cloudformation:*:*:stackset/SSMQuickSetup", "arn:aws:cloudformation:*:*:type/resource/*", "arn:aws:cloudformation:*:*:stackset-target/AWS-QuickSetup-*:*" ] }, { "Effect": "Allow", "Action": [ "iam:CreateRole", "iam:DeleteRole", "iam:AttachRolePolicy", "iam:DetachRolePolicy", "iam:GetRolePolicy", "iam:PassRole", "iam:PutRolePolicy" ], "Resource": [ "arn:aws:iam::*:role/AWS-QuickSetup-*", "arn:aws:iam::*:role/service-role/AWS-QuickSetup-*" ] }, { "Effect": "Allow", "Action": [ "ssm:DeleteAssociation", "ssm:CreateAssociation", "ssm:StartAssociationsOnce" ], "Resource": "*" }, { "Effect": "Allow", "Action": "ssm:StartAutomationExecution", "Resource": "arn:aws:ssm:*:*:automation-definition/AWS-EnableExplorer:*" }, { Quick Setup 1899 AWS Systems Manager User Guide "Effect": "Allow", "Action": [ "ssm:GetOpsSummary", "ssm:CreateResourceDataSync", "ssm:UpdateResourceDataSync" ], "Resource": "arn:aws:ssm:*:*:resource-data-sync/AWS-QuickSetup-*" }, { "Effect": "Allow", "Action": [ "iam:CreateServiceLinkedRole" ], "Condition": { "StringEquals": { "iam:AWSServiceName": [ "accountdiscovery.ssm.amazonaws.com", "ssm.amazonaws.com", "ssm-quicksetup.amazonaws.com", "stacksets.cloudformation.amazonaws.com" ]
|
systems-manager-ug-544
|
systems-manager-ug.pdf
| 544 |
"cloudformation:CreateStackSet", Quick Setup 1898 AWS Systems Manager User Guide "cloudformation:UpdateStackSet", "cloudformation:DeleteStackSet", "cloudformation:DeleteStackInstances", "cloudformation:CreateStackInstances", "cloudformation:StopStackSetOperation" ], "Resource": [ "arn:aws:cloudformation:*:*:stackset/AWS-QuickSetup-*", "arn:aws:cloudformation:*:*:stackset/SSMQuickSetup", "arn:aws:cloudformation:*:*:type/resource/*", "arn:aws:cloudformation:*:*:stackset-target/AWS-QuickSetup-*:*" ] }, { "Effect": "Allow", "Action": [ "iam:CreateRole", "iam:DeleteRole", "iam:AttachRolePolicy", "iam:DetachRolePolicy", "iam:GetRolePolicy", "iam:PassRole", "iam:PutRolePolicy" ], "Resource": [ "arn:aws:iam::*:role/AWS-QuickSetup-*", "arn:aws:iam::*:role/service-role/AWS-QuickSetup-*" ] }, { "Effect": "Allow", "Action": [ "ssm:DeleteAssociation", "ssm:CreateAssociation", "ssm:StartAssociationsOnce" ], "Resource": "*" }, { "Effect": "Allow", "Action": "ssm:StartAutomationExecution", "Resource": "arn:aws:ssm:*:*:automation-definition/AWS-EnableExplorer:*" }, { Quick Setup 1899 AWS Systems Manager User Guide "Effect": "Allow", "Action": [ "ssm:GetOpsSummary", "ssm:CreateResourceDataSync", "ssm:UpdateResourceDataSync" ], "Resource": "arn:aws:ssm:*:*:resource-data-sync/AWS-QuickSetup-*" }, { "Effect": "Allow", "Action": [ "iam:CreateServiceLinkedRole" ], "Condition": { "StringEquals": { "iam:AWSServiceName": [ "accountdiscovery.ssm.amazonaws.com", "ssm.amazonaws.com", "ssm-quicksetup.amazonaws.com", "stacksets.cloudformation.amazonaws.com" ] } }, "Resource": "*" }, { "Effect": "Allow", "Action": [ "iam:CreateServiceLinkedRole" ], "Resource": "arn:aws:iam::*:role/aws-service-role/ stacksets.cloudformation.amazonaws.com/ AWSServiceRoleForCloudFormationStackSetsOrgAdmin" } ] } To restrict users to read-only permissions, only allow ssm-quicksetup:List* and ssm- quicksetup:Get* operations for the Quick Setup API. During onboarding, Quick Setup creates the following AWS Identity and Access Management (IAM) roles on your behalf: Quick Setup 1900 AWS Systems Manager User Guide • AWS-QuickSetup-LocalExecutionRole – Grants AWS CloudFormation permissions to use any template, excluding the patch policy template, and create the necessary resources. • AWS-QuickSetup-LocalAdministrationRole – Grants permissions to AWS CloudFormation to assume AWS-QuickSetup-LocalExecutionRole. • AWS-QuickSetup-PatchPolicy-LocalExecutionRole – Grants permissions to AWS CloudFormation to use the patch policy template, and create the necessary resources. • AWS-QuickSetup-PatchPolicy-LocalAdministrationRole – Grants permissions to AWS CloudFormation to assume AWS-QuickSetup-PatchPolicy-LocalExecutionRole. If you're onboarding a management account—the account that you use to create an organization in AWS Organizations—Quick Setup also creates the following roles on your behalf: • AWS-QuickSetup-SSM-RoleForEnablingExplorer – Grants permissions to the AWS- EnableExplorer automation runbook. The AWS-EnableExplorer runbook configures Explorer, a tool in Systems Manager, to display information for multiple AWS accounts and AWS Regions. • AWSServiceRoleForAmazonSSM – A service-linked role that grants access to AWS resources managed and used by Systems Manager. • AWSServiceRoleForAmazonSSM_AccountDiscovery – A service-linked role that grants permissions to Systems Manager to call AWS services to discover AWS account information when synchronizing data. For more information, see Using roles to collect AWS account information for OpsCenter and Explorer. When onboarding a management account, Quick Setup enables trusted access between AWS Organizations and CloudFormation to deploy Quick Setup configurations across your organization. To enable trusted access, your management account must have administrator permissions. After onboarding, you no longer need administrator permissions. For more information, see Enable trusted access with Organizations. For information about AWS Organizations account types, see AWS Organizations terminology and concepts in the AWS Organizations User Guide. Note Quick Setup uses AWS CloudFormation StackSets to deploy your configurations across AWS accounts and Regions. If the number of target accounts multiplied by the number of Quick Setup 1901 AWS Systems Manager User Guide Regions exceeds 10,000, the configuration fails to deploy. We recommend reviewing your use case and creating configurations that use fewer targets to accommodate the growth of your organization. Stack instances aren't deployed to your organization's management account. For more information, see Considerations when creating a stack set with service- managed permissions. Manual onboarding for working with Quick Setup API programatically If you use the console to work with Quick Setup, the service handles onboarding steps for you. If you plan to use SDKs or the AWS CLI to work with the Quick Setup API, you can still use the console to complete onboarding steps for you so you don't have to perform them manually. However, some customers need to complete onboarding steps for Quick Setup programmatically without interacting with the console. If this method fits your use case, you must complete the following steps. All of these steps must be completed from your AWS Organizations management account. To complete manual onboarding for Quick Setup 1. Activate trusted access for AWS CloudFormation with Organizations. This provides the management account with the permissions needed to create and manage StackSets for your organization. You can use AWS CloudFormation's ActivateOrganizationsAccess API action to complete this step. For more information, see ActivateOrganizationsAccess in the AWS CloudFormation API Reference. 2. Enable the integration of Systems Manager with Organizations. This allows Systems Manager to create a service-linked role in all the accounts in your organization. This also allows Systems Manager to perform operations on your behalf in your organization and its accounts. You can use AWS Organizations's EnableAWSServiceAccess API action to complete this step. The service principal for Systems Manager is ssm.amazonaws.com.For more information, see EnableAWSServiceAccess in the AWS Organizations API Reference. 3. Create the required IAM role for Explorer. This allows Quick Setup to create dashboards for your configurations so you can view deployment and association statuses. Create an IAM role and attach the AWSSystemsManagerEnableExplorerExecutionPolicy managed policy. Modify the trust policy for the role to match the following. Replace each account ID with your information. { "Version": "2012-10-17", "Statement": [ Quick Setup 1902 AWS Systems Manager { User Guide "Effect": "Allow", "Principal": {
|
systems-manager-ug-545
|
systems-manager-ug.pdf
| 545 |
use AWS Organizations's EnableAWSServiceAccess API action to complete this step. The service principal for Systems Manager is ssm.amazonaws.com.For more information, see EnableAWSServiceAccess in the AWS Organizations API Reference. 3. Create the required IAM role for Explorer. This allows Quick Setup to create dashboards for your configurations so you can view deployment and association statuses. Create an IAM role and attach the AWSSystemsManagerEnableExplorerExecutionPolicy managed policy. Modify the trust policy for the role to match the following. Replace each account ID with your information. { "Version": "2012-10-17", "Statement": [ Quick Setup 1902 AWS Systems Manager { User Guide "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "aws:SourceAccount": "account ID" }, "ArnLike": { "aws:SourceArn": "arn:*:ssm:*:account ID:automation-execution/ *" } } } ] } 4. Update the Quick Setup service setting for Explorer. You can use Quick Setup's UpdateServiceSettings API action to complete this step. Specify the ARN for the IAM role you created in the previous step for the ExplorerEnablingRoleArn request parameter. For more information, see UpdateServiceSettings in the Quick Setup API Reference. 5. Create the required IAM roles for AWS CloudFormation StackSets to use. You must create an execution role and an administration role. a. Create the execution role. The execution role should have at least one of the AWSQuickSetupDeploymentRolePolicy or AWSQuickSetupPatchPolicyDeploymentRolePolicy managed policies attached. If you're only creating patch policy configurations, you can use AWSQuickSetupPatchPolicyDeploymentRolePolicy managed policy. All other configurations use the AWSQuickSetupDeploymentRolePolicy policy. Modify the trust policy for the role to match the following. Replace each account ID and administration role name with your information. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { Quick Setup 1903 AWS Systems Manager User Guide "AWS": "arn:aws:iam::account ID:role/administration role name" }, "Action": "sts:AssumeRole" } ] } b. Create the administration role. The permissions policy must match the following. Replace each account ID and execution role name with your information. { "Version": "2012-10-17", "Statement": [ { "Action": [ "sts:AssumeRole" ], "Resource": "arn:*:iam::account ID:role/execution role name", "Effect": "Allow" } ] } Modify the trust policy for the role to match the following. Replace each account ID with your information. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "cloudformation.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "aws:SourceAccount": "account ID" }, "StringLike": { "aws:SourceArn": "arn:aws:cloudformation:*:account ID:stackset/AWS-QuickSetup-*" Quick Setup 1904 AWS Systems Manager User Guide } } } ] } Using a delegated administrator for Quick Setup After you register a delegated administrator account for Quick Setup, users with the appropriate permissions in that account can create, update, view, and delete configuration managers that target organizational units within your AWS Organizations structure. This delegated administrator account can also manage configuration managers previously created by your organization's management account. The management account in Organizations can designate one account within your organization as a delegated administrator. When you register an account as a delegated administrator for Quick Setup, this account automatically becomes a delegated administrator for AWS CloudFormation StackSets and Systems Manager Explorer as well, since these services are required to deploy and monitor Quick Setup configurations. Note At this time, the patch policy configuration type isn't supported by the delegated administrator for Quick Setup. Patch policy configurations for an organization must be created and maintained in the management account for an organization. For more information, see the section called “Creating a patch policy”. The following topics describe how to register and deregister a delegated administrator for Quick Setup. Topics • Register a delegated administrator for Quick Setup • Deregister a delegated administrator for Quick Setup Register a delegated administrator for Quick Setup Use the following procedure to register a delegated administrator for Quick Setup. Quick Setup 1905 AWS Systems Manager User Guide To register a Quick Setup delegated administrator 1. Log into your AWS Organizations management account. 2. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 3. In the navigation pane, choose Quick Setup. 4. Choose Settings. 5. 6. In the Delegated administrator for Quick Setup section, verify that you have configured the required service-linked role and service access options. If necessary, choose the Create role and Enable access buttons to configure these options. For Account ID, enter the AWS account ID. This account must be a member account in AWS Organizations. 7. Choose Register delegated administrator. Deregister a delegated administrator for Quick Setup Use the following procedure to deregister a delegated administrator for Quick Setup. To deregister a Quick Setup delegated administrator 1. Log into your AWS Organizations management account. 2. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 3. In the navigation pane, choose Quick Setup. 4. Choose Settings. 5. In the Delegated administrator for Quick Setup section, choose Deregister from the Actions dropdown. 6. Select Confirm. Learn Quick Setup terminology and details Quick Setup, a tool in AWS Systems Manager, displays the results of all configuration
|
systems-manager-ug-546
|
systems-manager-ug.pdf
| 546 |
AWS Organizations. 7. Choose Register delegated administrator. Deregister a delegated administrator for Quick Setup Use the following procedure to deregister a delegated administrator for Quick Setup. To deregister a Quick Setup delegated administrator 1. Log into your AWS Organizations management account. 2. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 3. In the navigation pane, choose Quick Setup. 4. Choose Settings. 5. In the Delegated administrator for Quick Setup section, choose Deregister from the Actions dropdown. 6. Select Confirm. Learn Quick Setup terminology and details Quick Setup, a tool in AWS Systems Manager, displays the results of all configuration managers you've created across all AWS Regions in the Configuration managers table on the Quick Setup home page. From this page, you can View details of each configuration, delete configurations from Quick Setup 1906 AWS Systems Manager User Guide the Actions drop down, or Create configurations. The Configuration managers table contains the following information: • Name – The name of the configuration manager if provided when created. • Configuration type – The configuration type chosen when creating the configuration. • Version – The version of the configuration type currently deployed. • Organizational units – Displays the organizational units (OUs) that the configuration is deployed to if you chose a Custom set of targets. Organizational units and custom targets are only available to the management account of your organization. The management account is the account that you use to create an organization in AWS Organizations. • Deployment type – Indicates whether the deployment applies to the entire organization (Organizational) or only your account (Local). • Regions – The Regions that the configuration is deployed to if you chose a Custom set of targets or targets within your Current account. • Deployment status – The deployment status indicates if AWS CloudFormation successfully deployed the target or stack instance. The target and stack instances contain the configuration options that you chose during configuration creation. • Association status – The association status is the state of all associations created by the configuration that you created. The associations for all targets must run successfully; otherwise, the status is Failed. Quick Setup creates and runs a State Manager association for each configuration target. State Manager is a tool in AWS Systems Manager. To view configurations deployed to the Region you're currently browsing, select the Configurations tab. Configuration details The Configuration details page displays information about the deployment of the configuration and its related associations. From this page, you can edit configuration options, update targets, or delete the configuration. You can also view the details of each configuration deployment to get more information about the associations. Depending on the type of configuration, one or more of the following status graphs are displayed: Quick Setup 1907 AWS Systems Manager Configuration deployment status User Guide Displays the number of deployments that have succeeded, failed, or are running or pending. Deployments occur in the specified target accounts and Regions that contain nodes affected by the configuration. Configuration association status Displays the number of State Manager associations that have succeeded, failed, or are pending. Quick Setup creates an association in each deployment for the configuration options selected. Setup status Displays the number of actions performed by the configuration type and their current statuses. Resource compliance Displays the number of resources that are compliant to the configurations specified policy. The Configuration details table displays information about the deployment of your configuration. You can view more details about each deployment by selecting the deployment and then choosing View details. The details page of each deployment displays the associations deployed to the nodes in that deployment. Editing and deleting your configuration You can edit configuration options of a configuration from the Configuration details page by choosing Actions and then Edit configuration options. When you add new options to the configuration, Quick Setup runs your deployments and creates new associations. When you remove options from a configuration, Quick Setup runs your deployments and removes any related associations. Note You can edit Quick Setup configurations for your account at anytime. To edit an Organization configuration, the Configuration status must be Success or Failed. You can also update the targets included in your configurations by choosing Actions and Add OUs, Add Regions, Remove OUs, or Remove Regions. If your account isn't configured as the Quick Setup 1908 AWS Systems Manager User Guide management account or you created the configuration for only the current account, you can't update the target organizational units (OUs). Removing a Region or OU removes the associations from those Regions or OUs. Periodically, Quick Setup releases new versions of configurations. You can select the Upgrade configuration option to upgrade your configuration to the latest version. You can delete a configuration from Quick Setup by choosing the configuration, then Actions, and then Delete configuration. Or,
|
systems-manager-ug-547
|
systems-manager-ug.pdf
| 547 |
and Add OUs, Add Regions, Remove OUs, or Remove Regions. If your account isn't configured as the Quick Setup 1908 AWS Systems Manager User Guide management account or you created the configuration for only the current account, you can't update the target organizational units (OUs). Removing a Region or OU removes the associations from those Regions or OUs. Periodically, Quick Setup releases new versions of configurations. You can select the Upgrade configuration option to upgrade your configuration to the latest version. You can delete a configuration from Quick Setup by choosing the configuration, then Actions, and then Delete configuration. Or, you can delete the configuration from the Configuration details page under the Actions dropdown and then Delete configuration. Quick Setup then prompts you to Remove all OUs and Regions which might take some time to complete. Deleting a configuration also deletes all related associations. This two-step deletion process removes all deployed resources from all accounts and Regions and then deletes the configuration. Configuration compliance You can view whether your instances are compliant with the associations created by your configurations in either Explorer or Compliance, which are both tools in AWS Systems Manager. To learn more about compliance, see Learn details about Compliance. To learn more about viewing compliance in Explorer, see AWS Systems Manager Explorer. Using the Quick Setup API to manage configurations and deployments You can use the API provided by Quick Setup to create and manage configurations and deployments using the AWS CLI or your preferred SDK. You can also use AWS CloudFormation to create a configuration manager resource that deploys configurations. Using the API, you create configuration managers that deploy configuration definitions. Configuration definitions contain all of the necessary information to deploy a particular configuration type. For more information about the Quick Setup API, see the Quick Setup API Reference. The following examples demonstrate how to create configuration managers using the AWS CLI and AWS CloudFormation. AWS CLI aws ssm-quicksetup create-configuration-manager \ --name configuration manager name \ --description Description of your configuration manager --configuration-definitions JSON string containing configuration defintion Quick Setup 1909 AWS Systems Manager User Guide The following is an example JSON string containing a configuration definition for patch policy. '{"Type":"AWSQuickSetupType- PatchPolicy","LocalDeploymentAdministrationRoleArn":"arn:aws:iam::123456789012:role/ AWS-QuickSetup-StackSet-Local- AdministrationRole","LocalDeploymentExecutionRoleName":"AWS- QuickSetup-StackSet-Local-ExecutionRole","Parameters": {"ConfigurationOptionsInstallNextInterval":"true","ConfigurationOptionsInstallValue":"cron(0 2 ? * SAT#1 *)","ConfigurationOptionsPatchOperation":"ScanAndInstall","ConfigurationOptionsScanNextInterval":"false","ConfigurationOptionsScanValue":"cron(0 1 * * ? *)","HasDeletedBaseline":"false","IsPolicyAttachAllowed":"true","OutputBucketRegion":"","OutputLogEnableS3":"false","OutputS3BucketName":"","OutputS3KeyPrefix":"","PatchBaselineRegion":"us- east-1","PatchBaselineUseDefault":"custom","PatchPolicyName":"dev-patch- policy","RateControlConcurrency":"5","RateControlErrorThreshold":"0%","RebootOption":"RebootIfNeeded","ResourceGroupName":"","SelectedPatchBaselines":"{\"ALMA_LINUX \":{\"value\":\"arn:aws:ssm:us-east-1:123456789012:patchbaseline/ pb-0cb0c4966f86b059b\",\"label\":\"AWS-AlmaLinuxDefaultPatchBaseline\",\"description \":\"Default Patch Baseline for Alma Linux Provided by AWS.\",\"disabled\":false}, \"AMAZON_LINUX\":{\"value\":\"arn:aws:ssm:us-east-1:123456789012:patchbaseline/ pb-0c10e657807c7a700\",\"label\":\"AWS-AmazonLinuxDefaultPatchBaseline\", \"description\":\"Default Patch Baseline for Amazon Linux Provided by AWS. \",\"disabled\":false},\"AMAZON_LINUX_2\":{\"value\":\"arn:aws:ssm:us- east-1:123456789012:patchbaseline/pb-0be8c61cde3be63f3\",\"label\":\"AWS- AmazonLinux2DefaultPatchBaseline\",\"description\":\"Baseline containing all Security and Bugfix updates approved for Amazon Linux 2 instances \",\"disabled\":false},\"AMAZON_LINUX_2022\":{\"value\":\"arn:aws:ssm:us- east-1:123456789012:patchbaseline/pb-0028ca011460d5eaf\",\"label\":\"AWS- AmazonLinux2022DefaultPatchBaseline\",\"description\":\"Default Patch Baseline for Amazon Linux 2022 Provided by AWS.\",\"disabled\":false}, \"AMAZON_LINUX_2023\":{\"value\":\"arn:aws:ssm:us-east-1:123456789012:patchbaseline/ pb-05c9c9bf778d4c4d0\",\"label\":\"AWS-AmazonLinux2023DefaultPatchBaseline \",\"description\":\"Default Patch Baseline for Amazon Linux 2023 Provided by AWS.\",\"disabled\":false},\"CENTOS\":{\"value\":\"arn:aws:ssm:us- east-1:123456789012:patchbaseline/pb-03e3f588eec25344c\",\"label\":\"AWS- CentOSDefaultPatchBaseline\",\"description\":\"Default Patch Baseline for CentOS Provided by AWS.\",\"disabled\":false},\"DEBIAN\":{\"value\":\"arn:aws:ssm:us- east-1:123456789012:patchbaseline/pb-09a5f8eb62bde80b1\",\"label\":\"AWS- DebianDefaultPatchBaseline\",\"description\":\"Default Patch Baseline for Debian Provided by AWS.\",\"disabled\":false},\"MACOS\":{\"value\":\"arn:aws:ssm:us- east-1:123456789012:patchbaseline/pb-0ee4f94581368c0d4\",\"label\":\"AWS- MacOSDefaultPatchBaseline\",\"description\":\"Default Patch Baseline for MacOS Provided by AWS.\",\"disabled\":false},\"ORACLE_LINUX\":{\"value\": \"arn:aws:ssm:us-east-1:123456789012:patchbaseline/pb-06bff38e95fe85c02\", \"label\":\"AWS-OracleLinuxDefaultPatchBaseline\",\"description\":\"Default Patch Baseline for Oracle Linux Server Provided by AWS.\",\"disabled\":false}, Quick Setup 1910 AWS Systems Manager User Guide \"RASPBIAN\":{\"value\":\"arn:aws:ssm:us-east-1:123456789012:patchbaseline/ pb-0ec16280999c5c75e\",\"label\":\"AWS-RaspbianDefaultPatchBaseline\", \"description\":\"Default Patch Baseline for Raspbian Provided by AWS.\", \"disabled\":false},\"REDHAT_ENTERPRISE_LINUX\":{\"value\":\"arn:aws:ssm:us- east-1:123456789012:patchbaseline/pb-0cbb3a633de00f07c\",\"label\":\"AWS- RedHatDefaultPatchBaseline\",\"description\":\"Default Patch Baseline for Redhat Enterprise Linux Provided by AWS.\",\"disabled\":false},\"ROCKY_LINUX\":{\"value \":\"arn:aws:ssm:us-east-1:123456789012:patchbaseline/pb-03ec98bc512aa3ac0\",\"label \":\"AWS-RockyLinuxDefaultPatchBaseline\",\"description\":\"Default Patch Baseline for Rocky Linux Provided by AWS.\",\"disabled\":false},\"SUSE\":{\"value\": \"arn:aws:ssm:us-east-1:123456789012:patchbaseline/pb-07d8884178197b66b\",\"label\": \"AWS-SuseDefaultPatchBaseline\",\"description\":\"Default Patch Baseline for Suse Provided by AWS.\",\"disabled\":false},\"UBUNTU\":{\"value\":\"pb-06e3563bd35503f2b \",\"label\":\"custom-UbuntuServer-Blog-Baseline\",\"description\":\"Default Patch Baseline for Ubuntu Provided by AWS.\",\"disabled\":false},\"WINDOWS\":{\"value \":\"pb-016889927b2bb8542\",\"label\":\"custom-WindowsServer-Blog-Baseline\", \"disabled\":false}}","TargetInstances":"","TargetOrganizationalUnits":"ou-9utf- example","TargetRegions":"us-east-1,us- east-2","TargetTagKey":"Patch","TargetTagValue":"true","TargetType":"Tags"}}' \ AWS CloudFormation AWSTemplateFormatVersion: '2010-09-09' Resources: SSMQuickSetupTestConfigurationManager: Type: "AWS::SSMQuickSetup::ConfigurationManager" Properties: Name: "MyQuickSetup" Description: "Test configuration manager" ConfigurationDefinitions: - Type: "AWSQuickSetupType-CFGRecording" Parameters: TargetAccounts: Ref: AWS::AccountId TargetRegions: Ref: AWS::Region LocalDeploymentAdministrationRoleArn: !Sub "arn:aws:iam:: ${AWS::AccountId}:role/AWS-QuickSetup-StackSet-ContractTest-AdministrationRole" LocalDeploymentExecutionRoleName: "AWS-QuickSetup-StackSet-ContractTest- ExecutionRole" Tags: foo1: "bar1" Quick Setup 1911 AWS Systems Manager User Guide Supported Quick Setup configuration types Supported configuration types Quick Setup walks you through configuring operational best practices for a number of Systems Manager and other AWS services, and automatically deploying those configurations. The Quick Setup dashboard displays a real-time view of your configuration deployment status. You can use Quick Setup in an individual AWS account or across multiple AWS accounts and Regions by integrating with AWS Organizations. Using Quick Setup across multiple accounts helps to ensure that your organization maintains consistent configurations. Quick Setup provides support for the following configuration types. • Set up Amazon EC2 host management using Quick Setup • Set up the Default Host Management Configuration for an organization using Quick Setup • Create an AWS Config configuration recorder using Quick Setup • Deploy AWS Config conformance pack using Quick Setup • Configure patching for instances in an organization using a Quick Setup patch policy • Change Manager organization setup • Set up DevOps Guru using Quick Setup • Deploy Distributor packages using Quick Setup • Stop and start EC2 instances automatically on a schedule using Quick Setup • OpsCenter organization setup • Configure AWS Resource Explorer using Quick Setup Set up Amazon EC2 host management using Quick Setup Use Quick Setup, a tool in AWS Systems Manager, to quickly
|
systems-manager-ug-548
|
systems-manager-ug.pdf
| 548 |
Quick Setup • Create an AWS Config configuration recorder using Quick Setup • Deploy AWS Config conformance pack using Quick Setup • Configure patching for instances in an organization using a Quick Setup patch policy • Change Manager organization setup • Set up DevOps Guru using Quick Setup • Deploy Distributor packages using Quick Setup • Stop and start EC2 instances automatically on a schedule using Quick Setup • OpsCenter organization setup • Configure AWS Resource Explorer using Quick Setup Set up Amazon EC2 host management using Quick Setup Use Quick Setup, a tool in AWS Systems Manager, to quickly configure required security roles and commonly used Systems Manager tools on your Amazon Elastic Compute Cloud (Amazon EC2) instances. You can use Quick Setup in an individual account or across multiple accounts and AWS Regions by integrating with AWS Organizations. These tools help you manage and monitor the health of your instances while providing the minimum required permissions to get started. If you're unfamiliar with Systems Manager services and features, we recommend that you review the AWS Systems Manager User Guide before creating a configuration with Quick Setup. For more information about Systems Manager, see What is AWS Systems Manager?. Quick Setup 1912 AWS Systems Manager Important User Guide Quick Setup might not be the right tool to use for EC2 management if either of the following applies to you: • You’re trying to create an EC2 instance for the first time to try out AWS capabilities. • You’re still new to EC2 instance management. Instead, we recommend that you explore the following content: • Getting Started with Amazon EC2 • Launch an instance using the new launch instance wizard in the Amazon EC2 User Guide • Tutorial: Get started with Amazon EC2 Linux instances in the Amazon EC2 User Guide If you’re already familiar with EC2 instance management and want to streamline configuration and management for multiple EC2 instances, use Quick Setup. Whether your organization has dozens, thousands, or millions of EC2 instances, use the following Quick Setup procedure to configure multiple options for them, all at once. Note This configuration type lets you set multiple options for an entire organization defined in AWS Organizations, only some organizational accounts and Regions, or a single account. One of these options is to check for and apply updates to SSM Agent every two weeks. If you are an organization administrator, you can also choose to update all EC2 instances in your organization with agent updates every two weeks using the Default Host Management Configuration type. For information, see Set up the Default Host Management Configuration for an organization using Quick Setup. Configuring host management options for EC2 instances To set up host management, perform the following tasks in the AWS Systems Manager Quick Setup console. Quick Setup 1913 AWS Systems Manager User Guide To open the Host Management configuration page 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Quick Setup. 3. On the Host Management card, choose Create. Tip If you already have one or more configurations in your account, first choose the Library tab or the Create button in the Configurations section to view the cards. To configure Systems Manager host management options • To configure Systems Manager functionality, in the Configuration options section, choose the options in the Systems Manager group that you want to enable for your configuration: Update Systems Manager (SSM) Agent every two weeks Enables Systems Manager to check every two weeks for a new version of the agent. If there is a new version, then Systems Manager automatically updates the agent on your managed node to the latest released version. Quick Setup doesn't install the agent on instances where it's not already present. For information about which AMIs have SSM Agent preinstalled, see Find AMIs with the SSM Agent preinstalled. We encourage you to choose this option to ensure that your nodes are always running the most up-to-date version of SSM Agent. For more information about SSM Agent, including information about how to manually install the agent, see Working with SSM Agent. Collect inventory from your instances every 30 minutes Enables Quick Setup to configure collection of the following types of metadata: • AWS components – EC2 driver, agents, versions, and more. • Applications – Application names, publishers, versions, and more. • Node details – System name, operating system (OS) name, OS version, last boot, DNS, domain, work group, OS architecture, and more. Quick Setup 1914 AWS Systems Manager User Guide • Network configuration – IP address, MAC address, DNS, gateway, subnet mask, and more. • Services – Name, display name, status, dependent services, service type, start type, and more (Windows Server nodes only). • Windows roles – Name, display name, path, feature type, installed state, and
|
systems-manager-ug-549
|
systems-manager-ug.pdf
| 549 |
the following types of metadata: • AWS components – EC2 driver, agents, versions, and more. • Applications – Application names, publishers, versions, and more. • Node details – System name, operating system (OS) name, OS version, last boot, DNS, domain, work group, OS architecture, and more. Quick Setup 1914 AWS Systems Manager User Guide • Network configuration – IP address, MAC address, DNS, gateway, subnet mask, and more. • Services – Name, display name, status, dependent services, service type, start type, and more (Windows Server nodes only). • Windows roles – Name, display name, path, feature type, installed state, and more (Windows Server nodes only). • Windows updates – Hotfix ID, installed by, installed date, and more (Windows Server nodes only). For more information about Inventory, a tool in AWS Systems Manager, see AWS Systems Manager Inventory. Note The Inventory collection option can take up to 10 minutes to complete, even if you only selected a few nodes. Scan instances for missing patches daily Enables Patch Manager, a tool in Systems Manager, to scan your nodes daily and generate a report in the Compliance page. The report shows how many nodes are patch-compliant according to the default patch baseline. The report includes a list of each node and its compliance status. For information about patching operations and patch baselines, see AWS Systems Manager Patch Manager. For information about patch compliance, see the Systems Manager Compliance page. For information about patching managed nodes in multiple accounts and Regions in one configuration, see Patch policy configurations in Quick Setup and Configure patching for instances in an organization using a Quick Setup patch policy. Important Systems Manager supports several methods for scanning managed nodes for patch compliance. If you implement more than one of these methods at a time, the patch Quick Setup 1915 AWS Systems Manager User Guide compliance information you see is always the result of the most recent scan. Results from previous scans are overwritten. If the scanning methods use different patch baselines, with different approval rules, the patch compliance information can change unexpectedly. For more information, see Avoiding unintentional patch compliance data overwrites. To configure Amazon CloudWatch host management options • To configure CloudWatch functionality, in the Configuration options section, choose the options in the Amazon CloudWatch group that you want to enable for your configuration: Install and configure the CloudWatch agent Installs the basic configuration of the unified CloudWatch agent on your Amazon EC2 instances. The agent collects metrics and log files from your instances for Amazon CloudWatch. This information is consolidated so you can quickly determine the health of your instances. For more information about the CloudWatch agent basic configuration, see CloudWatch agent predefined metric sets. There might be added cost. For more information, see Amazon CloudWatch pricing. Update the CloudWatch agent once every 30 days Enables Systems Manager to check every 30 days for a new version of the CloudWatch agent. If there is a new version, Systems Manager updates the agent on your instance. We encourage you to choose this option to ensure that your instances are always running the most up-to-date version of the CloudWatch agent. To configure Amazon EC2 Launch Agent host management options • To configure Amazon EC2 Launch Agent functionality, in the Configuration options section, choose the options in the Amazon EC2 Launch Agent group that you want to enable for your configuration: Quick Setup 1916 AWS Systems Manager User Guide Update the EC2 launch agent once every 30 days Enables Systems Manager to check every 30 days for a new version of the launch agent installed on your instance. If a new version is available, Systems Manager updates the agent on your instance. We encourage you to choose this option to ensure that your instances are always running the most up-to-date version of the applicable launch agent. For Amazon EC2 Windows instances, this option supports EC2Launch, EC2Launch v2, and EC2Config. For Amazon EC2 Linux instances, this option supports cloud-init. For Amazon EC2 Mac instances, this option supports ec2-macos-init. Quick Setup doesn't support updating launch agents that are installed on operating systems not supported by the launch agent, or on AL2023. For more information about these initialization agents see the following topics: • Configure a Windows instance using EC2Launch v2 • Configure a Windows instance using EC2Launch • Configure a Windows instance using the EC2Config service • cloud-init Documentation • ec2-macos-init To select the EC2 instances to be updated by the host management configuration • In the Targets section, choose the method to determine the accounts and Regions where the configuration is to be deployed: Note You can't create multiple Quick Setup Host Management configurations that target the same AWS Region. Entire organization Your configuration is deployed to all organizational units (OUs) and AWS Regions in your organization. Quick Setup 1917
|
systems-manager-ug-550
|
systems-manager-ug.pdf
| 550 |
topics: • Configure a Windows instance using EC2Launch v2 • Configure a Windows instance using EC2Launch • Configure a Windows instance using the EC2Config service • cloud-init Documentation • ec2-macos-init To select the EC2 instances to be updated by the host management configuration • In the Targets section, choose the method to determine the accounts and Regions where the configuration is to be deployed: Note You can't create multiple Quick Setup Host Management configurations that target the same AWS Region. Entire organization Your configuration is deployed to all organizational units (OUs) and AWS Regions in your organization. Quick Setup 1917 AWS Systems Manager User Guide Note The Entire organization option is only available if you're configuring host management from your organization's management account. Custom 1. In the Target OUs section, select the OUs where you want to deploy this host management configuration. 2. In the Target Regions section, select the Regions where you want to deploy this host management configuration. Current account Choose one of the Region options and follow the steps for that option. Current Region Choose how to target instances in the current Region only: • All instances – The host management configuration automatically targets every EC2 in the current Region. • Tag – Choose Add and enter the key and optional value that is added to the instances to be targeted. • Resource group – For Resource group, select an existing resource group that contains the EC2 instances to be targeted. • Manual – In the Instances section, select the check box of each EC2 instance to be targeted. Choose Regions Choose how to target instances in the Region you specify by choosing one of the following: • All instances – All instances in the Regions you specify are targeted. Quick Setup 1918 AWS Systems Manager User Guide • Tag – Choose Add and enter the key and optional value that has been added to the instances to be targeted. In the Target Regions section, select the Regions where you want to deploy this host management configuration. To specify an instance profile option • Entire organization and Custom targets only. In the Instance profile options section, choose whether you want to add the required IAM policies to the existing instance profiles attached to your instances, or to allow Quick Setup to create the IAM policies and instance profiles with the permissions needed for the configuration you choose. After specifying all your configuration choices, choose Create. Set up the Default Host Management Configuration for an organization using Quick Setup With Quick Setup, a tool in AWS Systems Manager, you can activate Default Host Management Configuration for all accounts and Regions that have been added to your organization in AWS Organizations. This ensures that SSM Agent is kept up to date on all Amazon Elastic Compute Cloud (EC2) instances in the organization, and that they can connect to Systems Manager. Before you begin Ensure that the following requirements are met before enabling this setting. • The latest version of SSM Agent is already installed on all EC2 instances to be managed in your organization. • Your EC2 instances to be managed are using Instance Metadata Service Version 2 (IMDSv2). • You are signed in to the management account for your organization, as specified in AWS Organizations, using an AWS Identity and Access Management (IAM) identity (user, role, or group) with administrator permissions. Using the default EC2 instance management role Default Host Management Configuration makes use of the default-ec2-instance- management-role service setting for Systems Manager. This is a role with permissions that you Quick Setup 1919 AWS Systems Manager User Guide want made available to all accounts in your organization to allow communication between SSM Agent on the instance and the Systems Manager service in the cloud. If you have already set this role using the update-service-setting CLI command, Default Host Management Configuration uses that role. If you have not set this role yet, Quick Setup will create and apply the role for you. To check whether this role has already been specified for your organization, use the get-service- setting command. Enable automatic updates of SSM Agent every two weeks Use the following procedure to enable the Default Host Management Configuration option for your entire AWS Organizations organization. To enable automatic updates of SSM Agent every two weeks 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Quick Setup. 3. On the Default Host Management Configuration card, choose Create. Tip If you already have one or more configurations in your account, first choose the Library tab or the Create button in the Configurations section to view the cards. 4. In the Configuration options section, select Enable automatic updates of SSM Agent every two weeks. 5. Choose Create Create an AWS Config configuration recorder
|
systems-manager-ug-551
|
systems-manager-ug.pdf
| 551 |
Configuration option for your entire AWS Organizations organization. To enable automatic updates of SSM Agent every two weeks 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Quick Setup. 3. On the Default Host Management Configuration card, choose Create. Tip If you already have one or more configurations in your account, first choose the Library tab or the Create button in the Configurations section to view the cards. 4. In the Configuration options section, select Enable automatic updates of SSM Agent every two weeks. 5. Choose Create Create an AWS Config configuration recorder using Quick Setup With Quick Setup, a tool in AWS Systems Manager, you can quickly create a configuration recorder powered by AWS Config. Use the configuration recorder to detect changes in your resource configurations and capture the changes as configuration items. If you're unfamiliar with AWS Config, we recommend learning more about the service by reviewing the content in the AWS Config Developer Guide before creating a configuration with Quick Setup. For more information about AWS Config, see What is AWS Config? in the AWS Config Developer Guide. Quick Setup 1920 AWS Systems Manager User Guide By default, the configuration recorder records all supported resources in the AWS Region where AWS Config is running. You can customize the configuration so that only the resource types you specify are recorded. For more information, see Selecting which resources AWS Config records in the AWS Config Developer Guide. You're charged service usage fees when AWS Config starts recording configurations. For pricing information, see AWS Config pricing. Note If you've already created a configuration recorder, Quick Setup doesn't stop recording or make any changes to resource types that you're already recording. If you choose to record additional resource types using Quick Setup, the service appends them to your existing recorder groups. Deleting the Quick Setup Config recording configuration type doesn't stop the configuration recorder. Changes continue to be recorded, and service usage fees apply until you stop the configuration recorder. To learn more about managing the configuration recorder, see Managing the Configuration Recorder in the AWS Config Developer Guide. To set up AWS Config recording, perform the following tasks in the AWS Systems Manager console. To set up AWS Config recording with Quick Setup 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Quick Setup. 3. On the Config Recording card, choose Create. Tip If you already have one or more configurations in your account, first choose the Library tab or the Create button in the Configurations section to view the cards. 4. In the Configuration options section, do the following: a. For Choose the AWS resource types to record, specify whether to record all supported resources or only the resource types you choose. Quick Setup 1921 AWS Systems Manager User Guide b. c. For Delivery settings, specify whether to create a new Amazon Simple Storage Service (Amazon S3) bucket, or choose an existing bucket to send configuration snapshots to. For Notification options, choose the notification option you prefer. AWS Config uses Amazon Simple Notification Service (Amazon SNS) to notify you about important AWS Config events related to your resources. If you choose the Use existing SNS topics option, you must provide the AWS account ID and name of the existing Amazon SNS topic in that account you want to use. If you target multiple AWS Regions, the topic names must be identical in each Region. 5. In the Schedule section, choose how frequently you want Quick Setup to remediate changes made to resources that differ from your configuration. The Default option runs once. If you don't want Quick Setup to remediate changes made to resources that differ from your configuration, choose Disable remediation under Custom. 6. In the Targets section, choose one of the following to identify the accounts and Regions for recording. Note If you are working in a single account, options for working with organizations and organizational units (OUs) are not available. You can choose whether to apply this configuration to all AWS Regions in your account or only the Regions you select. • Entire organization – All accounts and Regions in your organization. • Custom – Only the OUs and Regions that you specify. • In the Target OUs section, select the OUs where you want to allow recording. • In the Target Regions section, select the Regions where you want to allow recording. • Current account – Only the Regions you specify in the account you are currently signed into are targeted. Choose one of the following: • Current Region – Only managed nodes in the Region selected in the console are targeted. • Choose Regions – Choose the individual Regions to apply the recording configuration to. 7. Choose Create. Quick Setup
|
systems-manager-ug-552
|
systems-manager-ug.pdf
| 552 |
• Custom – Only the OUs and Regions that you specify. • In the Target OUs section, select the OUs where you want to allow recording. • In the Target Regions section, select the Regions where you want to allow recording. • Current account – Only the Regions you specify in the account you are currently signed into are targeted. Choose one of the following: • Current Region – Only managed nodes in the Region selected in the console are targeted. • Choose Regions – Choose the individual Regions to apply the recording configuration to. 7. Choose Create. Quick Setup 1922 AWS Systems Manager User Guide Deploy AWS Config conformance pack using Quick Setup A conformance pack is a collection of AWS Config rules and remediation actions. With Quick Setup, you can deploy a conformance pack as a single entity in an account and an AWS Region or across an organization in AWS Organizations. This helps you manage configuration compliance of your AWS resources at scale, from policy definition to auditing and aggregated reporting, by using a common framework and packaging model. To deploy conformance packs, perform the following tasks in the AWS Systems Manager Quick Setup console. Note You must enable AWS Config recording before deploying this configuration. For more information, see Conformance packs in the AWS Config Developer Guide. To deploy conformance packs with Quick Setup 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Quick Setup. 3. On the Conformance Packs card, choose Create. Tip If you already have one or more configurations in your account, first choose the Library tab or the Create button in the Configurations section to view the cards. 4. 5. In the Choose conformance packs section, choose the conformance packs you want to deploy. In the Schedule section, choose how frequently you want Quick Setup to remediate changes made to resources that differ from your configuration. The Default option runs once. If you don't want Quick Setup to remediate changes made to resources that differ from your configuration, choose Disabled under Custom. 6. In the Targets section, choose whether to deploy conformance packs to your entire organization, some AWS Regions, or the account you're currently logged in to. If you choose Entire organization, continue to step 8. Quick Setup 1923 AWS Systems Manager User Guide If you choose Custom, continue to step 7. 7. In the Target Regions section, select the check boxes of the Regions you want to deploy conformance packs to. 8. Choose Create. Configure patching for instances in an organization using a Quick Setup patch policy With Quick Setup, a tool in AWS Systems Manager, you can create patch policies powered by Patch Manager. A patch policy defines the schedule and baseline to use when automatically patching your Amazon Elastic Compute Cloud (Amazon EC2) instances and other managed nodes. Using a single patch policy configuration, you can define patching for all accounts in multiple AWS Regions in your organization, for only the accounts and Regions you choose, or for a single account-Region pair. For more information about patch policies, see Patch policy configurations in Quick Setup. Prerequisite To define a patch policy for a node using Quick Setup, the node must be a managed node. For more information about managing your nodes, see Setting up Systems Manager unified console for an organization. Important Patch compliance scanning methods – Systems Manager supports several methods for scanning managed nodes for patch compliance. If you implement more than one of these methods at a time, the patch compliance information you see is always the result of the most recent scan. Results from previous scans are overwritten. If the scanning methods use different patch baselines, with different approval rules, the patch compliance information can change unexpectedly. For more information, see Avoiding unintentional patch compliance data overwrites. Association compliance status and patch policies – The patching status for a managed node that's under a Quick Setup patch policy matches the status of the State Manager association execution for that node. If the association execution status is Compliant, the patching status for the managed node is also marked Compliant. If the association execution status is Non-Compliant, the patching status for the managed node is also marked Non-Compliant. Quick Setup 1924 AWS Systems Manager User Guide Supported Regions for patch policy configurations Patch policy configurations in Quick Setup are currently supported in the following Regions: • US East (Ohio) (us-east-2) • US East (N. Virginia) (us-east-1) • US West (N. California) (us-west-1) • US West (Oregon) (us-west-2) • Asia Pacific (Mumbai) (ap-south-1) • Asia Pacific (Seoul) (ap-northeast-2) • Asia Pacific (Singapore) (ap-southeast-1) • Asia Pacific (Sydney) (ap-southeast-2) • Asia Pacific (Tokyo) (ap-northeast-1) • Canada (Central) (ca-central-1) • Europe (Frankfurt) (eu-central-1) • Europe (Ireland) (eu-west-1) • Europe (London) (eu-west-2) •
|
systems-manager-ug-553
|
systems-manager-ug.pdf
| 553 |
status for the managed node is also marked Non-Compliant. Quick Setup 1924 AWS Systems Manager User Guide Supported Regions for patch policy configurations Patch policy configurations in Quick Setup are currently supported in the following Regions: • US East (Ohio) (us-east-2) • US East (N. Virginia) (us-east-1) • US West (N. California) (us-west-1) • US West (Oregon) (us-west-2) • Asia Pacific (Mumbai) (ap-south-1) • Asia Pacific (Seoul) (ap-northeast-2) • Asia Pacific (Singapore) (ap-southeast-1) • Asia Pacific (Sydney) (ap-southeast-2) • Asia Pacific (Tokyo) (ap-northeast-1) • Canada (Central) (ca-central-1) • Europe (Frankfurt) (eu-central-1) • Europe (Ireland) (eu-west-1) • Europe (London) (eu-west-2) • Europe (Paris) (eu-west-3) • Europe (Stockholm) (eu-north-1) • South America (São Paulo) (sa-east-1) Permissions for the patch policy S3 bucket When you create a patch policy, Quick Setup creates an Amazon S3 bucket that contains a file named baseline_overrides.json. This file stores information about the patch baselines that you specified for your patch policy. The S3 bucket is named in the format aws-quicksetup-patchpolicy-account-id-quick- setup-configuration-id. For example: aws-quicksetup-patchpolicy-123456789012-abcde If you're creating a patch policy for an organization, the bucket is created in your organization's management account. Quick Setup 1925 AWS Systems Manager User Guide There are two use cases when you must provide other AWS resources with permission to access this S3 bucket using AWS Identity and Access Management (IAM) policies: • Case 1: Use your own instance profile or service role with your managed nodes instead of one provided by Quick Setup • Case 2: Use VPC endpoints to connect to Systems Manager The permissions policy you need in either case is located in the section below, Policy permissions for Quick Setup S3 buckets. Case 1: Use your own instance profile or service role with your managed nodes instead of one provided by Quick Setup Patch policy configurations include an option to Add required IAM policies to existing instance profiles attached to your instances. If you don't choose this option but want Quick Setup to patch your managed nodes using this patch policy, you must ensure that the following are implemented: • The IAM managed policy AmazonSSMManagedInstanceCore must be attached to the IAM instance profile or IAM service role that's used to provide Systems Manager permissions to your managed nodes. • You must add permissions to access your patch policy bucket as an inline policy to the IAM instance profile or IAM service role. You can provide wildcard access to all aws-quicksetup- patchpolicy buckets or only the specific bucket created for your organization or account, as shown in the earlier code samples. • You must tag your IAM instance profile or IAM service role with the following key-value pair. Key: QSConfigId-quick-setup-configuration-id, Value: quick-setup- configuration-id quick-setup-configuration-id represents the value of the parameter applied to the AWS CloudFormation stack that is used in creating your patch policy configuration. To retrieve this ID, do the following: 1. Open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation. 2. Select the name of the stack that is used to create your patch policy. The name is in a format such as StackSet-AWS-QuickSetup-PatchPolicy-LA-q4bkg-52cd2f06- d0f9-499e-9818-d887cEXAMPLE. Quick Setup 1926 AWS Systems Manager 3. Choose the Parameters tab. User Guide 4. In the Parameters list, in the Key column, locate the key QSConfigurationId. In the Value column for its row, locate the configuration ID, such as abcde. In this example, for the tag to apply to your instance profile or service role, the key is QSConfigId-abcde, and the value is abcde. For information about adding tags to an IAM role, see Tagging IAM roles and Managing tags on instance profiles (AWS CLI or AWS API) in the IAM User Guide. Case 2: Use VPC endpoints to connect to Systems Manager If you use VPC endpoints to connect to Systems Manager, your VPC endpoint policy for S3 must allow access to your Quick Setup patch policy S3 bucket. For information about adding permissions to a VPC endpoint policy for S3, see Controlling access from VPC endpoints with bucket policies in the Amazon S3 User Guide. Policy permissions for Quick Setup S3 buckets You can provide wildcard access to all aws-quicksetup-patchpolicy buckets or only the specific bucket created for your organization or account. To provide the necessary permissions for the two cases described below, use either format. All patch policy buckets { "Version": "2012-10-17", "Statement": [ { "Sid": "AccessToAllPatchPolicyRelatedBuckets", "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::aws-quicksetup-patchpolicy-*" } ] } Specific patch policy bucket { Quick Setup 1927 AWS Systems Manager User Guide "Version": "2012-10-17", "Statement": [ { "Sid": "AccessToMyPatchPolicyRelatedBucket", "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::aws-quicksetup-patchpolicy-account-id-quick-setup- configuration- id" } ] } 1After the patch policy configuration is created, you can locate the full name of your bucket in the S3 console. For example: aws-quicksetup-patchpolicy-123456789012-abcde Random patch baseline IDs in patch policy operations Patching operations for patch policies utilize the BaselineOverride parameter in the AWS- RunPatchBaseline
|
systems-manager-ug-554
|
systems-manager-ug.pdf
| 554 |
below, use either format. All patch policy buckets { "Version": "2012-10-17", "Statement": [ { "Sid": "AccessToAllPatchPolicyRelatedBuckets", "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::aws-quicksetup-patchpolicy-*" } ] } Specific patch policy bucket { Quick Setup 1927 AWS Systems Manager User Guide "Version": "2012-10-17", "Statement": [ { "Sid": "AccessToMyPatchPolicyRelatedBucket", "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::aws-quicksetup-patchpolicy-account-id-quick-setup- configuration- id" } ] } 1After the patch policy configuration is created, you can locate the full name of your bucket in the S3 console. For example: aws-quicksetup-patchpolicy-123456789012-abcde Random patch baseline IDs in patch policy operations Patching operations for patch policies utilize the BaselineOverride parameter in the AWS- RunPatchBaseline SSM Command document. When you use AWS-RunPatchBaseline for patching outside of a patch policy, you can use BaselineOverride to specify a list of patch baselines to use during the operation that are different from the specified defaults. You create this list in a file named baseline_overrides.json and manually add it to an Amazon S3 bucket that you own, as explained in Using the BaselineOverride parameter. For patching operations based on patch policies, however, Systems Manager automatically creates an S3 bucket and adds a baseline_overrides.json file to it. Then, every time Quick Setup runs a patching operation (using the Run Command tool, the system generates a random ID for each patch baseline. This ID is different for every patch policy patching operation, and the patch baseline it represents is not stored or accessible to you in your account. As a result, you will not see the ID of the patch baseline selected in your configuration in patching logs. This applies to both AWS managed patch baselines and custom patch baselines you might have selected. The baseline ID reported in the log is instead that one that was generated for that specific patching operation. Quick Setup 1928 AWS Systems Manager User Guide In addition, if you attempt to view details in Patch Manager about a patch baseline that was generated with a random ID, the system reports that the patch baseline doesn't exist. This is expected behavior and can be ignored. Creating a patch policy To create a patch policy, perform the following tasks in the Systems Manager console. To create a patch policy with Quick Setup 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. If you are setting up patching for an organization, make sure you are signed in to the management account for the organization. You can't set up the policy using the delegated administrator account or a member account. 2. In the navigation pane, choose Quick Setup. 3. On the Patch Manager card, choose Create. Tip If you already have one or more configurations in your account, first choose the Library tab or the Create button in the Configurations section to view the cards. 4. 5. For Configuration name, enter a name to help identify the patch policy. In the Scanning and installation section, under Patch operation, choose whether the patch policy will Scan the specified targets or Scan and install patches on the specified targets. 6. Under Scanning schedule, choose Use recommended defaults or Custom scan schedule. The default scan schedule will scan your targets daily at 1:00 AM UTC. • If you choose Custom scan schedule, select the Scanning frequency. • If you choose Daily, enter the time, in UTC, that you want to scan your targets. • If you choose Custom CRON Expression, enter the schedule as a CRON expression. For more information about formatting CRON expressions for Systems Manager, see Reference: Cron and rate expressions for Systems Manager. Also, select Wait to scan targets until first CRON interval. By default, Patch Manager immediately scans nodes as they become targets. Quick Setup 1929 AWS Systems Manager User Guide 7. If you chose Scan and install, choose the Installation schedule to use when installing patches to the specified targets. If you choose Use recommended defaults, Patch Manager will install weekly patches at 2:00 AM UTC on Sunday. • If you choose Custom install schedule, select the Installation Frequency. • If you choose Daily, enter the time, in UTC, that you want to install updates on your targets. • If you choose Custom CRON expression, enter the schedule as a CRON expression. For more information about formatting CRON expressions for Systems Manager, see Reference: Cron and rate expressions for Systems Manager. Also, clear Wait to install updates until first CRON interval to immediately install updates on nodes as they become targets. By default, Patch Manager waits until the first CRON interval to install updates. • Choose Reboot if needed to reboot the nodes after patch installation. Rebooting after installation is recommended but can cause availability issues. 8. In the Patch baseline section, choose the patch baselines to use when scanning and updating your targets. By default, Patch Manager uses the predefined patch baselines. For more information,
|
systems-manager-ug-555
|
systems-manager-ug.pdf
| 555 |
formatting CRON expressions for Systems Manager, see Reference: Cron and rate expressions for Systems Manager. Also, clear Wait to install updates until first CRON interval to immediately install updates on nodes as they become targets. By default, Patch Manager waits until the first CRON interval to install updates. • Choose Reboot if needed to reboot the nodes after patch installation. Rebooting after installation is recommended but can cause availability issues. 8. In the Patch baseline section, choose the patch baselines to use when scanning and updating your targets. By default, Patch Manager uses the predefined patch baselines. For more information, see Predefined baselines. If you choose Custom patch baseline, change the selected patch baseline for operating systems that you don't want to use a predefined AWS patch baseline. Note If you use VPC endpoints to connect to Systems Manager, make sure your VPC endpoint policy for S3 allows access to this S3 bucket. For more information, see Permissions for the patch policy S3 bucket. Important If you are using a patch policy configuration in Quick Setup, updates you make to custom patch baselines are synchronized with Quick Setup once an hour. If a custom patch baseline that was referenced in a patch policy is deleted, a banner displays on the Quick Setup Configuration details page for your patch policy. The Quick Setup 1930 AWS Systems Manager User Guide banner informs you that the patch policy references a patch baseline that no longer exists, and that subsequent patching operations will fail. In this case, return to the Quick Setup Configurations page, select the Patch Manager configuration , and choose Actions, Edit configuration. The deleted patch baseline name is highlighted, and you must select a new patch baseline for the affected operating system. 9. (Optional) In the Patching log storage section, select Write output to S3 bucket to store patching operation logs in an Amazon S3 bucket. Note If you are setting up a patch policy for an organization, the management account for your organization must have at least read-only permissions for this bucket. All organization units included in the policy must have write-access to the bucket. For information about granting bucket access to different accounts, see Example 2: Bucket owner granting cross-account bucket permissions in the Amazon Simple Storage Service User Guide. 10. Choose Browse S3 to select the bucket that you want to store patch log output in. The management account must have read access to this bucket. All non-management accounts and targets configured in the Targets section must have write access to the provided S3 bucket for logging. 11. In the Targets section, choose one of the following to identify the accounts and Regions for this patch policy operation. Note If you are working in a single account, options for working with organizations and organizational units (OUs) are not available. You can choose whether to apply this configuration to all AWS Regions in your account or only the Regions you select. If you previously specified a Home Region for you account and haven't onboarded to the new Quick Setup console experience, you can't exclude that Region from the Targets configuration. • Entire organization – All accounts and Regions in your organization. • Custom – Only the OUs and Regions that you specify. Quick Setup 1931 AWS Systems Manager User Guide • In the Target OUs section, select the OUs where you want to set up the patch policy. • In the Target Regions section, select the Regions where you want to apply the patch policy. • Current account – Only the Regions you specify in the account you are currently signed into are targeted. Choose one of the following: • Current Region – Only managed nodes in the Region selected in the console are targeted. • Choose Regions – Choose the individual Regions to apply the patch policy to. 12. For Choose how you want to target instances, choose one of the following to identify the nodes to patch: • All managed nodes – All managed nodes in the selected OUs and Regions. • Specify the resource group – Choose the name of a resource group from the list to target its associated resources. Note Currently, selecting resource groups is supported only for single account configurations. To patch resources in multiple accounts, choose a different targeting option. • Specify a node tag – Only nodes tagged with the key-value pair that you specify are patched in all accounts and Regions you have targeted. • Manual – Choose managed nodes from all specified accounts and Regions manually from a list. Note This option currently supports only Amazon EC2 instances. You can add a maximum of 25 instances manually in a patch policy configuration. 13. In the Rate control section, do the following: • For Concurrency, enter a number or percentage
|
systems-manager-ug-556
|
systems-manager-ug.pdf
| 556 |
is supported only for single account configurations. To patch resources in multiple accounts, choose a different targeting option. • Specify a node tag – Only nodes tagged with the key-value pair that you specify are patched in all accounts and Regions you have targeted. • Manual – Choose managed nodes from all specified accounts and Regions manually from a list. Note This option currently supports only Amazon EC2 instances. You can add a maximum of 25 instances manually in a patch policy configuration. 13. In the Rate control section, do the following: • For Concurrency, enter a number or percentage of nodes to run the patch policy on at the same time. • For Error threshold, enter the number or percentage of nodes that can experience an error before the patch policy fails. Quick Setup 1932 AWS Systems Manager User Guide 14. (Optional) Select the Add required IAM policies to existing instance profiles attached to your instances check box. This selection applies the IAM policies created by this Quick Setup configuration to nodes that already have an instance profile attached (EC2 instances) or a service role attached (hybrid- activated nodes). We recommend this selection when your managed nodes already have an instance profile or service role attached, but it doesn't contain all the permissions required for working with Systems Manager. Your selection here is applied to managed nodes created later in the accounts and Regions that this patch policy configuration applies to. Important If you don't select this check box but want Quick Setup to patch your managed nodes using this patch policy, you must do the following: Add permissions to your IAM instance profile or IAM service role to access the S3 bucket created for your patch policy Tag your IAM instance profile or IAM service role with a specific key-value pair. For information, see Case 1: Use your own instance profile or service role with your managed nodes instead of one provided by Quick Setup. 15. Choose Create. To review patching status after the patch policy is created, you can access the configuration from the Quick Setup page. Set up DevOps Guru using Quick Setup You can quickly configure DevOps Guru options by using Quick Setup. Amazon DevOps Guru is a machine learning (ML) powered service that makes it easy to improve an application's operational performance and availability. DevOps Guru detects behaviors that are different from normal operating patterns so you can identify operational issues long before they impact your customers. DevOps Guru automatically ingests operational data from your AWS applications and provides a single dashboard to visualize issues in your operational data. You can get started with DevOps Guru to improve application availability and reliability with no manual setup or machine learning expertise. Configuring DevOps Guru with Quick Setup is available in the following AWS Regions: Quick Setup 1933 User Guide AWS Systems Manager • US East (N. Virginia) • US East (Ohio) • US West (Oregon) • Europe (Frankfurt) • Europe (Ireland) • Europe (Stockholm) • Asia Pacific (Singapore) • Asia Pacific (Sydney) • Asia Pacific (Tokyo) For pricing information, see Amazon DevOps Guru pricing. To set up DevOps Guru, perform the following tasks in the AWS Systems Manager Quick Setup console. To set up DevOps Guru with Quick Setup 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Quick Setup. 3. On the DevOps Guru card, choose Create. Tip If you already have one or more configurations in your account, first choose the Library tab or the Create button in the Configurations section to view the cards. 4. In the Configuration options section, choose the AWS resource types you want to analyze and your notification preferences. If you don't select the Analyze all AWS resources in all the accounts in my organization option, you can choose AWS resources to analyze later in the DevOps Guru console. DevOps Guru analyzes different AWS resource types (such as Amazon Simple Storage Service (Amazon S3) buckets and Amazon Elastic Compute Cloud (Amazon EC2) instances), which are categorized into two pricing groups. You pay for the AWS resource hours analyzed, for each Quick Setup 1934 AWS Systems Manager User Guide active resource. A resource is only active if it produces metrics, events, or log entries within an hour. The rate you're charged for a specific AWS resource type depends on the price group. If you select the Enable SNS notifications option, an Amazon Simple Notification Service (Amazon SNS) topic is created in each AWS account in the organizational units (OUs) you target with your configuration. DevOps Guru uses the topic to notify you about important DevOps Guru events, such as the creation of a new insight. If you don't enable this option, you can add a topic later in the DevOps Guru console.
|
systems-manager-ug-557
|
systems-manager-ug.pdf
| 557 |
resource is only active if it produces metrics, events, or log entries within an hour. The rate you're charged for a specific AWS resource type depends on the price group. If you select the Enable SNS notifications option, an Amazon Simple Notification Service (Amazon SNS) topic is created in each AWS account in the organizational units (OUs) you target with your configuration. DevOps Guru uses the topic to notify you about important DevOps Guru events, such as the creation of a new insight. If you don't enable this option, you can add a topic later in the DevOps Guru console. If you select the Enable AWS Systems Manager OpsItems option, operational work items (OpsItems) will be created for related Amazon EventBridge events and Amazon CloudWatch alarms. 5. In the Schedule section, choose how frequently you want Quick Setup to remediate changes made to resources that differ from your configuration. The Default option runs once. If you don't want Quick Setup to remediate changes made to resources that differ from your configuration, choose Disabled under Custom. 6. In the Targets section, choose whether to allow DevOps Guru to analyze resources in some of your organizational units (OUs), or the account you're currently logged in to. If you choose Custom, continue to step 8. If you choose Current account, continue to step 9. 7. In the Target OUs and Target Regions sections, select the check boxes of the OUs and Regions where you want to use DevOps Guru. 8. Choose the Regions where you want to use DevOps Guru in the current account. 9. Choose Create. Deploy Distributor packages using Quick Setup Distributor is a tool in AWS Systems Manager. A Distributor package is a collection of installable software or assets that can be deployed as a single entity. With Quick Setup, you can deploy a Distributor package in an AWS account and an AWS Region or across an organization in AWS Organizations. Currently, only the EC2Launch v2 agent, Amazon Elastic File System (Amazon EFS) utilities package and Amazon CloudWatch agent can be deployed with Quick Setup. For more information about Distributor, see AWS Systems Manager Distributor. Quick Setup 1935 AWS Systems Manager User Guide To deploy Distributor packages, perform the following tasks in the AWS Systems Manager Quick Setup console. To deploy Distributor packages with Quick Setup 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Quick Setup. 3. On the Distributor card, choose Create. Tip If you already have one or more configurations in your account, first choose the Library tab or the Create button in the Configurations section to view the cards. 4. 5. In the Configuration options section, choose the package you want to deploy. In the Targets section, choose whether to deploy the package to your entire organization, some of your organizational units (OUs), or the account you're currently logged in to. If you choose Entire organization, continue to step 8. If you choose Custom, continue to step 7. 6. In the Target OUs section, select the check boxes of the OUs and Regions you want to deploy the package to. 7. Choose Create. Stop and start EC2 instances automatically on a schedule using Quick Setup With Quick Setup, a tool in AWS Systems Manager, you can configure Resource Scheduler to automate the starting and stopping of Amazon Elastic Compute Cloud (Amazon EC2) instances. This Quick Setup configuration helps you reduce operational costs by starting and stopping instances according to the schedule that you specify. This tool helps you avoid incurring unnecessary costs for running instances when they’re not needed. For example, you currently might leave your instances running constantly, even though they’re only used 10 hours a day, 5 days a week. Instead, you can schedule your instances to stop every day after business hours. As a result, there would be 70 percent savings for those instances because the Quick Setup 1936 AWS Systems Manager User Guide running time is reduced from 168 hours to 50 hours. There is no cost to use Quick Setup. However, costs can be incurred by the resources you set up and the usage limits with no fees for the services used to set up your configuration. Using Resource Scheduler, you can choose to automatically stop and start instances across multiple AWS Regions and AWS accounts according to a schedule you define. The Quick Setup configuration targets Amazon EC2 instances using the tag key and value that you specify. Only the instances with a tag matching the value that you specify in your configuration are stopped or started by Resource Scheduler. Note that if the Amazon EBS volumes attached to the instance are encrypted, you must add the required permissions for the AWS KMS key to the IAM role for Resource Scheduler to start
|
systems-manager-ug-558
|
systems-manager-ug.pdf
| 558 |
up your configuration. Using Resource Scheduler, you can choose to automatically stop and start instances across multiple AWS Regions and AWS accounts according to a schedule you define. The Quick Setup configuration targets Amazon EC2 instances using the tag key and value that you specify. Only the instances with a tag matching the value that you specify in your configuration are stopped or started by Resource Scheduler. Note that if the Amazon EBS volumes attached to the instance are encrypted, you must add the required permissions for the AWS KMS key to the IAM role for Resource Scheduler to start the instance. Maximum instances per configuration An individual configuration supports scheduling up to 5,000 instances per Region. If your case requires more than 5,000 instances to be scheduled in a given Region, you must create multiple configurations. Tag your instances accordingly so each configuration is managing up to 5,000 instances. When creating multiple Resource Scheduler Quick Setup configurations, you must specify different tag key values. For example, one configuration can use the tag key Environment with the value Production, while another uses Environment and Development. Scheduling behaviors The following points describe certain behaviors of schedule configurations: • Resource Scheduler starts the tagged instances only if they are in the Stopped state. Similarly, instances are only stopped if they are in the running state. Resource Scheduler operates on an event driven model and only starts or stops instances at the times that you specify. For example, you create a schedule that starts instances at 9 AM. Resource Scheduler starts all instances associated with the tag you specify that are in the Stopped state at 9 AM. If the instances are manually stopped at a later time, Resource Scheduler will not start them again to maintain the Running state. Similarly, if an instance is started manually after it was stopped according to your schedule, Resource Scheduler will not stop the instance again. • If you create a schedule with a start time that is later in a 24-hour day than the stop time, Resource Scheduler assumes your instances are to run overnight. For example, you create a schedule that starts instances at 9 PM, and stops instances at 7 AM. Resource Scheduler starts all instances associated with the tag you specify that are in the Stopped state at 9 PM, and stops them at 7 AM the following day. For overnight schedules, the start time applies to the days you select for your schedule. However, the stop time applies to the following day in your schedule. Quick Setup 1937 AWS Systems Manager User Guide • When you create a schedule configuration, the current state of your instances might be changed to match the requirements of the schedule. For example, say that today is a Wednesday, and you specify a schedule for your managed instances to start at 9 AM and stop at 5 PM on Tuesdays and Thursdays only. Because your current time is outside of the prescribed hours for the instances to be running, they will be stopped after the configuration is created. The instances won't run again until the next prescribed hour, 9 AM on Thursday. If your instances are currently in a Stopped state, and you specify a schedule in which they would be running at the current time, Resource Scheduler starts them after the configuration is created. If you delete your configuration, instances are no longer stopped and started according to the previously defined schedule. In rare cases, instances might not successfully stop or start due to API operation failures. To set up scheduling for Amazon EC2 instances, perform the following tasks in the AWS Systems Manager Quick Setup console. To set up instance scheduling with Quick Setup 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Quick Setup. 3. On the Resource Scheduler card, choose Create. Tip If you already have one or more configurations in your account, first choose the Library tab or the Create button in the Configurations section to view the cards. 4. 5. 6. In the Instance tag section, specify the tag key and value applied to the instances you want to associate with your schedule. In the Schedule options section, specify the time zone, days, and times you want to start and stop your instances. In the Targets section, choose whether to set scheduling for a Custom group of organizational units (OUs), or the Current account you're signed in to: Quick Setup 1938 AWS Systems Manager User Guide • Custom – In the Target OUs section, select the OUs where you want to set up scheduling. Next, in the Target Regions section, select the Regions where you want to set up scheduling. • Current account – Select Current Region or Choose Regions. If you selected
|
systems-manager-ug-559
|
systems-manager-ug.pdf
| 559 |
In the Schedule options section, specify the time zone, days, and times you want to start and stop your instances. In the Targets section, choose whether to set scheduling for a Custom group of organizational units (OUs), or the Current account you're signed in to: Quick Setup 1938 AWS Systems Manager User Guide • Custom – In the Target OUs section, select the OUs where you want to set up scheduling. Next, in the Target Regions section, select the Regions where you want to set up scheduling. • Current account – Select Current Region or Choose Regions. If you selected Choose Regions, choose the Target Regions where you want to set up scheduling. 7. Verify the schedule information in the Summary section. 8. Choose Create. Configure AWS Resource Explorer using Quick Setup With Quick Setup, a tool in AWS Systems Manager, you can quickly configure AWS Resource Explorer to search and discover resources in your AWS account or across an entire AWS organization. You can search for your resources using metadata like names, tags, and IDs. AWS Resource Explorer provides fast responses to your search queries by using indexes. Resource Explorer creates and maintains indexes using a variety of data sources to gather information about resources in your AWS account. Quick Setup for Resource Explorer automates the index configuration process. For more information about AWS Resource Explorer, see What is AWS Resource Explorer? in the AWS Resource Explorer User Guide. During Quick Setup, Resource Explorer does the following: • Creates an index in every AWS Region in your AWS account. • Updates the index in the Region you specify to be the aggregator index for the account. • Creates a default view in the aggregator index Region. This view has no filters so it returns all resources found in the index. Minimum permissions To perform the steps in the following procedure, you must have the following permissions: • Action: resource-explorer-2:* – Resource: no specific resource (*) • Action: iam:CreateServiceLinkedRole – Resource: no specific resource (*) Quick Setup 1939 AWS Systems Manager To configure Resource Explorer User Guide 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Quick Setup. 3. On the Resource Explorer card, choose Create. 4. 5. 6. In the Aggregator Index Region section, choose which Region you want to contain the aggregator index. You should select the Region that is appropriate for the geographic location for your users. (Optional) Select the Replace existing aggregator indexes in Regions other than the one selected above check box. In the Targets section, choose the target organization or specific Organizational Units (OUs) containing the resources you want to discover. 7. In the Regions section, choose which Regions to include in the configuration. 8. Review the configuration summary, and then choose Create. On the Resource Explorer page, you can monitor the configuration status. Troubleshooting Quick Setup results Use the following information to help you troubleshoot problems with Quick Setup, a tool in AWS Systems Manager. This topic includes specific tasks to resolve issues based on the type of Quick Setup issue. Issue: Failed deployment A deployment fails if the CloudFormation stack set failed during creation. Use the following steps to investigate a deployment failure. 1. Navigate to the AWS CloudFormation console. 2. Choose the stack created by your Quick Setup configuration. The Stack name includes QuickSetup followed by the type of configuration you chose, such as SSMHostMgmt. Quick Setup 1940 AWS Systems Manager User Guide Note CloudFormation sometimes deletes failed stack deployments. If the stack isn't available in the Stacks table, choose Deleted from the filter list. 3. View the Status and Status reason. For more information about stack statuses, see Stack status codes in the AWS CloudFormation User Guide. 4. To understand the exact step that failed, view the Events tab and review each event's Status. 5. Review Troubleshooting in the AWS CloudFormation User Guide. 6. If you are unable to resolve the deployment failure using the CloudFormation troubleshooting steps, delete the configuration and reconfigure it. Issue: Failed association The Configuration details table on the Configuration details page of your configuration shows a Configuration status of Failed if any of the associations failed during set up. Use the following steps to troubleshoot a failed association. 1. In the Configuration details table, choose the failed configuration and then choose View Details. 2. Copy the Association name. 3. Navigate to State Manager and paste the association name into the search field. 4. Choose the association and choose the Execution history tab. 5. Under Execution ID, choose the association execution that failed. 6. 7. The Association execution targets page lists all of the nodes where the association ran. Choose the Output button for an execution that failed to run. In the Output page, choose Step - Output to
|
systems-manager-ug-560
|
systems-manager-ug.pdf
| 560 |
up. Use the following steps to troubleshoot a failed association. 1. In the Configuration details table, choose the failed configuration and then choose View Details. 2. Copy the Association name. 3. Navigate to State Manager and paste the association name into the search field. 4. Choose the association and choose the Execution history tab. 5. Under Execution ID, choose the association execution that failed. 6. 7. The Association execution targets page lists all of the nodes where the association ran. Choose the Output button for an execution that failed to run. In the Output page, choose Step - Output to view the error message for that step in the command execution. Each step can display a different error message. Review the error messages for all steps to help troubleshoot the issue. If viewing the step output doesn't solve the problem, then you can try to recreate the association. To recreate the association, first delete the failing association in State Manager. Quick Setup 1941 AWS Systems Manager User Guide After deleting the association, edit the configuration and choose the option you deleted and choose Update. Note To investigate Failed associations for an Organization configuration, you must sign in to the account with the failed association and use the following failed association procedure, previously described. The Association ID isn't a hyperlink to the target account when viewing results from the management account. Issue: Drift status When viewing a configuration's details page, you can view the drift status of each deployment. Configuration drift occurs whenever a user makes any change to a service or feature that conflicts with the selections made through Quick Setup. If an association has changed after the initial configuration, the table displays a warning icon that indicates the number of items that have drifted. You can determine what caused the drift by hovering over the icon. When an association is deleted in State Manager, the related deployments display a drift warning. To fix this, edit the configuration and choose the option that was removed when the association was deleted. Choose Update and wait for the deployment to complete. AWS Systems Manager application tools Application tools are a suite of capabilities that help you manage your applications running in AWS. Topics • AWS AppConfig • AWS Systems Manager Application Manager • AWS Systems Manager Parameter Store AWS AppConfig Information about AWS AppConfig has been moved into separate guides. For more information, see the following: • AWS AppConfig User Guide Application tools 1942 AWS Systems Manager • AWS AppConfig API Reference User Guide AWS Systems Manager Application Manager Application Manager, a tool in AWS Systems Manager, helps DevOps engineers investigate and remediate issues with their AWS resources in the context of their applications and clusters. Application Manager aggregates operations information from multiple AWS services and Systems Manager tools to a single AWS Management Console. In Application Manager, an application is a logical group of AWS resources that you want to operate as a unit. This logical group can represent different versions of an application, ownership boundaries for operators, or developer environments, to name a few. Application Manager support for container clusters includes both Amazon Elastic Kubernetes Service (Amazon EKS) and Amazon Elastic Container Service (Amazon ECS) clusters. The first time you open Application Manager, the What Application Manager can do for you page displays. When you choose Get started, Application Manager automatically imports metadata about your resources that were created in other AWS services or Systems Manager tools. Application Manager then displays those resources in a list grouped by predefined categories. For Applications, the list includes the following: • AWS CloudFormation stacks • Custom applications • AWS Launch Wizard applications • AppRegistry applications • AWS SAP Enterprise Workload applications • Amazon ECS clusters • Amazon EKS clusters After you set up and configure AWS services and Systems Manager tools, Application Manager displays the following types of information about your resources: • Information about the current state, status, and Amazon EC2 Auto Scaling health of the Amazon Elastic Compute Cloud (Amazon EC2) instances in your application • Alarms provided by Amazon CloudWatch Application Manager 1943 AWS Systems Manager User Guide • Compliance information provided by AWS Config and State Manager (a component of Systems Manager) • Kubernetes cluster information provided by Amazon EKS • Log data provided by AWS CloudTrail and Amazon CloudWatch Logs • OpsItems provided by Systems Manager OpsCenter • Resource details provided by the AWS services that host them. • Container cluster information provided by Amazon ECS. To help you remediate issues with components or resources, Application Manager also provides runbooks that you can associate with your applications. To get started with Application Manager, open the Systems Manager console. In the navigation pane, choose Application Manager. What are the benefits of using Application Manager? Application Manager reduces the time
|
systems-manager-ug-561
|
systems-manager-ug.pdf
| 561 |
of Systems Manager) • Kubernetes cluster information provided by Amazon EKS • Log data provided by AWS CloudTrail and Amazon CloudWatch Logs • OpsItems provided by Systems Manager OpsCenter • Resource details provided by the AWS services that host them. • Container cluster information provided by Amazon ECS. To help you remediate issues with components or resources, Application Manager also provides runbooks that you can associate with your applications. To get started with Application Manager, open the Systems Manager console. In the navigation pane, choose Application Manager. What are the benefits of using Application Manager? Application Manager reduces the time it takes for DevOps engineers to detect and investigate issues with AWS resources. To do this, Application Manager displays many types of operations information in the context of an application in one console. Application Manager also reduces the time it takes to remediate issues by providing runbooks that perform common remediation tasks on AWS resources. What are the features of Application Manager? Application Manager includes the following features: • Import your AWS resources automatically During initial setup, you can choose to have Application Manager automatically import and display resources in your AWS account that are based on CloudFormation stacks, AWS Resource Groups, Launch Wizard deployments, AppRegistry applications, and Amazon ECS and Amazon EKS clusters. The system displays these resources in predefined application or cluster categories. Thereafter, whenever new resources of these types are added to your AWS account, Application Manager automatically displays the new resources in the predefined application and cluster categories. • Create or edit CloudFormation stacks and templates Application Manager helps you provision and manage resources for your applications by integrating with CloudFormation. You can create, edit, and delete AWS CloudFormation Application Manager 1944 AWS Systems Manager User Guide templates and stacks in Application Manager. Application Manager also includes a template library where you can clone, create, and store templates. Application Manager and CloudFormation display the same information about the current status of a stack. Templates and template updates are stored in Systems Manager until you provision the stack, at which time the changes are also displayed in CloudFormation. • View information about your instances in the context of an application Application Manager integrates with Amazon Elastic Compute Cloud (Amazon EC2) to display information about your instances in the context of an application. Application Manager displays instance state, status, and Amazon EC2 Auto Scaling health for a selected application in a graphical format. The Instances tab also includes a table with the following information for each instance in your application. • Instance state (Pending, Stopping, Running, Stopped) • Ping status for SSM Agent • Status and name of the last Systems Manager Automation runbook processed on the instance • A count of Amazon CloudWatch Logs alarms per state. • ALARM – The metric or expression is outside of the defined threshold. • OK – The metric or expression is within the defined threshold. • INSUFFICIENT_DATA – The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state. • Auto Scaling group health for the parent and individual autoscaling groups • View operational metrics and alarms for an application or cluster Application Manager integrates with Amazon CloudWatch to provide real-time operational metrics and alarms for an application or cluster. You can drill down into your application tree to view alarms at each component level, or view alarms for an individual cluster. • View log data for an application Application Manager integrates with Amazon CloudWatch Logs to provide log data in the context of your application without having to leave Systems Manager. • View and manage OpsItems for an application or cluster Application Manager integrates with AWS Systems Manager OpsCenter to provide a list of operational work items (OpsItems) for your applications and clusters. The list reflects Application Manager 1945 AWS Systems Manager User Guide automatically generated and manually created OpsItems. You can view details about the resource that created an OpsItem and the OpsItem status, source, and severity. • View resource compliance data for an application or cluster Application Manager integrates with AWS Config to provide compliance and history details about your AWS resources according to rules you specify. Application Manager also integrates with AWS Systems Manager State Manager to provide compliance information about the state you want to maintain for your Amazon Elastic Compute Cloud (Amazon EC2) instances. • View Amazon ECS and Amazon EKS cluster infrastructure information Application Manager integrates with Amazon ECS and Amazon EKS to provide information about the health of your cluster infrastructures and a component runtime view of the compute, networking, and storage resources in a cluster. However, you can't manage or view operations information about your Amazon EKS pods or containers in Application Manager. You can only manage and
|
systems-manager-ug-562
|
systems-manager-ug.pdf
| 562 |
rules you specify. Application Manager also integrates with AWS Systems Manager State Manager to provide compliance information about the state you want to maintain for your Amazon Elastic Compute Cloud (Amazon EC2) instances. • View Amazon ECS and Amazon EKS cluster infrastructure information Application Manager integrates with Amazon ECS and Amazon EKS to provide information about the health of your cluster infrastructures and a component runtime view of the compute, networking, and storage resources in a cluster. However, you can't manage or view operations information about your Amazon EKS pods or containers in Application Manager. You can only manage and view operations information about the infrastructure that is hosting your Amazon EKS resources. • View resource cost details for an application Application Manager is integrated with AWS Cost Explorer, a feature of AWS Billing and Cost Management, through the Cost widget. After you enable Cost Explorer in the Billing and Cost Management console, the Cost widget in Application Manager shows cost data for a specific non- container application or application component. You can use filters in the widget to view cost data according to different time periods, granularities, and cost types in either a bar or line chart. • View detailed resource information in one console Choose a resource name listed in Application Manager and view contextual information and operations information about that resource without having to leave Systems Manager. • Receive automatic resource updates for applications If you make changes to a resource in a service console, and that resource is part of an application in Application Manager, then Systems Manager automatically displays those changes. For example, if you update a stack in the AWS CloudFormation console, and if that stack is part of an Application Manager application, then the stack updates are automatically reflected in Application Manager. • Discover Launch Wizard applications automatically Application Manager 1946 AWS Systems Manager User Guide Application Manager is integrated with AWS Launch Wizard. If you used Launch Wizard to deploy resources for an application, Application Manager can automatically import and display them in a Launch Wizard section. • Monitor application resources in Application Manager by using CloudWatch Application Insights Application Manager integrates with Amazon CloudWatch Application Insights. Application Insights identifies and sets up key metrics, logs, and alarms across your application resources and technology stack. Application Insights continuously monitors metrics and logs to detect and correlate anomalies and errors. When the system detects errors or anomalies, Application Insights generates CloudWatch Events that you can use to set up notifications or take actions. You can enable and view Application Insights on the Overview and Monitoring tabs in Application Manager. For more information about Application Insights, see What is Amazon CloudWatch Application Insights in the Amazon CloudWatch User Guide. • Remediate issues with runbooks Application Manager includes predefined Systems Manager runbooks for remediating common issues with AWS resources. You can execute a runbook against all of the applicable resources in an application without having to leave Application Manager. Is there a charge to use Application Manager? Application Manager is available at no additional charge. What are the resource quotas for Application Manager? You can view quotas for all Systems Manager tools in the Systems Manager service quotas in the Amazon Web Services General Reference. Unless otherwise noted, each quota is Region specific. Topics • Setting up related services • Configuring permissions for Systems Manager Application Manager • Adding applications and container clusters to Application Manager • Working with applications Application Manager 1947 AWS Systems Manager Setting up related services User Guide Application Manager, a tool in AWS Systems Manager, displays resources and information from other AWS services and Systems Manager tools. To maximize the amount of operations information displayed in Application Manager, we recommend that you set up and configure these other services or tools before you use Application Manager. Topics • Set up tasks for importing resources • Set up tasks for viewing operations information about resources Set up tasks for importing resources The following setup tasks help you view AWS resources in Application Manager. After each of these tasks is completed, Systems Manager can automatically import resources into Application Manager. After your resources are imported, you can create applications in Application Manager and move your imported resources into them. This helps you view operations information in the context of an application. (Optional) Organize your AWS resources by using tags You can assign metadata to your AWS resources in the form of tags. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources. You can create tags to categorize resources by purpose, owner, environment, or other criteria. (Optional) Organizes your AWS resources by using AWS Resource Groups You can use resource groups to organize your AWS resources. Resource groups
|
systems-manager-ug-563
|
systems-manager-ug.pdf
| 563 |
and move your imported resources into them. This helps you view operations information in the context of an application. (Optional) Organize your AWS resources by using tags You can assign metadata to your AWS resources in the form of tags. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources. You can create tags to categorize resources by purpose, owner, environment, or other criteria. (Optional) Organizes your AWS resources by using AWS Resource Groups You can use resource groups to organize your AWS resources. Resource groups make it easier to manage, monitor, and automate tasks on many resources at one time. Application Manager automatically imports all of your resource groups and lists them in the Custom applications category. (Optional) Set up and deploy your AWS resources by using AWS CloudFormation AWS CloudFormation allows you to create and provision AWS infrastructure deployments predictably and repeatedly. It helps you use AWS services such as Amazon EC2, Amazon Elastic Block Store (Amazon EBS), Amazon Simple Notification Service (Amazon SNS), Elastic Load Balancing, and AWS Auto Scaling. With CloudFormation, you can build reliable, scalable, Application Manager 1948 AWS Systems Manager User Guide cost-effective applications in the cloud without worrying about creating and configuring the underlying AWS infrastructure. Application Manager automatically imports all of your AWS CloudFormation resources and lists them in the AWS CloudFormation stacks category. You can create CloudFormation stacks and templates in Application Manager. Stack and template changes are automatically synchronized between Application Manager and CloudFormation. You can also create applications in Application Manager and move stacks into them. This helps you view operations information for resources in your stacks in the context of an application. For pricing information, see AWS CloudFormation Pricing. (Optional) Set up and deploy your applications by using AWS Launch Wizard Launch Wizard guides you through the process of sizing, configuring, and deploying AWS resources for third-party applications without the need to manually identify and provision individual AWS resources. Application Manager automatically imports all of your Launch Wizard resources and lists them in the Launch Wizard category. For more information about AWS Launch Wizard, see Getting started with AWS Launch Wizard for SQL Server. Launch Wizard is available at no additional charge. You only pay for the AWS resources that you provision to run your solution. (Optional) Set up and deploy your containerized applications by using Amazon ECS and Amazon EKS Amazon Elastic Container Service (Amazon ECS) is a highly scalable, fast container management service that makes it easy to run, stop, and manage containers on a cluster. Your containers are defined in a task definition that you use to run individual tasks or tasks within a service. Amazon EKS is a managed service that helps you to run Kubernetes on AWS without needing to install, operate, and maintain your own Kubernetes control plane or nodes. Kubernetes is an open-source system for automating the deployment, scaling, and management of containerized applications. Application Manager automatically imports all of your Amazon ECS and Amazon EKS infrastructure resources and lists them on the Container clusters tab. However, you can't manage or view operations information about your Amazon EKS pods or containers in Application Manager. You can only manage and view operations information about the infrastructure that is hosting your Amazon EKS resources. For pricing information, see Amazon ECS Pricing and Amazon EKS Pricing. Application Manager 1949 AWS Systems Manager User Guide Set up tasks for viewing operations information about resources The following setup tasks help you view operations information about your AWS resources in Application Manager. (Recommended) Verify runbook permissions You can remediate issues with AWS resources from Application Manager by using Systems Manager Automation runbooks. To use this remediation tool, you must configure or verify permissions. For pricing information, see AWS Systems Manager Pricing. (Optional) Enable Cost Explorer AWS Cost Explorer is a feature of AWS Cost Management that you can use to visualize your cost data for further analysis. When you enable Cost Explorer, you can view cost information, cost history, and cost optimization for your application's resources in the Application Manager console. (Optional) Set up and configure Amazon CloudWatch logs and alarms CloudWatch is a monitoring and management service that provides data and actionable insights for AWS, hybrid, and multicloud applications and infrastructure resources. With CloudWatch, you can collect and access all your performance and operational data in the form of logs and metrics from a single platform. To view CloudWatch logs and alarms for your resources in Application Manager, you must set up and configure CloudWatch. For pricing information, see CloudWatch Pricing. Note CloudWatch Logs support applies to applications only, not to clusters. (Optional) Set up and configure AWS Config AWS Config provides a detailed view of the resources associated with your AWS
|
systems-manager-ug-564
|
systems-manager-ug.pdf
| 564 |
a monitoring and management service that provides data and actionable insights for AWS, hybrid, and multicloud applications and infrastructure resources. With CloudWatch, you can collect and access all your performance and operational data in the form of logs and metrics from a single platform. To view CloudWatch logs and alarms for your resources in Application Manager, you must set up and configure CloudWatch. For pricing information, see CloudWatch Pricing. Note CloudWatch Logs support applies to applications only, not to clusters. (Optional) Set up and configure AWS Config AWS Config provides a detailed view of the resources associated with your AWS account, including how they're configured, how they're related to one another, and how the configurations and their relationships have changed over time. You can use AWS Config to evaluate the configuration settings of your AWS resources. You do this by creating AWS Config rules, which represent your ideal configuration settings. While AWS Config continually tracks the configuration changes that occur among your resources, it checks whether these changes violate any of the conditions in your rules. If a resource violates a rule, AWS Config Application Manager 1950 AWS Systems Manager User Guide flags the resource and the rule as noncompliant. Application Manager displays compliance information about AWS Config rules. To view this data in Application Manager, you must set up and configure AWS Config. For pricing information, see AWS Config Pricing. (Optional) Create State Manager associations You can use Systems Manager State Manager to create a configuration that you assign to your managed nodes. The configuration, called an association, defines the state that you want to maintain on your nodes. To view association compliance data in Application Manager, you must configure one or more State Manager associations. State Manager is offered at no additional charge. (Optional) Set up and configure OpsCenter You can view operational work items (OpsItems) about your resources in Application Manager by using OpsCenter. You can configure Amazon CloudWatch and Amazon EventBridge to automatically send OpsItems to OpsCenter based on alarms and events. You can also enter OpsItems manually. For pricing information, see AWS Systems Manager Pricing. Configuring permissions for Systems Manager Application Manager You can use all features of Application Manager, a tool in AWS Systems Manager, if your AWS Identity and Access Management (IAM) entity (such as a user, group, or role) has access to the API operations listed in this topic. The API operations are separated into two tables to help you understand the different functions they perform. The following table lists the API operations that Systems Manager calls if you choose a resource in Application Manager because you want to view the resource details. For example, if Application Manager lists an Amazon EC2 Auto Scaling group, and if you choose that group to view its details, then Systems Manager calls the autoscaling:DescribeAutoScalingGroups API operations. If you don't have any Auto Scaling groups in your account, this API operation isn't called from Application Manager. Resource details only acm:DescribeCertificate acm:ListTagsForCertificate autoscaling:DescribeAutoScalingGroups cloudfront:GetDistribution cloudfront:ListTagsForResource Application Manager 1951 User Guide AWS Systems Manager Resource details only cloudtrail:DescribeTrails cloudtrail:ListTags cloudtrail:LookupEvents codebuild:BatchGetProjects codepipeline:GetPipeline codepipeline:ListTagsForResource dynamodb:DescribeTable dynamodb:ListTagsOfResource ec2:DescribeAddresses ec2:DescribeCustomerGateways ec2:DescribeHosts ec2:DescribeInternetGateways ec2:DescribeNetworkAcls ec2:DescribeNetworkInterfaces ec2:DescribeRouteTables ec2:DescribeSecurityGroups ec2:DescribeSubnets ec2:DescribeVolumes ec2:DescribeVpcs ec2:DescribeVpnConnections ec2:DescribeVpnGateways elasticbeanstalk:DescribeApplications elasticbeanstalk:ListTagsForResource elasticloadbalancing:DescribeInstanceHealth elasticloadbalancing:DescribeListeners elasticloadbalancing:DescribeLoadBalancers elasticloadbalancing:DescribeTags iam:GetGroup iam:GetPolicy iam:GetRole iam:GetUser lambda:GetFunction rds:DescribeDBClusters rds:DescribeDBInstances rds:DescribeDBSecurityGroups rds:DescribeDBSnapshots rds:DescribeDBSubnetGroups rds:DescribeEventSubscriptions rds:ListTagsForResource redshift:DescribeClusterParameters redshift:DescribeClusterSecurityGroups redshift:DescribeClusterSnapshots Application Manager 1952 AWS Systems Manager Resource details only redshift:DescribeClusterSubnetGroups redshift:DescribeClusters s3:GetBucketTagging User Guide The following table lists the API operations that Systems Manager uses to make changes to applications and resources listed in Application Manager or to view operations information for a selected application or resource. Application actions and details applicationinsights:CreateApplication applicationinsights:DescribeApplication applicationinsights:ListProblems ce:GetCostAndUsage ce:GetTags ce:ListCostAllocationTags ce:UpdateCostAllocationTagsStatus cloudformation:CreateStack cloudformation:DeleteStack cloudformation:DescribeStackDriftDetectionStatus cloudformation:DescribeStackEvents cloudformation:DescribeStacks cloudformation:DetectStackDrift cloudformation:GetTemplate cloudformation:GetTemplateSummary cloudformation:ListStacks cloudformation:UpdateStack cloudwatch:DescribeAlarms cloudwatch:DescribeInsightRules cloudwatch:DisableAlarmActions cloudwatch:EnableAlarmActions cloudwatch:GetMetricData cloudwatch:ListTagsForResource cloudwatch:PutMetricAlarm config:DescribeComplianceByConfigRule config:DescribeComplianceByResource config:DescribeConfigRules config:DescribeRemediationConfigurations Application Manager 1953 AWS Systems Manager User Guide Application actions and details config:GetComplianceDetailsByConfigRule config:GetComplianceDetailsByResource config:GetResourceConfigHistory config:ListDiscoveredResources config:PutRemediationConfigurations config:SelectResourceConfig config:StartConfigRulesEvaluation config:StartRemediationExecution ec2:DescribeInstances ecs:DescribeCapacityProviders ecs:DescribeClusters ecs:DescribeContainerInstances ecs:ListClusters ecs:ListContainerInstances ecs:TagResource eks:DescribeCluster eks:DescribeFargateProfile eks:DescribeNodegroup eks:ListClusters eks:ListFargateProfiles eks:ListNodegroups eks:TagResource iam:CreateServiceLinkedRole iam:ListRoles logs:DescribeLogGroups resource-groups:CreateGroup resource-groups:DeleteGroup resource-groups:GetGroup resource-groups:GetGroupQuery resource-groups:GetTags resource-groups:ListGroupResources resource-groups:ListGroups resource-groups:Tag resource-groups:Untag resource-groups:UpdateGroup s3:ListAllMyBuckets s3:ListBucket s3:ListBucketVersions servicecatalog:GetApplication servicecatalog:ListApplications sns:CreateTopic sns:ListSubscriptionsByTopic Application Manager 1954 AWS Systems Manager User Guide Application actions and details sns:ListTopics sns:Subscribe ssm:AddTagsToResource ssm:CreateDocument ssm:CreateOpsMetadata ssm:DeleteDocument ssm:DeleteOpsMetadata ssm:DescribeAssociation ssm:DescribeAutomationExecutions ssm:DescribeDocument ssm:DescribeDocumentPermission ssm:GetDocument ssm:GetInventory ssm:GetOpsMetadata ssm:GetOpsSummary ssm:GetServiceSetting ssm:ListAssociations ssm:ListComplianceItems ssm:ListDocuments ssm:ListDocumentVersions ssm:ListOpsMetadata ssm:ListResourceComplianceSummaries ssm:ListTagsForResource ssm:ModifyDocumentPermission ssm:RemoveTagsFromResource ssm:StartAssociationsOnce ssm:StartAutomationExecution ssm:UpdateDocument ssm:UpdateDocumentDefaultVersion ssm:UpdateOpsItem ssm:UpdateOpsMetadata ssm:UpdateServiceSetting tag:GetTagKeys tag:GetTagValues tag:TagResources tag:UntagResources Application Manager 1955 AWS Systems Manager User Guide Example policy for all Application Manager permissions To configure Application Manager permissions for an IAM entity (such as a user, group, or role), create an IAM policy using the following example. This policy example includes all API operations used by Application Manager. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "acm:DescribeCertificate", "acm:ListTagsForCertificate", "applicationinsights:CreateApplication", "applicationinsights:DescribeApplication", "applicationinsights:ListProblems", "autoscaling:DescribeAutoScalingGroups", "ce:GetCostAndUsage", "ce:GetTags",
|
systems-manager-ug-565
|
systems-manager-ug.pdf
| 565 |
ssm:CreateOpsMetadata ssm:DeleteDocument ssm:DeleteOpsMetadata ssm:DescribeAssociation ssm:DescribeAutomationExecutions ssm:DescribeDocument ssm:DescribeDocumentPermission ssm:GetDocument ssm:GetInventory ssm:GetOpsMetadata ssm:GetOpsSummary ssm:GetServiceSetting ssm:ListAssociations ssm:ListComplianceItems ssm:ListDocuments ssm:ListDocumentVersions ssm:ListOpsMetadata ssm:ListResourceComplianceSummaries ssm:ListTagsForResource ssm:ModifyDocumentPermission ssm:RemoveTagsFromResource ssm:StartAssociationsOnce ssm:StartAutomationExecution ssm:UpdateDocument ssm:UpdateDocumentDefaultVersion ssm:UpdateOpsItem ssm:UpdateOpsMetadata ssm:UpdateServiceSetting tag:GetTagKeys tag:GetTagValues tag:TagResources tag:UntagResources Application Manager 1955 AWS Systems Manager User Guide Example policy for all Application Manager permissions To configure Application Manager permissions for an IAM entity (such as a user, group, or role), create an IAM policy using the following example. This policy example includes all API operations used by Application Manager. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "acm:DescribeCertificate", "acm:ListTagsForCertificate", "applicationinsights:CreateApplication", "applicationinsights:DescribeApplication", "applicationinsights:ListProblems", "autoscaling:DescribeAutoScalingGroups", "ce:GetCostAndUsage", "ce:GetTags", "ce:ListCostAllocationTags", "ce:UpdateCostAllocationTagsStatus", "cloudformation:CreateStack", "cloudformation:DeleteStack", "cloudformation:DescribeStackDriftDetectionStatus", "cloudformation:DescribeStackEvents", "cloudformation:DescribeStacks", "cloudformation:DetectStackDrift", "cloudformation:GetTemplate", "cloudformation:GetTemplateSummary", "cloudformation:ListStacks", "cloudformation:ListStackResources", "cloudformation:UpdateStack", "cloudfront:GetDistribution", "cloudfront:ListTagsForResource", "cloudtrail:DescribeTrails", "cloudtrail:ListTags", "cloudtrail:LookupEvents", "cloudwatch:DescribeAlarms", "cloudwatch:DescribeInsightRules", "cloudwatch:DisableAlarmActions", "cloudwatch:EnableAlarmActions", Application Manager 1956 AWS Systems Manager User Guide "cloudwatch:GetMetricData", "cloudwatch:ListTagsForResource", "cloudwatch:PutMetricAlarm", "codebuild:BatchGetProjects", "codepipeline:GetPipeline", "codepipeline:ListTagsForResource", "config:DescribeComplianceByConfigRule", "config:DescribeComplianceByResource", "config:DescribeConfigRules", "config:DescribeRemediationConfigurations", "config:GetComplianceDetailsByConfigRule", "config:GetComplianceDetailsByResource", "config:GetResourceConfigHistory", "config:ListDiscoveredResources", "config:PutRemediationConfigurations", "config:SelectResourceConfig", "config:StartConfigRulesEvaluation", "config:StartRemediationExecution", "dynamodb:DescribeTable", "dynamodb:ListTagsOfResource", "ec2:DescribeAddresses", "ec2:DescribeCustomerGateways", "ec2:DescribeHosts", "ec2:DescribeInstances", "ec2:DescribeInternetGateways", "ec2:DescribeNetworkAcls", "ec2:DescribeNetworkInterfaces", "ec2:DescribeRouteTables", "ec2:DescribeSecurityGroups", "ec2:DescribeSubnets", "ec2:DescribeVolumes", "ec2:DescribeVpcs", "ec2:DescribeVpnConnections", "ec2:DescribeVpnGateways", "ecs:DescribeCapacityProviders", "ecs:DescribeClusters", "ecs:DescribeContainerInstances", "ecs:ListClusters", "ecs:ListContainerInstances", "ecs:TagResource", "eks:DescribeCluster", "eks:DescribeFargateProfile", "eks:DescribeNodegroup", "eks:ListClusters", Application Manager 1957 AWS Systems Manager User Guide "eks:ListFargateProfiles", "eks:ListNodegroups", "eks:TagResource", "elasticbeanstalk:DescribeApplications", "elasticbeanstalk:ListTagsForResource", "elasticloadbalancing:DescribeInstanceHealth", "elasticloadbalancing:DescribeListeners", "elasticloadbalancing:DescribeLoadBalancers", "elasticloadbalancing:DescribeTags", "iam:CreateServiceLinkedRole", "iam:GetGroup", "iam:GetPolicy", "iam:GetRole", "iam:GetUser", "iam:ListRoles", "lambda:GetFunction", "logs:DescribeLogGroups", "rds:DescribeDBClusters", "rds:DescribeDBInstances", "rds:DescribeDBSecurityGroups", "rds:DescribeDBSnapshots", "rds:DescribeDBSubnetGroups", "rds:DescribeEventSubscriptions", "rds:ListTagsForResource", "redshift:DescribeClusterParameters", "redshift:DescribeClusters", "redshift:DescribeClusterSecurityGroups", "redshift:DescribeClusterSnapshots", "redshift:DescribeClusterSubnetGroups", "resource-groups:CreateGroup", "resource-groups:DeleteGroup", "resource-groups:GetGroup", "resource-groups:GetGroupQuery", "resource-groups:GetTags", "resource-groups:ListGroupResources", "resource-groups:ListGroups", "resource-groups:Tag", "resource-groups:Untag", "resource-groups:UpdateGroup", "s3:GetBucketTagging", "s3:ListAllMyBuckets", "s3:ListBucket", "s3:ListBucketVersions", "servicecatalog:GetApplication", Application Manager 1958 AWS Systems Manager User Guide "servicecatalog:ListApplications", "sns:CreateTopic", "sns:ListSubscriptionsByTopic", "sns:ListTopics", "sns:Subscribe", "ssm:AddTagsToResource", "ssm:CreateDocument", "ssm:CreateOpsMetadata", "ssm:DeleteDocument", "ssm:DeleteOpsMetadata", "ssm:DescribeAssociation", "ssm:DescribeAutomationExecutions", "ssm:DescribeDocument", "ssm:DescribeDocumentPermission", "ssm:GetDocument", "ssm:GetInventory", "ssm:GetOpsMetadata", "ssm:GetOpsSummary", "ssm:GetServiceSetting", "ssm:ListAssociations", "ssm:ListComplianceItems", "ssm:ListDocuments", "ssm:ListDocumentVersions", "ssm:ListOpsMetadata", "ssm:ListResourceComplianceSummaries", "ssm:ListTagsForResource", "ssm:ModifyDocumentPermission", "ssm:RemoveTagsFromResource", "ssm:StartAssociationsOnce", "ssm:StartAutomationExecution", "ssm:UpdateDocument", "ssm:UpdateDocumentDefaultVersion", "ssm:UpdateOpsMetadata", "ssm:UpdateOpsItem", "ssm:UpdateServiceSetting", "tag:GetResources", "tag:GetTagKeys", "tag:GetTagValues", "tag:TagResources", "tag:UntagResources" ], "Resource": "*" } ] Application Manager 1959 AWS Systems Manager } Note User Guide You can restrict a user's ability to make changes to applications and resources in Application Manager by removing the following API operations from the IAM permissions policy attached to their user, group, or role. Removing these actions creates a read-only experience in Application Manager. The following are all of the APIs that allow users to make changes to the application or any other related resources. applicationinsights:CreateApplication ce:UpdateCostAllocationTagsStatus cloudformation:CreateStack cloudformation:DeleteStack cloudformation:UpdateStack cloudwatch:DisableAlarmActions cloudwatch:EnableAlarmActions cloudwatch:PutMetricAlarm config:PutRemediationConfigurations config:StartConfigRulesEvaluation config:StartRemediationExecution ecs:TagResource eks:TagResource iam:CreateServiceLinkedRole resource-groups:CreateGroup resource-groups:DeleteGroup resource-groups:Tag resource-groups:Untag resource-groups:UpdateGroup sns:CreateTopic sns:Subscribe ssm:AddTagsToResource ssm:CreateDocument ssm:CreateOpsMetadata ssm:DeleteDocument ssm:DeleteOpsMetadata ssm:ModifyDocumentPermission ssm:RemoveTagsFromResource ssm:StartAssociationsOnce ssm:StartAutomationExecution ssm:UpdateDocument Application Manager 1960 AWS Systems Manager User Guide ssm:UpdateDocumentDefaultVersion ssm:UpdateOpsMetadata ssm:UpdateOpsItem ssm:UpdateServiceSetting tag:TagResources tag:UntagResources For information about creating and editing IAM policies, see Creating IAM Policies in the IAM User Guide. For information about how to assign this policy to an IAM entity (such as a user, group, or role), see Adding and removing IAM identity permissions. Adding applications and container clusters to Application Manager Application Manager is a component of AWS Systems Manager. In Application Manager, an application is a logical group of AWS resources that you want to operate as a unit. This logical group can represent different versions of an application, ownership boundaries for operators, or developer environments, to name a few. The first time you open Application Manager, the What Application Manager can do for you page displays. When you choose Get started, Application Manager automatically imports metadata about your resources that were created in other AWS services or Systems Manager tools. Application Manager then displays those resources in a list grouped by predefined categories. For Applications, the list includes the following: • AWS CloudFormation stacks • Custom applications • AWS Launch Wizard applications • AppRegistry applications • AWS SAP Enterprise Workload applications • Amazon ECS clusters • Amazon EKS clusters After import is complete, you can view operations information for an application or a specific resource in these predefined categories. Or, if you want to provide more context about a collection of resources, you can manually create an application in Application Manager. You can then Application Manager 1961 AWS Systems Manager User Guide add resources or groups of resources into that application. After you create an application in Application Manager, you can view operations information about your resource in the context of an application. Creating an application in Application Manager Use the following procedure to create an application in Application Manager and add resources to that application. To create an application in Application Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Application Manager. 3. Choose choose Create application. 4. Choose an option from the drop-down list and complete the fields in the page that appears. Working with applications Application Manager is a component of AWS Systems Manager. This section includes topics to help you work with Application Manager applications and view operations information about your AWS resources. Contents • Application overview in Application Manager • Managing your application EC2 instances • Viewing resources associated with your application • Managing your application
|
systems-manager-ug-566
|
systems-manager-ug.pdf
| 566 |
application in Application Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Application Manager. 3. Choose choose Create application. 4. Choose an option from the drop-down list and complete the fields in the page that appears. Working with applications Application Manager is a component of AWS Systems Manager. This section includes topics to help you work with Application Manager applications and view operations information about your AWS resources. Contents • Application overview in Application Manager • Managing your application EC2 instances • Viewing resources associated with your application • Managing your application compliance • Using CloudWatch Application Insights to monitor an application • Viewing OpsItems for an application • Managing your application logs • Use Automation runbooks to remediate application issues • Tag resources in Application Manager • Working with AWS CloudFormation templates and stacks in Application Manager • Working with clusters in Application Manager Application Manager 1962 AWS Systems Manager User Guide Application overview in Application Manager In Application Manager, a component of AWS Systems Manager, the Overview tab displays a summary of Amazon CloudWatch alarms, operational work items (OpsItems), CloudWatch Application Insights, and runbook history. Choose View all for any card to open the corresponding tab where you can view all application insights, alarms, OpsItems, or runbook history. About Application Insights CloudWatch Application Insights identifies and sets up key metrics, logs, and alarms across your application resources and technology stack. Application Insights continuously monitors metrics and logs to detect and correlate anomalies and errors. When the system detects errors or anomalies, Application Insights generates CloudWatch Events that you can use to set up notifications or take actions. If you choose the Edit configuration button on the Monitoring tab, the system opens the CloudWatch Application Insights console. For more information about Application Insights, see What is Amazon CloudWatch Application Insights in the Amazon CloudWatch User Guide. About Cost Explorer Application Manager is integrated with AWS Cost Explorer, a feature of AWS Cost Management, through the Cost widget and Cost tab. After you enable Cost Explorer in the Cost Management console, the Cost widget and Cost tab in Application Manager shows cost data for a specific non- container application or application component. You can use filters in the widget, or tab, to view cost data according to different time periods, levels of granularity, and cost types in either a bar or line chart. You can enable this feature by choosing the Go to AWS Cost Management console button. By default, the data is filtered to the past three months. For a non-container application, if you choose the View all button, Application Manager opens the Resources tab. For container applications, the View all button opens the AWS Cost Explorer console. Actions you can perform on this page You can turn on and access information about the following widgets on the Overview tab on this page. When a widget is enabled, choose its View all to see relevant application details for that area. • In the Insights and Alarms section, choose the number for a severity to open the Monitoring, tab, where you can view more details about alarms of the chosen severity. Application Manager 1963 AWS Systems Manager User Guide • In the Cost section, choose View all to open the Resources tab, where you can view cost data for a specific application or application component. • In the Compliance section, choose View all to open the Compliance tab, where you can view compliance information from AWS Config and State Manager associations. Note To view patch compliance details, choose the Compliance tab directly. Then you can view patch compliance details for the managed nodes used by the selected application. • In the Runbooks section, choose a runbook to open it in the Systems Manager Documents page where you can view more details about the document. • In the OpsItems section, choose a severity to open the OpsItems tab where you can view all OpsItems of the chosen severity. • Choose a View all button to open the corresponding tab. You can view all alarms, OpsItems, or runbook history entries for the application. To open the Overview tab 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. Managing your application EC2 instances Application Manager integrates with Amazon Elastic Compute Cloud (Amazon EC2) to display information about your instances in the context of an application. Application Manager displays instance state, status, and Amazon EC2 Auto Scaling health for a selected application in a graphical format. The Instances tab also
|
systems-manager-ug-567
|
systems-manager-ug.pdf
| 567 |
console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. Managing your application EC2 instances Application Manager integrates with Amazon Elastic Compute Cloud (Amazon EC2) to display information about your instances in the context of an application. Application Manager displays instance state, status, and Amazon EC2 Auto Scaling health for a selected application in a graphical format. The Instances tab also includes a table with the following information for each instance in your application: • Instance state (Pending, Stopping, Running, Stopped) • Ping status for SSM Agent Application Manager 1964 AWS Systems Manager User Guide • Status and name of the most recent Systems Manager Automation runbook processed on the instance • A count of Amazon CloudWatch Logs alarms per state. • ALARM – The metric or expression is outside of the defined threshold. • OK – The metric or expression is within the defined threshold. • INSUFFICIENT_DATA – The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state. • Auto Scaling group health for the parent and individual autoscaling groups If you choose an instance in the All instances table, Application Manager displays information about that instance on four tabs: • Details – All of the instance details from Amazon EC2, including the Amazon Machine Image (AMI), DNS information, IP address information, and more. • Health – The current status as provided by EC2 system and instance status checks. • Execution history – Execution logs for Systems Manager Automation runbooks and API calls processed by the instance. • CloudWatch alarms – The name, state, and more for any CloudWatch alarms raised by the instance. Actions you can perform on this page You can perform the following actions on this page: • Start, stop, and terminate instances. • Apply a Chef recipe. • Attach instances to, or detach instances from, an Auto Scaling group. • Enable automated updates for SSM Agent. To open the Instances tab 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Application Manager. Application Manager 1965 AWS Systems Manager User Guide 3. In the Applications section, choose a category. If you want to open an application that you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. Choose the Instances tab. To view details for your application instances 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application that you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. Choose the Instances tab. 6. Select the button next to the instance whose details you want to view. 7. Review the instance details at the bottom of the page. To automatically update SSM Agent 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application that you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. Choose the Instances tab. 6. In the Agent actions dropdown, choose Configure SSM Agent update. 7. Choose All instances to configure automatic SSM Agent updates for all managed instances. Alternatively, choose Instance to configure automation SSM Agent updates for a single instance in your application. 8. 9. Select the Enable automatic update toggle. In the Specify schedule dropdown, choose the schedule you want to use for SSM Agent updates. Application Manager 1966 AWS Systems Manager 10. Select Configure. User Guide Viewing resources associated with your application In Application Manager, a component of AWS Systems Manager, the Resources tab displays the AWS resources in your application. If you choose a top-level component, this page displays all resources for that component and any subcomponents. If you choose a subcomponent, this page shows only the resources assigned to that subcomponent. Actions you can perform on this page You can perform the following actions on this page: • Choose a resource name to view information about it, including details provided by the console where it was created, tags, Amazon CloudWatch alarms, AWS Config details, and AWS CloudTrail log information. • Choose the option button beside a resource name. Then, choose the Resource timeline button to open the AWS Config console where
|
systems-manager-ug-568
|
systems-manager-ug.pdf
| 568 |
choose a top-level component, this page displays all resources for that component and any subcomponents. If you choose a subcomponent, this page shows only the resources assigned to that subcomponent. Actions you can perform on this page You can perform the following actions on this page: • Choose a resource name to view information about it, including details provided by the console where it was created, tags, Amazon CloudWatch alarms, AWS Config details, and AWS CloudTrail log information. • Choose the option button beside a resource name. Then, choose the Resource timeline button to open the AWS Config console where you can view compliance information about a selected resource. • If you enabled AWS Cost Explorer, the Cost Explorer section shows cost data for a specific non-container application or application component. You can enable this feature by choosing the Go to AWS Cost Management console button. Use the filters in this section to view cost information about your application. To open the Resources tab 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. Choose the Resources tab. Application Manager 1967 AWS Systems Manager User Guide Managing your application compliance In Application Manager, a component of AWS Systems Manager, the Configurations page displays AWS Config resource and configuration rule compliance information. This page also displays AWS Systems Manager State Manager association compliance information. You can choose a resource, a rule, or an association to open the corresponding console for more information. This page displays compliance information from the last 90 days. Actions you can perform on this page You can perform the following actions on this page: • Choose a resource name to open the AWS Config console where you can view compliance information about a selected resource. • Choose the option button beside a resource name. Then, choose the Resource timeline button to open the AWS Config console where you can view compliance information about a selected resource. • In the Config rules compliance section, you can do the following: • Choose a rule name to open the AWS Config console where you can view information about that rule. • Choose Add rules to open the AWS Config console where you can create a rule. • Choose the option button beside a rule name, choose Actions, and then choose Manage remediation to change the remediation action for a rule. • Choose the option button beside a rule name, choose Actions, and then choose Re-evaluate to have AWS Config run a compliance check on the selected rule. • In the Association compliance section, you can do the following: • Choose an association name to open the Associations page where you can view information about that association. • Choose Create association to open Systems Manager State Manager where you can create an association. • Choose the option button beside an association name and choose Apply association to immediately start all actions specified in the association. Application Manager 1968 AWS Systems Manager To open the Compliance tab User Guide 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. Choose the Compliance tab. Using CloudWatch Application Insights to monitor an application In Application Manager, a component of AWS Systems Manager, the Monitoring tab displays Amazon CloudWatch Application Insights and alarm details for resources in an application. About Application Insights CloudWatch Application Insights identifies and sets up key metrics, logs, and alarms across your application resources and technology stack. Application Insights continuously monitors metrics and logs to detect and correlate anomalies and errors. When the system detects errors or anomalies, Application Insights generates CloudWatch Events that you can use to set up notifications or take actions. If you choose the Edit configuration button on the Monitoring tab, the system opens the CloudWatch Application Insights console. For more information about Application Insights, see What is Amazon CloudWatch Application Insights in the Amazon CloudWatch User Guide. Actions you can perform on this page You can perform the following actions on this page: • Choose a service name in the Alarms by AWS service section to open CloudWatch to the selected service and alarm. • Adjust the time period for data displayed in widgets in the Recent alarms section by selecting one of the predefined time period values. You can choose custom to define
|
systems-manager-ug-569
|
systems-manager-ug.pdf
| 569 |
configuration button on the Monitoring tab, the system opens the CloudWatch Application Insights console. For more information about Application Insights, see What is Amazon CloudWatch Application Insights in the Amazon CloudWatch User Guide. Actions you can perform on this page You can perform the following actions on this page: • Choose a service name in the Alarms by AWS service section to open CloudWatch to the selected service and alarm. • Adjust the time period for data displayed in widgets in the Recent alarms section by selecting one of the predefined time period values. You can choose custom to define your own time period. Application Manager 1969 AWS Systems Manager User Guide • Hover your cursor over a widget in the Recent alarms section to view a data pop-up for a specific time. • Choose the options menu in a widget to view display options. Choose Enlarge to expand a widget. Choose Refresh to update the data in a widget. Click and drag your cursor in a widget data display to select a specific range. You can then choose Apply time range. • Choose the Actions menu to view alarm data Override options, which include the following: • Choose whether your widget displays live data. Live data is data published within the last minute that hasn't been fully aggregated. If live data is turned off, only data points with an aggregation period of at least one minute in the past are shown. For example, when using Application Manager 1970 AWS Systems Manager User Guide 5-minute periods, the data point for 12:35 would be aggregated from 12:35 to 12:40, and displayed at 12:41. If live data is turned on, the most recent data point is shown as soon as any data is published in the corresponding aggregation interval. Each time you refresh the display, the most recent data point might change as new data within that aggregation period is published. • Specify a time period for live data. • Link the charts in the Recent alarms section, so that when you zoom in or zoom out on one chart, the other chart zooms in or zooms out at the same time. You can unlink charts to limit zoom to one chart. • Hide Auto Scaling alarms. To open the Monitoring tab 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. Choose the Monitoring tab. Application Manager 1971 AWS Systems Manager User Guide Viewing OpsItems for an application In Application Manager, a component of AWS Systems Manager, the OpsItems tab displays operational work items (OpsItems) for resources in the selected application. You can configure Systems Manager OpsCenter to automatically create OpsItems from Amazon CloudWatch alarms and Amazon EventBridge events. You can also manually create OpsItems. Actions you can perform on this tab You can perform the following actions on this page: • Filter the list of OpsItems by using the search field. You can filter by OpsItem name, ID, source ID, or severity. You can also filter the list based on status. OpsItems support the following statuses: Open, In progress, Open and In progress, Resolved, or All. • Change the status of an OpsItem by choosing the option button beside it and then choosing an option in the Set status menu. • Open Systems Manager OpsCenter to create an OpsItem by choosing Create OpsItem. To open the OpsItems tab 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. Choose the OpsItems tab. Managing your application logs In Application Manager, a component of AWS Systems Manager, the Logs tab displays a list of log groups from Amazon CloudWatch Logs. Actions you can perform on this tab You can perform the following actions on this page: Application Manager 1972 AWS Systems Manager User Guide • Choose a log group name to open it in CloudWatch Logs. You can then choose a log stream to view logs for a resource in the context of an application. • Choose Create log groups to create a log group in CloudWatch Logs. To open the Logs tab 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in
|
systems-manager-ug-570
|
systems-manager-ug.pdf
| 570 |
the following actions on this page: Application Manager 1972 AWS Systems Manager User Guide • Choose a log group name to open it in CloudWatch Logs. You can then choose a log stream to view logs for a resource in the context of an application. • Choose Create log groups to create a log group in CloudWatch Logs. To open the Logs tab 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. Choose the Logs tab. Use Automation runbooks to remediate application issues You can remediate issues with AWS resources from Application Manager, a tool in AWS Systems Manager, by using Automation runbooks. An Automation runbook defines the actions that Systems Manager performs on your managed instances and other AWS resources when an automation runs. Automation is a tool in AWS Systems Manager. A runbook contains one or more steps that run in sequential order. Each step is built around a single action. Output from one step can be used as input in a later step. When you choose Start runbook from an Application Manager application or cluster, the system displays a filtered list of available runbooks based on the type of resources in your application or cluster. When you choose the runbook you want to start, Systems Manager opens the Execute automation document page. Application Manager includes the following enhancements for working with runbooks. • If you choose the name of a resource in Application Manager and then choose Execute runbook, the system displays a filtered list of runbooks for that resource type. • You can initiate an automation on all resources of the same type by choosing a runbook in the list and then choosing Run for resources of same type. Before you begin Application Manager 1973 AWS Systems Manager User Guide Before you start a runbook from Application Manager, do the following: • Verify that you have the correct permissions for starting runbooks. For more information, see Setting up Automation. • Review the Automation procedure documentation about starting runbooks. For more information, see Run an automated operation powered by Systems Manager Automation. To start a runbook from Application Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. Choose Start runbook. Application Manager opens the Automation widget pop up. For information about the options in the Automation widget, see Run an automated operation powered by Systems Manager Automation. Tag resources in Application Manager You can quickly add or delete tags on applications and AWS resources in Application Manager. Use the following procedure to add a tag to or delete a tag from an application and all AWS resources in that application. To add a tag to or delete a tag from an application and all resources in the application 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. In the Application information section, choose the number beneath Application tags. If no tags are assigned to the application, the number is zero. Application Manager 1974 AWS Systems Manager User Guide 6. To add a tag, choose Add new tag. Specify a key and an optional value. To delete a tag, choose Remove. 7. Choose Save. Use the following procedure to add a tag to or delete a tag from a specific resource in Application Manager. To add a tag to or delete a tag from a resource 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. Choose the Resources tab. 6. Choose a resource name. 7. 8. In the Tags section choose Edit. To add a tag, choose Add new tag. Specify a key and an optional value. To delete a tag, choose Remove. 9. Choose Save. Working with AWS CloudFormation templates and stacks in Application Manager Application Manager, a
|
systems-manager-ug-571
|
systems-manager-ug.pdf
| 571 |
3. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose a category. If you want to open an application you created manually in Application Manager, choose Custom applications. 4. Choose the application in the list. Application Manager opens the Overview tab. 5. Choose the Resources tab. 6. Choose a resource name. 7. 8. In the Tags section choose Edit. To add a tag, choose Add new tag. Specify a key and an optional value. To delete a tag, choose Remove. 9. Choose Save. Working with AWS CloudFormation templates and stacks in Application Manager Application Manager, a tool in AWS Systems Manager, helps you provision and manage resources for your applications by integrating with AWS CloudFormation. You can create, edit, and delete AWS CloudFormation templates and stacks in Application Manager. A stack is a collection of AWS resources that you can manage as a single unit. This means you can create, update, or delete a collection of AWS resources by using CloudFormation stacks. A template is a formatted text file in JSON or YAML that specifies the resources you want to provision in your stacks. Application Manager also includes a template library where you can clone, create, and store templates. Application Manager and CloudFormation display the same information about the current status of a stack. Templates and template updates are stored in Systems Manager until you provision the stack, at which time the changes are also displayed in CloudFormation. Application Manager 1975 AWS Systems Manager User Guide After you create a stack in Application Manager, the CloudFormation stacks page displays helpful information about it. This includes the template used to create it, a count of OpsItems for resources in your stack, the stack status, and drift status. About Cost Explorer Application Manager is integrated with AWS Cost Explorer, a feature of AWS Cost Management, through the Cost widget. After you enable Cost Explorer in the Cost Management console, the Cost widget in Application Manager shows cost data for a specific non-container application or application component. You can use filters in the widget to view cost data according to different time periods, granularities, and cost types in either a bar or line chart. You can enable this feature by choosing the Go to AWS Cost Management console button. By default, the data is filtered to the past three months. For a non-container application, if you choose the View all button, Application Manager opens the Resources tab. For container applications, the View all button opens the AWS Cost Explorer console. Note Cost Explorer uses tags to track your application costs. If your AWS CloudFormation stack-based application isn't configured with the AppManagerCFNStackKey tag key, Cost Explorer fails to present accurate cost data in Application Manager. When the AppManagerCFNStackKey tag key is not detected, you will be prompted in the console to add the tag to your CloudFormation stack to enable cost tracking. Adding it maps the tag key to the Amazon Resource Name (ARN) of your stack and enables the Cost widget to display accurate cost data. Important Adding the AppManagerCFNStackKey tag will trigger a stack update. Any manual configurations that were performed after the stack was originally deployed will not be reflected after the user tag is added. For more information about resource update behaviors, see Update behaviors of stack resources in the AWS CloudFormation User Guide Application Manager 1976 AWS Systems Manager Before you begin User Guide Use the following links to learn about CloudFormation concepts before you create, edit, or delete CloudFormation templates and stacks by using Application Manager. • What is AWS CloudFormation? • AWS CloudFormation best practices • Learn template basics • Working with AWS CloudFormation stacks • Working with AWS CloudFormation templates • Sample templates Topics • Using Application Manager to manage AWS CloudFormation templates • Using Application Manager to manage AWS CloudFormation stacks Using Application Manager to manage AWS CloudFormation templates Application Manager, a tool in AWS Systems Manager, includes a template library and other tools to help you manage AWS CloudFormation templates. This section includes the following information. Topics • Working with the template library • Creating a template • Editing a template Working with the template library The Application Manager template library provides tools to help you view, create, edit, delete, and clone templates. You can also provision stacks directly from the template library. Templates are stored as Systems Manager (SSM) documents of type CloudFormation. By storing templates as SSM documents, you can use version controls to work with different versions of a template. You can also set permissions and share templates. After you successfully provision a stack, the stack and template are available in Application Manager and CloudFormation. Application Manager 1977 AWS Systems Manager Before you begin User Guide We recommend that you read the following topics to learn more
|
systems-manager-ug-572
|
systems-manager-ug.pdf
| 572 |
library provides tools to help you view, create, edit, delete, and clone templates. You can also provision stacks directly from the template library. Templates are stored as Systems Manager (SSM) documents of type CloudFormation. By storing templates as SSM documents, you can use version controls to work with different versions of a template. You can also set permissions and share templates. After you successfully provision a stack, the stack and template are available in Application Manager and CloudFormation. Application Manager 1977 AWS Systems Manager Before you begin User Guide We recommend that you read the following topics to learn more about SSM documents before you start working with CloudFormation templates in Application Manager. • AWS Systems Manager Documents • Sharing SSM documents • Best practices for shared SSM documents To view the template library in Application Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Application Manager. In the Applications section, choose CloudFormation stacks. 4. Choose Template library. Creating a template The following procedure describes how to create a CloudFormation template in Application Manager. When you create a template, you enter the stack details of the template in either JSON or YAML. If you're unfamiliar with JSON or YAML, you can use AWS CloudFormation Designer, a tool for visually creating and modifying templates. For more information, see What is AWS CloudFormation Designer? in the AWS CloudFormation User Guide. For information about the structure and syntax of a template, see Template anatomy. You can also construct a template from multiple template snippets. Template snippets are examples that demonstrate how to write templates for a particular resource. For example, you can view snippets for Amazon Elastic Compute Cloud (Amazon EC2) instances, Amazon Simple Storage Service (Amazon S3) domains, AWS CloudFormation mappings, and more. Snippets are grouped by resource. You can find general-purpose AWS CloudFormation snippets in the General template snippets section of the AWS CloudFormation User Guide. Creating a CloudFormation template in Application Manager (console) Use the following procedure to create a CloudFormation template in Application Manager by using the AWS Management Console. Application Manager 1978 AWS Systems Manager User Guide To create a CloudFormation template in Application Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Application Manager. In the Applications section, choose CloudFormation stacks. 4. Choose Template library, and then either choose Create template or choose an existing template and then choose Actions, Clone. 5. 6. 7. 8. For Name, enter a name for the template that helps you identify the resources it creates or the purpose of the stack. (Optional) For Version name, enter a name or a number to identity the template version. (Optional) For Description, enter information about this template. In the Code editor section, choose either YAML or JSON and then either enter or copy and paste your template code. 9. (Optional) In the Tags section, apply one or more tag key name/value pairs to the template. 10. (Optional) In the Permissions section, enter an AWS account ID and choose Add account. This action provides read permission to the template. The account owner can provision and clone the template, but they can't edit or delete it. 11. Choose Create. The template is saved in the Systems Manager (SSM) Document service. Creating a CloudFormation template in Application Manager (command line) After you create the content of your CloudFormation template in JSON or YAML, you can use the AWS Command Line Interface (AWS CLI) or AWS Tools for PowerShell to save the template as an SSM document. Replace each example resource placeholder with your own information. Before you begin Install and configure the AWS CLI or the AWS Tools for PowerShell, if you have not already. For information, see Installing or updating the latest version of the AWS CLI and Installing the AWS Tools for PowerShell. Linux & macOS aws ssm create-document \ --content file://path/to/template_in_json_or_yaml \ Application Manager 1979 AWS Systems Manager User Guide --name "a_name_for_the_template" \ --document-type "CloudFormation" \ --document-format "JSON_or_YAML" \ --tags "Key=tag-key,Value=tag-value" Windows aws ssm create-document ^ --content file://C:\path\to\template_in_json_or_yaml ^ --name "a_name_for_the_template" ^ --document-type "CloudFormation" ^ --document-format "JSON_or_YAML" ^ --tags "Key=tag-key,Value=tag-value" PowerShell $json = Get-Content -Path "C:\path\to\template_in_json_or_yaml | Out-String New-SSMDocument ` -Content $json ` -Name "a_name_for_the_template" ` -DocumentType "CloudFormation" ` -DocumentFormat "JSON_or_YAML" ` -Tags "Key=tag-key,Value=tag-value" If successful, the command returns a response similar to the following. { "DocumentDescription": { "Hash": "c1d9640f15fbdba6deb41af6471d6ace0acc22f213bdd1449f03980358c2d4fb", "HashType": "Sha256", "Name": "MyTestCFTemplate", "Owner": "428427166869", "CreatedDate": "2021-06-04T09:44:18.931000-07:00", "Status": "Creating", "DocumentVersion": "1", "Description": "My test template", "PlatformTypes": [], "DocumentType": "CloudFormation", "SchemaVersion": "1.0", "LatestVersion": "1", "DefaultVersion": "1", "DocumentFormat": "YAML", Application Manager 1980 AWS Systems Manager "Tags": [ { "Key": "Templates", "Value": "Test" } ] } Editing a template User Guide Use the following procedure to edit a CloudFormation template in Application Manager. Template changes are available in
|
systems-manager-ug-573
|
systems-manager-ug.pdf
| 573 |
| Out-String New-SSMDocument ` -Content $json ` -Name "a_name_for_the_template" ` -DocumentType "CloudFormation" ` -DocumentFormat "JSON_or_YAML" ` -Tags "Key=tag-key,Value=tag-value" If successful, the command returns a response similar to the following. { "DocumentDescription": { "Hash": "c1d9640f15fbdba6deb41af6471d6ace0acc22f213bdd1449f03980358c2d4fb", "HashType": "Sha256", "Name": "MyTestCFTemplate", "Owner": "428427166869", "CreatedDate": "2021-06-04T09:44:18.931000-07:00", "Status": "Creating", "DocumentVersion": "1", "Description": "My test template", "PlatformTypes": [], "DocumentType": "CloudFormation", "SchemaVersion": "1.0", "LatestVersion": "1", "DefaultVersion": "1", "DocumentFormat": "YAML", Application Manager 1980 AWS Systems Manager "Tags": [ { "Key": "Templates", "Value": "Test" } ] } Editing a template User Guide Use the following procedure to edit a CloudFormation template in Application Manager. Template changes are available in CloudFormation after you provision a stack that uses the updated template. To edit a CloudFormation template in Application Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Application Manager. In the Applications section, choose CloudFormation stacks. 4. Choose Template library. 5. Choose a template, and then choose Actions, Edit. You can't change the name of a template, but you can change all other details. 6. Choose Save. The template is saved in the Systems Manager Document service. Using Application Manager to manage AWS CloudFormation stacks Application Manager, a tool in AWS Systems Manager, helps you provision and manage resources for your applications by integrating with AWS CloudFormation. You can create, edit, and delete CloudFormation templates and stacks in Application Manager. A stack is a collection of AWS resources that you can manage as a single unit. This means you can create, update, or delete a collection of AWS resources by using CloudFormation stacks. A template is a formatted text file in JSON or YAML that specifies the resources you want to provision in your stacks. This section includes the following information. Topics • Creating a stack • Updating a stack Application Manager 1981 AWS Systems Manager Creating a stack User Guide The following procedures describe how to create a CloudFormation stack by using Application Manager. A stack is based on a template. When you create a stack, you can either choose an existing template or create a new one. After you create the stack, the system immediately attempts to create the resources identified in the stack. After the system successfully provisions the resources, the template and the stack are available to view and edit in Application Manager and CloudFormation. Note There is no charge to use Application Manager to create a stack, but you are charged for AWS resources created in the stack. Creating a CloudFormation stack by using Application Manager (console) Use the following procedure to create a stack by using Application Manager in the AWS Management Console. To create a CloudFormation stack 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. 4. manager/. In the navigation pane, choose Application Manager. In the Applications section, choose CloudFormation stacks. In the Prepare a template section, choose an option. If you choose Use an existing template, you can use the tabs in the Choose a template section to locate the template you want. If you choose one of the other options, complete the wizard to prepare a template. 5. On the Specify template details page, verify the details of the template to ensure the process creates the resources you want. • (Optional) In the Tags section, apply one or more tag key name/value pairs to the template. • Tags are optional metadata that you assign to a resource. By using tags, you can categorize a resource in different ways, such as by purpose, owner, or environment. • Choose Next. 6. On the Edit stack details page, for Stack name, enter a name that helps you identify the resources created by the stack or its purpose. Application Manager 1982 AWS Systems Manager User Guide • The Parameters section includes all optional and required parameters specified in the template. Enter one or more parameters in each field. • (Optional) In the Tags section, apply one or more tag key name/value pairs to the stack. • (Optional) In the Permissions section, specify an AWS Identity and Access Management (IAM) role name or an IAM Amazon Resource Name (ARN). The system uses the specified service role to create all resources specified in your stack. If you don't specify an IAM role, then AWS CloudFormation uses a temporary session that the system generates from your user credentials. For more information about this IAM role, see AWS CloudFormation service role in the AWS CloudFormation User Guide. • Choose Next. 7. On the Review and provision page, review all the details of the stack. Choose an Edit button on this page to make change. 8. Choose Provision stack. Application Manager displays the CloudFormation stacks page and the status of the stack creation and deployment. If CloudFormation fails to create and provision the stack, see the following topics
|
systems-manager-ug-574
|
systems-manager-ug.pdf
| 574 |
If you don't specify an IAM role, then AWS CloudFormation uses a temporary session that the system generates from your user credentials. For more information about this IAM role, see AWS CloudFormation service role in the AWS CloudFormation User Guide. • Choose Next. 7. On the Review and provision page, review all the details of the stack. Choose an Edit button on this page to make change. 8. Choose Provision stack. Application Manager displays the CloudFormation stacks page and the status of the stack creation and deployment. If CloudFormation fails to create and provision the stack, see the following topics in the AWS CloudFormation User Guide. • Stack status codes • Troubleshooting AWS CloudFormation After your stack resources are provisioned and running, users can edit resources directly by using the underlying service that created the resource. For example, a user can use the Amazon Elastic Compute Cloud (Amazon EC2) console to update a server instance that was created as part of a CloudFormation stack. Some changes may be accidental, and some may be made intentionally to respond to time-sensitive operational events. Regardless, changes made outside of CloudFormation can complicate stack update or deletion operations. You can use drift detection or drift status to identify stack resources to which configuration changes have been made outside of CloudFormation management. For information about drift status, see Detecting unmanaged configuration changes to stacks and resources. Creating a CloudFormation stack by using Application Manager (command line) Use the following AWS Command Line Interface (AWS CLI) procedure to provision a stack by using a CloudFormation template that is stored as an SSM document in Systems Manager. Replace each Application Manager 1983 AWS Systems Manager User Guide example resource placeholder with your own information. For information about other AWS CLI procedures for creating stacks, see Creating a stack in the AWS CloudFormation User Guide. Before you begin Install and configure the AWS CLI or the AWS Tools for PowerShell, if you have not already. For information, see Installing or updating the latest version of the AWS CLI and Installing the AWS Tools for PowerShell. Linux & macOS aws cloudformation create-stack \ --stack-name a_name_for_the_stack \ --template-url "ssm-doc://arn:aws:ssm:Region:account_ID:document/template_name" \ Windows aws cloudformation create-stack ^ --stack-name a_name_for_the_stack ^ --template-url "ssm-doc://arn:aws:ssm:Region:account_ID:document/template_name" ^ PowerShell New-CFNStack ` -StackName "a_name_for_the_stack" ` -TemplateURL "ssm-doc://arn:aws:ssm:Region:account_ID:document/template_name" ` Updating a stack You can deploy updates to a CloudFormation stack by directly editing the stack in Application Manager. With a direct update, you specify updates to a template or input parameters. After you save and deploy the changes, CloudFormation updates the AWS resources according to the changes you specified. You can preview the changes that CloudFormation will make to your stack before you update it by using change sets. For more information, see Updating stacks using change sets in the AWS CloudFormation User Guide. Application Manager 1984 AWS Systems Manager User Guide To update a CloudFormation stack in Application Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Application Manager. In the Applications section, choose CloudFormation stacks. 4. Choose a stack in the list and then choose Actions, Update stack. 5. On the Specify template source page, choose one of the following options, and then choose Next. • Choose Use the template code currently provisioned in the stack to view a template. Choose a template version in the Versions list, and then choose Next. • Choose Switch to a different template to choose or create a new template for the stack. 6. After you finish making changes to the template, choose Next. 7. On the Edit stack details page, you can edit parameters, tags, and permissions. You can't change the stack name. Make your changes and choose Next. 8. On the Review and provision page, review all the details of the stack, and then choose Provision stack. Working with clusters in Application Manager This section includes topics to help you work with Amazon Elastic Container Service (Amazon ECS) and Amazon Elastic Kubernetes Service (Amazon EKS) container clusters in Application Manager, a component of AWS Systems Manager. Contents • Working with Amazon ECS in Application Manager • Working with Amazon EKS in Application Manager • Working with runbooks for clusters Working with Amazon ECS in Application Manager With Application Manager, a tool in AWS Systems Manager, you can view and manage your Amazon Elastic Container Service (Amazon ECS) cluster infrastructure. Application Manager applies a tag to your Amazon ECS cluster using the Amazon Resource Name (ARN) of the cluster as the tag value. Application Manager 1985 AWS Systems Manager User Guide Application Manager provides a component runtime view of the compute, networking, and storage resources in a cluster. Note You can't manage or view operations information about your containers in Application Manager. You can only manage and view operations information about
|
systems-manager-ug-575
|
systems-manager-ug.pdf
| 575 |
with Amazon ECS in Application Manager With Application Manager, a tool in AWS Systems Manager, you can view and manage your Amazon Elastic Container Service (Amazon ECS) cluster infrastructure. Application Manager applies a tag to your Amazon ECS cluster using the Amazon Resource Name (ARN) of the cluster as the tag value. Application Manager 1985 AWS Systems Manager User Guide Application Manager provides a component runtime view of the compute, networking, and storage resources in a cluster. Note You can't manage or view operations information about your containers in Application Manager. You can only manage and view operations information about the infrastructure hosting your Amazon ECS resources. Actions you can perform on this page You can perform the following actions on this page: • Choose Manage cluster to open the cluster in Amazon ECS. • Choose View all to view a list of resources in your cluster. • Choose View in CloudWatch to view resource alarms in Amazon CloudWatch. • Choose Manage nodes or Manage Fargate profiles to view these resources in Amazon ECS. • Choose a resource ID to view detailed information about it in the console where it was created. • View a list of OpsItems related to your clusters. • View a history of runbooks that have been run on your clusters. To open an ECS cluster 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Application Manager. In the Container clusters section, choose ECS clusters. 4. Choose a cluster in the list. Application Manager opens the Overview tab. Working with Amazon EKS in Application Manager Application Manager, a tool in AWS Systems Manager, integrates with Amazon Elastic Kubernetes Service (Amazon EKS) to provide information about the health of your Amazon EKS cluster infrastructure. Application Manager applies a tag to your Amazon EKS cluster using the Amazon Application Manager 1986 AWS Systems Manager User Guide Resource Name (ARN) of the cluster as the tag value. Application Manager provides a component runtime view of the compute, networking, and storage resources in a cluster. Note You can't manage or view operations information about your Amazon EKS pods or containers in Application Manager. You can only manage and view operations information about the infrastructure hosting your Amazon EKS resources. Actions you can perform on this page You can perform the following actions on this page: • Choose Manage cluster to open the cluster in Amazon EKS. • Choose View all to view a list of resources in your cluster. • Choose View in CloudWatch to view resource alarms in Amazon CloudWatch. • Choose Manage nodes or Manage Fargate profiles to view these resources in Amazon EKS. • Choose a resource ID to view detailed information about it in the console where it was created. • View a list of OpsItems related to your clusters. • View a history of runbooks that have been run on your clusters. To open an EKS clusters application 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Application Manager. In the Container clusters section, choose EKS clusters. 4. Choose a cluster in the list. Application Manager opens the Overview tab. Working with runbooks for clusters You can remediate issues with AWS resources from Application Manager, a tool in AWS Systems Manager, by using Systems Manager Automation runbooks. When you choose Start runbook from an Application Manager cluster, the system displays a filtered list of runbooks based on the type of Application Manager 1987 AWS Systems Manager User Guide resources in your cluster. When you choose the runbook you want to start, Systems Manager opens the Execute automation document page. Before you begin Before you start a runbook from Application Manager, do the following: • Verify that you have the correct permissions for starting runbooks. For more information, see Setting up Automation. • Review the Automation procedure documentation about starting runbooks. For more information, see Run an automated operation powered by Systems Manager Automation. • If you intend to start runbooks on multiple resources at one time, review the documentation about using targets and rate controls. For more information, see Run automated operations at scale. To start a runbook for clusters from Application Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Application Manager. In the Container clusters section, choose a container type. 4. Choose the cluster in the list. Application Manager opens the Overview tab. 5. On the Runbooks tab, choose Start runbook. Application Manager opens the Execute automation document page in a new tab. For information about the options in the Execute automation document page, see Run an automated operation powered by Systems Manager Automation. AWS Systems Manager Parameter Store Parameter Store, a tool in AWS Systems Manager, provides
|
systems-manager-ug-576
|
systems-manager-ug.pdf
| 576 |
clusters from Application Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Application Manager. In the Container clusters section, choose a container type. 4. Choose the cluster in the list. Application Manager opens the Overview tab. 5. On the Runbooks tab, choose Start runbook. Application Manager opens the Execute automation document page in a new tab. For information about the options in the Execute automation document page, see Run an automated operation powered by Systems Manager Automation. AWS Systems Manager Parameter Store Parameter Store, a tool in AWS Systems Manager, provides secure, hierarchical storage for configuration data management and secrets management. You can store data such as passwords, database strings, Amazon Machine Image (AMI) IDs, and license codes as parameter values. You can store values as plain text or encrypted data. You can reference Systems Manager parameters in your scripts, commands, SSM documents, and configuration and automation workflows by using the unique name that you specified when you created the parameter. To get started with Parameter Store 1988 AWS Systems Manager User Guide Parameter Store, open the Systems Manager console. In the navigation pane, choose Parameter Store. Parameter Store is also integrated with Secrets Manager. You can retrieve Secrets Manager secrets when using other AWS services that already support references to Parameter Store parameters. For more information, see Referencing AWS Secrets Manager secrets from Parameter Store parameters. Note To implement password rotation lifecycles, use AWS Secrets Manager. You can rotate, manage, and retrieve database credentials, API keys, and other secrets throughout their lifecycle using Secrets Manager. For more information, see What is AWS Secrets Manager? in the AWS Secrets Manager User Guide. How can Parameter Store benefit my organization? Parameter Store offers these benefits: • Use a secure, scalable, hosted secrets management service with no servers to manage. • Improve your security posture by separating your data from your code. • Store configuration data and encrypted strings in hierarchies and track versions. • Control and audit access at granular levels. • Store parameters reliably because Parameter Store is hosted in multiple Availability Zones in an AWS Region. Who should use Parameter Store? • Any AWS customer who wants to have a centralized way to manage configuration data. • Software developers who want to store different logins and reference streams. • Administrators who want to receive notifications when their secrets and passwords are or aren't changed. What are the features of Parameter Store? • Change notification Parameter Store 1989 AWS Systems Manager User Guide You can configure change notifications and invoke automated actions for both parameters and parameter policies. For more information, see Setting up notifications or triggering actions based on Parameter Store events. • Organize parameters You can tag your parameters individually to help you identify one or more parameters based on the tags you've assigned to them. For example, you can tag parameters for specific environments or departments. • Label versions You can associate an alias for versions of your parameter by creating labels. Labels can help you remember the purpose of a parameter version when there are multiple versions. • Data validation You can create parameters that point to an Amazon Elastic Compute Cloud (Amazon EC2) instance and Parameter Store validates these parameters to make sure that it references expected resource type, that the resource exists, and that the customer has permission to use the resource. For example, you can create a parameter with Amazon Machine Image (AMI) ID as a value with aws:ec2:image data type, and Parameter Store performs an asynchronous validation operation to make sure that the parameter value meets the formatting requirements for an AMI ID, and that the specified AMI is available in your AWS account. • Reference secrets Parameter Store is integrated with AWS Secrets Manager so that you can retrieve Secrets Manager secrets when using other AWS services that already support references to Parameter Store parameters. • Share parameters with other accounts You can optionally centralize configuration data in a single AWS account and share parameters with other accounts that need to access them. • Accessible from other AWS services You can use Parameter Store parameters with other Systems Manager tools and AWS services to retrieve secrets and configuration data from a central store. Parameters work with Systems Manager tools such as Run Command, Automation, and State Manager, tools in AWS Systems Manager. You can also reference parameters in a number of other AWS services, including the following: Parameter Store 1990 AWS Systems Manager User Guide • Amazon Elastic Compute Cloud (Amazon EC2) • Amazon Elastic Container Service (Amazon ECS) • AWS Secrets Manager • AWS Lambda • AWS CloudFormation • AWS CodeBuild • AWS CodePipeline • AWS CodeDeploy • Integrate with other AWS services Configure integration with the following AWS services for
|
systems-manager-ug-577
|
systems-manager-ug.pdf
| 577 |
services to retrieve secrets and configuration data from a central store. Parameters work with Systems Manager tools such as Run Command, Automation, and State Manager, tools in AWS Systems Manager. You can also reference parameters in a number of other AWS services, including the following: Parameter Store 1990 AWS Systems Manager User Guide • Amazon Elastic Compute Cloud (Amazon EC2) • Amazon Elastic Container Service (Amazon ECS) • AWS Secrets Manager • AWS Lambda • AWS CloudFormation • AWS CodeBuild • AWS CodePipeline • AWS CodeDeploy • Integrate with other AWS services Configure integration with the following AWS services for encryption, notification, monitoring, and auditing: • AWS Key Management Service (AWS KMS) • Amazon Simple Notification Service (Amazon SNS) • Amazon CloudWatch: For more information, see Configuring EventBridge rules for parameters and parameter policies. • Amazon EventBridge: For more information, see Monitoring Systems Manager status changes using Amazon SNS notifications and Reference: Amazon EventBridge event patterns and types for Systems Manager. • AWS CloudTrail: For more information, see Logging AWS Systems Manager API calls with AWS CloudTrail. What is a parameter? A Parameter Store parameter is any piece of data that is saved in Parameter Store, such as a block of text, a list of names, a password, an AMI ID, a license key, and so on. You can centrally and securely reference this data in your scripts, commands, and SSM documents. When you reference a parameter, you specify the parameter name by using the following convention. {{ssm:parameter-name}} Parameter Store 1991 AWS Systems Manager Note User Guide Parameters can't be referenced or nested in the values of other parameters. You can't include {{}} or {{ssm:parameter-name}} in a parameter value. Parameter Store provides support for three types of parameters: String, StringList, and SecureString. With one exception, when you create or update a parameter, you enter the parameter value as plaintext, and Parameter Store performs no validation on the text you enter. For String parameters, however, you can specify the data type as aws:ec2:image, and Parameter Store validates that the value you enter is the proper format for an Amazon EC2 AMI; for example: ami-12345abcdeEXAMPLE. Parameter type: String By default, String parameters consist of any block of text you enter. For example: • abc123 • Example Corp • <img src="images/bannerImage1.png"/> Parameter type: StringList StringList parameters contain a comma-separated list of values, as shown in the following examples. Monday,Wednesday,Friday CSV,TSV,CLF,ELF,JSON Parameter type: SecureString A SecureString parameter is any sensitive data that needs to be stored and referenced in a secure manner. If you have data that you don't want users to alter or reference in plaintext, such as passwords or license keys, create those parameters using the SecureString data type. Parameter Store 1992 AWS Systems Manager Important User Guide Don't store sensitive data in a String or StringList parameter. For all sensitive data that must remain encrypted, use only the SecureString parameter type. For more information, see Creating a SecureString parameter using the AWS CLI. We recommend using SecureString parameters for the following scenarios: • You want to use data/parameters across AWS services without exposing the values as plaintext in commands, functions, agent logs, or CloudTrail logs. • You want to control who has access to sensitive data. • You want to be able to audit when sensitive data is accessed (CloudTrail). • You want to encrypt your sensitive data, and you want to bring your own encryption keys to manage access. Important Only the value of a SecureString parameter is encrypted. Parameter names, descriptions, and other properties aren't encrypted. You can use the SecureString parameter type for textual data that you want to encrypt, such as passwords, application secrets, confidential configuration data, or any other types of data that you want to protect. SecureString data is encrypted and decrypted using an AWS KMS key. You can use either a default KMS key provided by AWS or create and use your own AWS KMS key. (Use your own AWS KMS key if you want to restrict user access to SecureString parameters. For more information, see IAM permissions for using AWS default keys and customer managed keys.) You can also use SecureString parameters with other AWS services. In the following example, the Lambda function retrieves a SecureString parameter by using the GetParameters API. import json import boto3 ssm = boto3.client('ssm', 'us-east-2') def get_parameters(): response = ssm.get_parameters( Parameter Store 1993 AWS Systems Manager User Guide Names=['LambdaSecureString'],WithDecryption=True ) for parameter in response['Parameters']: return parameter['Value'] def lambda_handler(event, context): value = get_parameters() print("value1 = " + value) return value # Echo back the first key value AWS KMS encryption and pricing If you choose the SecureString parameter type when you create your parameter, Systems Manager uses AWS KMS to encrypt the parameter value. Important Parameter Store only supports symmetric encryption KMS keys. You can't use an asymmetric encryption
|
systems-manager-ug-578
|
systems-manager-ug.pdf
| 578 |
retrieves a SecureString parameter by using the GetParameters API. import json import boto3 ssm = boto3.client('ssm', 'us-east-2') def get_parameters(): response = ssm.get_parameters( Parameter Store 1993 AWS Systems Manager User Guide Names=['LambdaSecureString'],WithDecryption=True ) for parameter in response['Parameters']: return parameter['Value'] def lambda_handler(event, context): value = get_parameters() print("value1 = " + value) return value # Echo back the first key value AWS KMS encryption and pricing If you choose the SecureString parameter type when you create your parameter, Systems Manager uses AWS KMS to encrypt the parameter value. Important Parameter Store only supports symmetric encryption KMS keys. You can't use an asymmetric encryption KMS key to encrypt your parameters. For help determining whether a KMS key is symmetric or asymmetric, see Identifying symmetric and asymmetric KMS keys in the AWS Key Management Service Developer Guide There is no charge from Parameter Store to create a SecureString parameter, but charges for use of AWS KMS encryption do apply. For information, see AWS Key Management Service pricing. For more information about AWS managed keys and customer managed keys, see AWS Key Management Service Concepts in the AWS Key Management Service Developer Guide. For more information about Parameter Store and AWS KMS encryption, see How AWS Systems Manager Parameter Store Uses AWS KMS. Note To view an AWS managed key, use the AWS KMS DescribeKey operation. This AWS Command Line Interface (AWS CLI) example uses DescribeKey to view an AWS managed key. aws kms describe-key --key-id alias/aws/ssm Parameter Store 1994 AWS Systems Manager More info User Guide • Creating a SecureString parameter in Parameter Store and joining a node to a Domain (PowerShell) • Use Parameter Store to Securely Access Secrets and Config Data in CodeDeploy • Interesting Articles on Amazon EC2 Systems Manager Parameter Store Setting up Parameter Store Before setting up parameters in Parameter Store, a tool in AWS Systems Manager, first configure AWS Identity and Access Management (IAM) policies that provide users in your account with permission to perform the actions you specify. This section includes information about how to manually configure these policies using the IAM console, and how to assign them to users and user groups. You can also create and assign policies to control which parameter actions can be run on a managed node. This section also includes information about how to create Amazon EventBridge rules that let you receive notifications about changes to Systems Manager parameters. You can also use EventBridge rules to invoke other actions in AWS based on changes in Parameter Store. Contents • Restricting access to Parameter Store parameters using IAM policies • Managing parameter tiers • Increasing or resetting Parameter Store throughput • Setting up notifications or triggering actions based on Parameter Store events Restricting access to Parameter Store parameters using IAM policies You restrict access to AWS Systems Manager parameters by using AWS Identity and Access Management (IAM). More specifically, you create IAM policies that restrict access to the following API operations: • DeleteParameter • DeleteParameters • DescribeParameters • GetParameter Parameter Store 1995 AWS Systems Manager • GetParameters • GetParameterHistory • GetParametersByPath • PutParameter User Guide When using IAM policies to restrict access to Systems Manager parameters, we recommend that you create and use restrictive IAM policies. For example, the following policy allows a user to call the DescribeParameters and GetParameters API operations for a limited set of resources. This means that the user can get information about and use all parameters that begin with prod-*. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:DescribeParameters" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "ssm:GetParameters" ], "Resource": "arn:aws:ssm:us-east-2:123456789012:parameter/prod-*" } ] } Important If a user has access to a path, then the user can access all levels of that path. For example, if a user has permission to access path /a, then the user can also access /a/b. Even if a user has explicitly been denied access in IAM for parameter /a/b, they can still call the GetParametersByPath API operation recursively for /a and view /a/b. Parameter Store 1996 AWS Systems Manager User Guide For trusted administrators, you can provide access to all Systems Manager parameter API operations by using a policy similar to the following example. This policy gives the user full access to all production parameters that begin with dbserver-prod-*. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:PutParameter", "ssm:DeleteParameter", "ssm:GetParameterHistory", "ssm:GetParametersByPath", "ssm:GetParameters", "ssm:GetParameter", "ssm:DeleteParameters" ], "Resource": "arn:aws:ssm:us-east-2:123456789012:parameter/dbserver-prod-*" }, { "Effect": "Allow", "Action": "ssm:DescribeParameters", "Resource": "*" } ] } Denying permissions Each API is unique and has distinct operations and permissions that you can allow or deny individually. An explicit deny in any policy overrides the allow. Note The default AWS Key Management Service (AWS KMS) key has Decrypt permission for all IAM principals within the AWS account. If you want to have different access levels to SecureString
|
systems-manager-ug-579
|
systems-manager-ug.pdf
| 579 |
full access to all production parameters that begin with dbserver-prod-*. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:PutParameter", "ssm:DeleteParameter", "ssm:GetParameterHistory", "ssm:GetParametersByPath", "ssm:GetParameters", "ssm:GetParameter", "ssm:DeleteParameters" ], "Resource": "arn:aws:ssm:us-east-2:123456789012:parameter/dbserver-prod-*" }, { "Effect": "Allow", "Action": "ssm:DescribeParameters", "Resource": "*" } ] } Denying permissions Each API is unique and has distinct operations and permissions that you can allow or deny individually. An explicit deny in any policy overrides the allow. Note The default AWS Key Management Service (AWS KMS) key has Decrypt permission for all IAM principals within the AWS account. If you want to have different access levels to SecureString parameters in your account, we don't recommend that you use the default key. Parameter Store 1997 AWS Systems Manager User Guide If you want all API operations retrieving parameter values to have the same behavior, then you can use a pattern like GetParameter* in a policy. The following example shows how to deny GetParameter, GetParameters, GetParameterHistory, and GetParametersByPath for all parameters beginning with prod-*. { "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": [ "ssm:GetParameter*" ], "Resource": "arn:aws:ssm:us-east-2:123456789012:parameter/prod-*" } ] } The following example shows how to deny some commands while allowing the user to perform other commands on all parameters that begin with prod-*. { "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": [ "ssm:PutParameter", "ssm:DeleteParameter", "ssm:DeleteParameters", "ssm:DescribeParameters" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "ssm:GetParametersByPath", "ssm:GetParameters", "ssm:GetParameter", "ssm:GetParameterHistory" ], Parameter Store 1998 AWS Systems Manager User Guide "Resource": "arn:aws:ssm:us-east-2:123456789012:parameter/prod-*" } ] } Note The parameter history includes all parameter versions, including the current one. Therefore, if a user is denied permission for GetParameter, GetParameters, and GetParameterByPath but is allowed permission for GetParameterHistory, they can see the current parameter, including SecureString parameters, using GetParameterHistory. Allowing only specific parameters to run on nodes You can control access so that managed nodes can run only parameters that you specify. If you choose the SecureString parameter type when you create your parameter, Systems Manager uses AWS KMS to encrypt the parameter value. AWS KMS encrypts the value by using either an AWS managed key or a customer managed key. For more information about AWS KMS and AWS KMS key, see the AWS Key Management Service Developer Guide. You can view the AWS managed key by running the following command from the AWS CLI. aws kms describe-key --key-id alias/aws/ssm The following example allows nodes to get a parameter value only for parameters that begin with prod-. If the parameter is a SecureString parameter, then the node decrypts the string using AWS KMS. Note Instance policies, like in the following example, are assigned to the instance role in IAM. For more information about configuring access to Systems Manager features, including how to assign policies to users and instances, see Managing EC2 instances with Systems Manager. { Parameter Store 1999 AWS Systems Manager User Guide "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetParameters" ], "Resource": [ "arn:aws:ssm:us-east-2:123456789012:parameter/prod-*" ] }, { "Effect": "Allow", "Action": [ "kms:Decrypt" ], "Resource": [ "arn:aws:kms:us-east-2:123456789012:key/4914ec06-e888-4ea5- a371-5b88eEXAMPLE" ] } ] } IAM permissions for using AWS default keys and customer managed keys Parameter Store SecureString parameters are encrypted and decrypted using AWS KMS keys. You can choose to encrypt your SecureString parameters using either an AWS KMS key or the default KMS key provided by AWS. When using a customer managed key, the IAM policy that grants a user access to a parameter or parameter path must provide explicit kms:Encrypt permissions for the key. For example, the following policy allows a user to create, update, and view SecureString parameters that begin with prod- in the specified AWS Region and AWS account. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:PutParameter", Parameter Store 2000 AWS Systems Manager User Guide "ssm:GetParameter", "ssm:GetParameters" ], "Resource": [ "arn:aws:ssm:us-east-2:111122223333:parameter/prod-*" ] }, { "Effect": "Allow", "Action": [ "kms:Decrypt", "kms:Encrypt", "kms:GenerateDataKey" ], "Resource": [ "arn:aws:kms:us- east-2:111122223333:key/1234abcd-12ab-34cd-56ef-12345EXAMPLE" ] } ] } 1The kms:GenerateDataKey permission is required for creating encrypted advanced parameters using the specified customer managed key. By contrast, all users within the customer account have access to the default AWS managed key. If you use this default key to encrypt SecureString parameters and don't want users to work with SecureString parameters, their IAM policies must explicitly deny access to the default key, as demonstrated in the following policy example. Note You can locate the Amazon Resource Name (ARN) of the default key in the AWS KMS console on the AWS managed keys page. The default key is the one identified with aws/ ssm in the Alias column. { "Version": "2012-10-17", "Statement": [ Parameter Store 2001 AWS Systems Manager { "Effect": "Deny", "Action": [ "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": [ User Guide "arn:aws:kms:us-east-2:111122223333:key/abcd1234-ab12-cd34-ef56- abcdeEXAMPLE" ] } ] } If you require fine-grained access control over the SecureString parameters in your account, you should use a
|
systems-manager-ug-580
|
systems-manager-ug.pdf
| 580 |
policies must explicitly deny access to the default key, as demonstrated in the following policy example. Note You can locate the Amazon Resource Name (ARN) of the default key in the AWS KMS console on the AWS managed keys page. The default key is the one identified with aws/ ssm in the Alias column. { "Version": "2012-10-17", "Statement": [ Parameter Store 2001 AWS Systems Manager { "Effect": "Deny", "Action": [ "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": [ User Guide "arn:aws:kms:us-east-2:111122223333:key/abcd1234-ab12-cd34-ef56- abcdeEXAMPLE" ] } ] } If you require fine-grained access control over the SecureString parameters in your account, you should use a customer managed key to protect and restrict access to these parameters. We also recommend using AWS CloudTrail to monitor SecureString parameter activities. For more information, see the following topics: • Policy evaluation logic in the IAM User Guide • Using key policies in AWS KMS in the AWS Key Management Service Developer Guide • Viewing events with CloudTrail Event history in the AWS CloudTrail User Guide Managing parameter tiers Parameter Store, a tool in AWS Systems Manager, includes standard parameters and advanced parameters. You individually configure parameters to use either the standard-parameter tier (the default tier) or the advanced-parameter tier. You can change a standard parameter to an advanced parameter at any time, but you can’t revert an advanced parameter to a standard parameter. This is because reverting an advanced parameter to a standard parameter would cause the system to truncate the size of the parameter from 8 KB to 4 KB, resulting in data loss. Reverting would also remove any policies attached to the parameter. Also, advanced parameters use a different form of encryption than standard parameters. For more information, see How AWS Systems Manager Parameter Store uses AWS KMS in the AWS Key Management Service Developer Guide. If you no longer need an advanced parameter, or if you no longer want to incur charges for an advanced parameter, delete it and recreate it as a new standard parameter. Parameter Store 2002 AWS Systems Manager User Guide The following table describes the differences between the tiers. Standard 10,000 Advanced 100,000 Total number of parameters allowed (per AWS account and AWS Region) Maximum size of a parameter value 4 KB Parameter policies available No 8 KB Yes For more information, see Assigning parameter policies in Parameter Store. Cost No additional charge Charges apply For more information, see AWS Systems Manager Pricing for Parameter Store. Topics • Specifying a default parameter tier • Changing a standard parameter to an advanced parameter Specifying a default parameter tier In requests to create or update a parameter (that is, the PutParameter operation), you can specify the parameter tier to use in the request. The following is an example, using the AWS Command Line Interface (AWS CLI). Linux & macOS aws ssm put-parameter \ Parameter Store 2003 AWS Systems Manager User Guide --name "default-ami" \ --type "String" \ --value "t2.micro" \ --tier "Standard" Windows aws ssm put-parameter ^ --name "default-ami" ^ --type "String" ^ --value "t2.micro" ^ --tier "Standard" Whenever you specify a tier in the request, Parameter Store creates or updates the parameter according to your request. However, if you don't explicitly specify a tier in a request, the Parameter Store default tier setting determines which tier the parameter is created in. The default tier when you begin using Parameter Store is the standard-parameter tier. If you use the advanced-parameter tier, you can specify one of the following as the default: • Advanced: With this option, Parameter Store evaluates all requests as advanced parameters. • Intelligent-Tiering: With this option, Parameter Store evaluates each request to determine if the parameter is standard or advanced. If the request doesn't include any options that require an advanced parameter, the parameter is created in the standard-parameter tier. If one or more options requiring an advanced parameter are included in the request, Parameter Store creates a parameter in the advanced-parameter tier. Benefits of Intelligent-Tiering The following are reasons you might choose Intelligent-Tiering as the default tier. Cost control – Intelligent-Tiering helps control your parameter-related costs by always creating standard parameters unless an advanced parameter is absolutely necessary. Automatic upgrade to the advanced-parameter tier – When you make a change to your code that requires upgrading a standard parameter to an advanced parameter, Intelligent-Tiering handles the conversion for you. You don't need to change your code to handle the upgrade. Here are some examples of automatic upgrades: Parameter Store 2004 AWS Systems Manager User Guide • Your AWS CloudFormation templates provision numerous parameters when they're run. When this process causes you to reach the 10,000 parameter quota in the standard-parameter tier, Intelligent-Tiering automatically upgrades you to the advanced-parameter tier, and your AWS CloudFormation processes aren't interrupted. • You store a certificate value in a parameter, rotate the certificate value regularly,
|
systems-manager-ug-581
|
systems-manager-ug.pdf
| 581 |
to your code that requires upgrading a standard parameter to an advanced parameter, Intelligent-Tiering handles the conversion for you. You don't need to change your code to handle the upgrade. Here are some examples of automatic upgrades: Parameter Store 2004 AWS Systems Manager User Guide • Your AWS CloudFormation templates provision numerous parameters when they're run. When this process causes you to reach the 10,000 parameter quota in the standard-parameter tier, Intelligent-Tiering automatically upgrades you to the advanced-parameter tier, and your AWS CloudFormation processes aren't interrupted. • You store a certificate value in a parameter, rotate the certificate value regularly, and the content is less than the 4 KB quota of the standard-parameter tier. If a replacement certificate value exceeds 4 KB, Intelligent-Tiering automatically upgrades the parameter to the advanced- parameter tier. • You want to associate numerous existing standard parameters to a parameter policy, which requires the advanced-parameter tier. Instead of your having to include the option --tier Advanced in all the calls to update the parameters, Intelligent-Tiering automatically upgrades the parameters to the advanced-parameter tier. The Intelligent-Tiering option upgrades parameters from standard to advanced whenever criteria for the advanced-parameter tier are introduced. Options that require an advanced parameter include the following: • The content size of the parameter is more than 4 KB. • The parameter uses a parameter policy. • More than 10,000 parameters already exist in your AWS account in the current AWS Region. Default Tier Options The tier options you can specify as the default include the following. • Standard – The standard-parameter tier is the default tier when you begin to use Parameter Store. Using the standard-parameter tier, you can create 10,000 parameters for each AWS Region in an AWS account. The content size of each parameter can equal a maximum of 4 KB. Standard parameters don't support parameter policies. There is no additional charge to use the standard-parameter tier. Choosing Standard as the default tier means that Parameter Store always attempts to create a standard parameter for requests that don't specify a tier. • Advanced – Use the advanced-parameter tier to create a maximum of 100,000 parameters for each AWS Region in an AWS account. The content size of each parameter can equal a maximum of 8 KB. Advanced parameters support parameter policies. To share a parameter, it must be in the advanced parameter tier. There is a charge to use the advanced-parameter tier. For more information, see AWS Systems Manager Pricing for Parameter Store. Choosing Advanced as the Parameter Store 2005 AWS Systems Manager User Guide default tier means that Parameter Store always attempts to create an advanced parameter for requests that don't specify a tier. Note When you choose the advanced-parameter tier, explicitly authorize AWS to charge your account for any advanced parameters you create. • Intelligent-Tiering – With the Intelligent-Tiering option, Parameter Store determines whether to use the standard-parameter tier or advanced-parameter tier based on the content of the request. For example, if you run a command to create a parameter with content under 4 KB, and there are fewer than 10,000 parameters in the current AWS Region in your AWS account, and you don't specify a parameter policy, a standard parameter is created. If you run a command to create a parameter with more than 4 KB of content, you already have more than 10,000 parameters in the current AWS Region in your AWS account, or you specify a parameter policy, an advanced parameter is created. Note When you choose Intelligent-Tiering, explicitly authorize AWS to charge your account for any advanced parameters you created. You can change the Parameter Store default tier setting at any time. Configuring permissions to specify a Parameter Store default tier Verify that you have permission in AWS Identity and Access Management (IAM) to change the default parameter tier in Parameter Store by doing one of the following: • Make sure that you attach the AdministratorAccess policy to your IAM entity (such as user, group, or role). • Make sure that you have permission to change the default tier setting by using the following API operations: • GetServiceSetting • UpdateServiceSetting • ResetServiceSetting Parameter Store 2006 AWS Systems Manager User Guide Grant the following permissions to the IAM entity to allow a user to view and change the default tier setting for parameters in a specific AWS Region in an AWS account. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetServiceSetting" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "ssm:UpdateServiceSetting" ], "Resource": "arn:aws:ssm:region:account-id:servicesetting/ssm/parameter- store/default-parameter-tier" } ] } Administrators can specify read-only permission by assigning the following permissions. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetServiceSetting" ], "Resource": "*" }, { "Effect": "Deny", "Action": [ "ssm:ResetServiceSetting", "ssm:UpdateServiceSetting" ], "Resource": "*" Parameter Store 2007 AWS Systems Manager } ] } User Guide
|
systems-manager-ug-582
|
systems-manager-ug.pdf
| 582 |
the IAM entity to allow a user to view and change the default tier setting for parameters in a specific AWS Region in an AWS account. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetServiceSetting" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "ssm:UpdateServiceSetting" ], "Resource": "arn:aws:ssm:region:account-id:servicesetting/ssm/parameter- store/default-parameter-tier" } ] } Administrators can specify read-only permission by assigning the following permissions. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetServiceSetting" ], "Resource": "*" }, { "Effect": "Deny", "Action": [ "ssm:ResetServiceSetting", "ssm:UpdateServiceSetting" ], "Resource": "*" Parameter Store 2007 AWS Systems Manager } ] } User Guide To provide access, add permissions to your users, groups, or roles: • Users and groups in AWS IAM Identity Center: Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity Center User Guide. • Users managed in IAM through an identity provider: Create a role for identity federation. Follow the instructions in Create a role for a third-party identity provider (federation) in the IAM User Guide. • IAM users: • Create a role that your user can assume. Follow the instructions in Create a role for an IAM user in the IAM User Guide. • (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the instructions in Adding permissions to a user (console) in the IAM User Guide. Specifying or changing the Parameter Store default tier using the console The following procedure shows how to use the Systems Manager console to specify or change the default parameter tier for the current AWS account and AWS Region. Tip If you haven't created a parameter yet, you can use the AWS Command Line Interface (AWS CLI) or AWS Tools for Windows PowerShell to change the default parameter tier. For information, see Specifying or changing the Parameter Store default tier using the AWS CLI and Specifying or changing the Parameter Store default tier (PowerShell). To specify or change the Parameter Store default tier 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Parameter Store. Parameter Store 2008 AWS Systems Manager 3. Choose the Settings tab. 4. Choose Change default tier. 5. Choose one of the following options. • Standard • Advanced • Intelligent-Tiering User Guide For information about these options, see Specifying a default parameter tier. 6. Review the message, and choose Confirm. If you want to change the default tier setting later, repeat this procedure and specify a different default tier option. Specifying or changing the Parameter Store default tier using the AWS CLI The following procedure shows how to use the AWS CLI to change the default parameter tier setting for the current AWS account and AWS Region. To specify or change the Parameter Store default tier using the AWS CLI 1. Open the AWS CLI and run the following command to change the default parameter tier setting for a specific AWS Region in an AWS account. aws ssm update-service-setting --setting-id arn:aws:ssm:region:account- id:servicesetting/ssm/parameter-store/default-parameter-tier --setting-value tier- option region represents the identifier for an AWS Region supported by AWS Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. tier-option values include Standard, Advanced, and Intelligent-Tiering. For information about these options, see Specifying a default parameter tier. There is no output if the command succeeds. Parameter Store 2009 AWS Systems Manager User Guide 2. Run the following command to view the current default parameter tier service settings for Parameter Store in the current AWS account and AWS Region. aws ssm get-service-setting --setting-id arn:aws:ssm:region:account- id:servicesetting/ssm/parameter-store/default-parameter-tier The system returns information similar to the following. { "ServiceSetting": { "SettingId": "/ssm/parameter-store/default-parameter-tier", "SettingValue": "Advanced", "LastModifiedDate": 1556551683.923, "LastModifiedUser": "arn:aws:sts::123456789012:assumed-role/Administrator/ Jasper", "ARN": "arn:aws:ssm:us-east-2:123456789012:servicesetting/ssm/parameter- store/default-parameter-tier", "Status": "Customized" } } If you want to change the default tier setting again, repeat this procedure and specify a different SettingValue option. Specifying or changing the Parameter Store default tier (PowerShell) The following procedure shows how to use the Tools for Windows PowerShell to change the default parameter tier setting for a specific AWS Region in an Amazon Web Services account. To specify or change the Parameter Store default tier using PowerShell 1. Change the Parameter Store default tier in the current AWS account and AWS Region using the AWS Tools for PowerShell (Tools for PowerShell). Update-SSMServiceSetting -SettingId "arn:aws:ssm:region:account-id:servicesetting/ ssm/parameter-store/default-parameter-tier" -SettingValue "tier-option" - Region region region represents the identifier for an AWS Region supported by AWS Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Parameter Store 2010 AWS Systems Manager User Guide Region column in Systems Manager service endpoints in the Amazon Web Services General Reference.
|
systems-manager-ug-583
|
systems-manager-ug.pdf
| 583 |
Web Services account. To specify or change the Parameter Store default tier using PowerShell 1. Change the Parameter Store default tier in the current AWS account and AWS Region using the AWS Tools for PowerShell (Tools for PowerShell). Update-SSMServiceSetting -SettingId "arn:aws:ssm:region:account-id:servicesetting/ ssm/parameter-store/default-parameter-tier" -SettingValue "tier-option" - Region region region represents the identifier for an AWS Region supported by AWS Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Parameter Store 2010 AWS Systems Manager User Guide Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. tier-option values include Standard, Advanced, and Intelligent-Tiering. For information about these options, see Specifying a default parameter tier. There is no output if the command succeeds. 2. Run the following command to view the current default parameter tier service settings for Parameter Store in the current AWS account and AWS Region. Get-SSMServiceSetting -SettingId "arn:aws:ssm:region:account-id:servicesetting/ssm/ parameter-store/default-parameter-tier" -Region region region represents the identifier for an AWS Region supported by AWS Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. The system returns information similar to the following. ARN : arn:aws:ssm:us-east-2:123456789012:servicesetting/ssm/parameter-store/ default-parameter-tier LastModifiedDate : 4/29/2019 3:35:44 PM LastModifiedUser : arn:aws:sts::123456789012:assumed-role/Administrator/Jasper SettingId : /ssm/parameter-store/default-parameter-tier SettingValue : Advanced Status : Customized If you want to change the default tier setting again, repeat this procedure and specify a different SettingValue option. Changing a standard parameter to an advanced parameter Use the following procedure to change an existing standard parameter to an advanced parameter. For information about how to create a new advanced parameter, see Creating Parameter Store parameters in Systems Manager. Parameter Store 2011 AWS Systems Manager User Guide To change a standard parameter to an advanced parameter 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Parameter Store. 3. Choose a parameter, and then choose Edit. 4. For Description, enter information about this parameter. 5. Choose Advanced. 6. For Value, enter the value of this parameter. Advanced parameters have a maximum value limit of 8 KB. 7. Choose Save changes. Increasing or resetting Parameter Store throughput Increasing Parameter Store throughput increases the maximum number of transactions per second (TPS) that Parameter Store, a tool in AWS Systems Manager, can process. Increased throughput allows you to operate Parameter Store at higher volumes to support applications and workloads that need concurrent access to multiple parameters. You can increase the quota up to the max throughput on the Settings tab. The Parameter Store throughput setting applies to all transactions created by all IAM users in the current AWS account and AWS Region. The throughput setting applies to standard and advanced parameters. Note Typically, updates are immediately visible in Service Quotas. In rare cases, it can take up to 24 hours for an update to be reflected. For more information about max throughput default and maximum limits, see AWS Systems Manager endpoints and quotas. Increasing the throughput quota incurs a charge on your AWS account. For more information, see AWS Systems Manager Pricing. Topics Parameter Store 2012 AWS Systems Manager User Guide • Configuring permissions to change Parameter Store throughput • Increasing or resetting throughput using the console • Increasing or resetting throughput using the AWS CLI • Increasing or resetting throughput (PowerShell) Configuring permissions to change Parameter Store throughput Verify that you have permission in IAM to change Parameter Store throughput by doing one of the following: • Make sure that the AdministratorAccess policy is attached to your IAM entity (user, group, or role). • Make sure that you have permission to change the throughput service setting by using the following API operations: • GetServiceSetting • UpdateServiceSetting • ResetServiceSetting Grant the following permissions to the IAM entity to allow a user to view and change the parameter-throughput setting for parameters in a specific AWS Region in an AWS account. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetServiceSetting" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "ssm:UpdateServiceSetting" ], "Resource": "arn:aws:ssm:region:account-id:servicesetting/ssm/parameter- store/high-throughput-enabled" Parameter Store 2013 AWS Systems Manager } ] } User Guide Administrators can specify read-only permission by assigning the following permissions. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetServiceSetting" ], "Resource": "*" }, { "Effect": "Deny", "Action": [ "ssm:ResetServiceSetting", "ssm:UpdateServiceSetting" ], "Resource": "*" } ] } To provide access, add permissions to your users, groups, or roles: • Users and groups in AWS IAM Identity Center: Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity Center User Guide. • Users managed in IAM through an identity provider: Create a role for identity federation. Follow the instructions in Create a role for
|
systems-manager-ug-584
|
systems-manager-ug.pdf
| 584 |
can specify read-only permission by assigning the following permissions. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetServiceSetting" ], "Resource": "*" }, { "Effect": "Deny", "Action": [ "ssm:ResetServiceSetting", "ssm:UpdateServiceSetting" ], "Resource": "*" } ] } To provide access, add permissions to your users, groups, or roles: • Users and groups in AWS IAM Identity Center: Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity Center User Guide. • Users managed in IAM through an identity provider: Create a role for identity federation. Follow the instructions in Create a role for a third-party identity provider (federation) in the IAM User Guide. • IAM users: • Create a role that your user can assume. Follow the instructions in Create a role for an IAM user in the IAM User Guide. Parameter Store 2014 AWS Systems Manager User Guide • (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the instructions in Adding permissions to a user (console) in the IAM User Guide. Increasing or resetting throughput using the console The following procedure shows how to use the Systems Manager console to increase the number of transactions per second that Parameter Store can process for the current AWS account and AWS Region. It also shows how to revert to the standard settings if you no longer need increased throughput or no longer want to incur charges. To increase or reset Parameter Store throughput using the console Tip If you haven't created a parameter yet, you can use the AWS Command Line Interface (AWS CLI) or AWS Tools for Windows PowerShell to increase throughput. For information, see Increasing or resetting throughput using the AWS CLI and Increasing or resetting throughput (PowerShell). 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Parameter Store. 3. Choose the Settings tab. 4. To increase throughput, choose Set limit. -or- To revert to the default limit, choose Reset limit. 5. If you are increasing the limit, do the following: • Select the check box for I accept that changing this setting incurs charges on my AWS account. • Choose Set limit. -or- Parameter Store 2015 AWS Systems Manager User Guide If you are resetting the limit to the default, do the following: • Select the check box for I accept that resetting to the default throughput limit causes Parameter Store to process fewer transactions per second. • Choose Reset limit. Increasing or resetting throughput using the AWS CLI The following procedure shows how to use the AWS CLI to increase the number of transactions per second that Parameter Store can process for the current AWS account and AWS Region. You can also revert to the default limit. To increase Parameter Store throughput using the AWS CLI 1. Open the AWS CLI and run the following command to increase the transactions per second that Parameter Store can process in the current AWS account and AWS Region. aws ssm update-service-setting --setting-id arn:aws:ssm:region:account- id:servicesetting/ssm/parameter-store/high-throughput-enabled --setting-value true There is no output if the command succeeds. 2. Run the following command to view the current throughput service settings for Parameter Store in the current AWS account and AWS Region. aws ssm get-service-setting --setting-id arn:aws:ssm:region:account- id:servicesetting/ssm/parameter-store/high-throughput-enabled The system returns information similar to the following: { "ServiceSetting": { "SettingId": "/ssm/parameter-store/high-throughput-enabled", "SettingValue": "true", "LastModifiedDate": 1556551683.923, "LastModifiedUser": "arn:aws:sts::123456789012:assumed-role/Administrator/ Jasper", "ARN": "arn:aws:ssm:us-east-2:123456789012:servicesetting/ssm/parameter- store/high-throughput-enabled", "Status": "Customized" Parameter Store 2016 AWS Systems Manager } } User Guide If you no longer need increased throughput, or if you no longer want to incur charges, you can revert to the standard settings. To revert your settings, run the following command. aws ssm reset-service-setting --setting-id arn:aws:ssm:region:account- id:servicesetting/ssm/parameter-store/high-throughput-enabled { "ServiceSetting": { "SettingId": "/ssm/parameter-store/high-throughput-enabled", "SettingValue": "false", "LastModifiedDate": 1555532818.578, "LastModifiedUser": "System", "ARN": "arn:aws:ssm:us-east-2:123456789012:servicesetting/ssm/parameter-store/ high-throughput-enabled", "Status": "Default" } } Increasing or resetting throughput (PowerShell) The following procedure shows how to use the Tools for Windows PowerShell to increase the number of transactions per second that Parameter Store can process for the current AWS account and AWS Region. You can also revert to the default limit. To increase Parameter Store throughput using PowerShell 1. Increase Parameter Store throughput in the current AWS account and AWS Region using the AWS Tools for PowerShell (Tools for PowerShell). Update-SSMServiceSetting -SettingId "arn:aws:ssm:region:account-id:servicesetting/ ssm/parameter-store/high-throughput-enabled" -SettingValue "true" -Region region There is no output if the command succeeds. 2. Run the following command to view the current throughput service settings for Parameter Store in the current AWS account and AWS Region. Parameter Store 2017 AWS Systems Manager User Guide Get-SSMServiceSetting -SettingId "arn:aws:ssm:region:account-id:servicesetting/ssm/ parameter-store/high-throughput-enabled" -Region region The systems returns information similar to the following: ARN : arn:aws:ssm:us-east-2:123456789012:servicesetting/ssm/parameter- store/high-throughput-enabled LastModifiedDate : 4/29/2019 3:35:44 PM LastModifiedUser : arn:aws:sts::123456789012:assumed-role/Administrator/Jasper SettingId : /ssm/parameter-store/high-throughput-enabled SettingValue : true Status : Customized If you no longer need increased
|
systems-manager-ug-585
|
systems-manager-ug.pdf
| 585 |
and AWS Region using the AWS Tools for PowerShell (Tools for PowerShell). Update-SSMServiceSetting -SettingId "arn:aws:ssm:region:account-id:servicesetting/ ssm/parameter-store/high-throughput-enabled" -SettingValue "true" -Region region There is no output if the command succeeds. 2. Run the following command to view the current throughput service settings for Parameter Store in the current AWS account and AWS Region. Parameter Store 2017 AWS Systems Manager User Guide Get-SSMServiceSetting -SettingId "arn:aws:ssm:region:account-id:servicesetting/ssm/ parameter-store/high-throughput-enabled" -Region region The systems returns information similar to the following: ARN : arn:aws:ssm:us-east-2:123456789012:servicesetting/ssm/parameter- store/high-throughput-enabled LastModifiedDate : 4/29/2019 3:35:44 PM LastModifiedUser : arn:aws:sts::123456789012:assumed-role/Administrator/Jasper SettingId : /ssm/parameter-store/high-throughput-enabled SettingValue : true Status : Customized If you no longer need increased throughput, or if you no longer want to incur charges, you can revert to the standard settings. To revert your settings, run the following command. Reset-SSMServiceSetting -SettingId "arn:aws:ssm:region:account-id:servicesetting/ssm/ parameter-store/high-throughput-enabled" -Region region The system returns information similar to the following: ARN : arn:aws:ssm:us-east-2:123456789012:servicesetting/ssm/parameter- store/high-throughput-enabled LastModifiedDate : 4/17/2019 8:26:58 PM LastModifiedUser : System SettingId : /ssm/parameter-store/high-throughput-enabled SettingValue : false Status : Default Setting up notifications or triggering actions based on Parameter Store events The topics in this section explain how to use Amazon EventBridge and Amazon Simple Notification Service (Amazon SNS) to notify you about changes to AWS Systems Manager parameters. You can create an EventBridge rule to notify you when a parameter or a parameter label version is created, updated, or deleted. Events are emitted on a best effort basis. You can be notified about changes or status related to parameter policies, such as when a parameter expires, is going to expire, or hasn't changed for a specified period of time. Parameter Store 2018 AWS Systems Manager Note User Guide Parameter policies are available for parameters that use the advanced parameters tier. Charges apply. For more information, see Assigning parameter policies in Parameter Store and Managing parameter tiers. The topics in this section also explain how to initiate other actions on a target for specific parameter events. For example, you can run an AWS Lambda function to recreate a parameter automatically when it expires or is deleted. You can set up a notification to invoke a Lambda function when your database password is updated. The Lambda function can force your database connections to reset or reconnect with the new password. EventBridge also supports running Run Command commands and Automation executions, and actions in many other AWS services. Run Command and Automation are both tools in AWS Systems Manager. For more information, see the Amazon EventBridge User Guide. Before You Begin Create any resources you need to specify the target action for the rule you create. For example, if the rule you create is for sending a notification, first create an Amazon SNS topic. For more information, see Getting started with Amazon SNS in the Amazon Simple Notification Service Developer Guide. Configuring EventBridge rules for parameters and parameter policies This topic explains the following: • How to create an EventBridge rule that invokes a target based on events that happen to one or more parameters in your AWS account. • How to create EventBridge rules that invoke targets based on events that happen to one or more parameter policies in your AWS account. When you create an advanced parameter, you specify when a parameter expires, when to receive notification before a parameter expires, and how long to wait before notification should be sent that a parameter hasn't changed. You set up notification for these events using the following procedure. For more information, see Assigning parameter policies in Parameter Store and Managing parameter tiers. To configure an EventBridge rule for a Systems Manager parameter or parameter policy 1. Open the Amazon EventBridge console at https://console.aws.amazon.com/events/. Parameter Store 2019 AWS Systems Manager User Guide 2. In the navigation pane, choose Rules, and then choose Create rule. -or- If the EventBridge home page opens first, choose Create rule. 3. Enter a name and description for the rule. A rule can't have the same name as another rule in the same Region and on the same event bus. 4. For Event bus, choose the event bus that you want to associate with this rule. If you want this rule to initiate on matching events that come from your own AWS account, select default . When an AWS service in your account emits an event, it always goes to your account’s default event bus. 5. For Rule type, leave the default Rule with an event pattern selected. 6. Choose Next. 7. For Event source, leave the default AWS events or EventBridge partner events selected. You can skip the Sample event section. 8. For Event pattern, do the following: • Choose Custom patterns (JSON editor). • For Event pattern, paste one of the following content in the box, depending on whether you are creating a rule for a parameter or a parameter policy: Parameter { "source": [ "aws.ssm"
|
systems-manager-ug-586
|
systems-manager-ug.pdf
| 586 |
AWS service in your account emits an event, it always goes to your account’s default event bus. 5. For Rule type, leave the default Rule with an event pattern selected. 6. Choose Next. 7. For Event source, leave the default AWS events or EventBridge partner events selected. You can skip the Sample event section. 8. For Event pattern, do the following: • Choose Custom patterns (JSON editor). • For Event pattern, paste one of the following content in the box, depending on whether you are creating a rule for a parameter or a parameter policy: Parameter { "source": [ "aws.ssm" ], "detail-type": [ "Parameter Store Change" ], "detail": { "name": [ "parameter-1-name", "/parameter-2-name/level-2", "/parameter-3-name/level-2/level-3" ], "operation": [ "Create", Parameter Store 2020 AWS Systems Manager User Guide "Update", "Delete", "LabelParameterVersion" ] } } Parameter policy { "source": [ "aws.ssm" ], "detail-type": [ "Parameter Store Policy Action" ], "detail": { "parameter-name": [ "parameter-1-name", "/parameter-2-name/level-2", "/parameter-3-name/level-2/level-3" ], "policy-type": [ "Expiration", "ExpirationNotification", "NoChangeNotification" ] } } • Modify the contents for the parameters and the operations you want to act on, as shown in the following samples. Parameter With this example, an action is taken when either of the parameters named /Oncall and /Project/Teamlead are updated: { "source": [ "aws.ssm" ], "detail-type": [ Parameter Store 2021 AWS Systems Manager User Guide "Parameter Store Change" ], "detail": { "name": [ "/Oncall", "/Project/Teamlead" ], "operation": [ "Update" ] } } Parameter policy With this example, an action is taken whenever the parameter named /OncallDuties expires and is deleted: { "source": [ "aws.ssm" ], "detail-type": [ "Parameter Store Policy Action" ], "detail": { "parameter-name": [ "/OncallDuties" ], "policy-type": [ "Expiration" ] } } 9. Choose Next. 10. For Target 1, choose a target type and a supported resource. For example, if you choose SNS topic, make a selection for Topic. If you choose CodePipeline, enter a pipeline ARN for Pipeline ARN. Provide additional configuration values as required. Parameter Store 2022 AWS Systems Manager Tip User Guide Choose Add another target if you require additional targets for the rule. 11. Choose Next. 12. (Optional) Enter one or more tags for the rule. For more information, see Amazon EventBridge tags in the Amazon EventBridge User Guide. 13. Choose Next. 14. Choose Create rule. More info • Use parameter labels for easy configuration update across environments • Tutorial: Use EventBridge to relay events to AWS Systems Manager Run Command in the Amazon EventBridge User Guide • Tutorial: Set AWS Systems Manager Automation as an EventBridge target in the Amazon EventBridge User Guide Working with Parameter Store This section describes how to organize and create tag parameters, and how to create different versions of parameters. You can use the AWS Systems Manager console, the AWS Command Line Interface (AWS CLI), the AWS Tools for PowerShell, and the AWS SDKs to create and work with parameters. For more information about parameters, see What is a parameter?. Topics • Creating Parameter Store parameters in Systems Manager • Searching for Parameter Store parameters in Systems Manager • Assigning parameter policies in Parameter Store • Working with parameter hierarchies in Parameter Store • Preventing access to Parameter Store API operations • Working with parameter labels in Parameter Store • Working with parameter versions in Parameter Store Parameter Store 2023 AWS Systems Manager User Guide • Working with shared parameters in Parameter Store • Working with parameters in Parameter Store using Run Command commands • Using native parameter support in Parameter Store for Amazon Machine Image IDs • Deleting parameters from Parameter Store Creating Parameter Store parameters in Systems Manager Use the information in the following topics to help you create Systems Manager parameters using the AWS Systems Manager console, the AWS Command Line Interface (AWS CLI), or AWS Tools for Windows PowerShell (Tools for Windows PowerShell). This section demonstrates how to create, store, and run parameters with Parameter Store in a test environment. It also demonstrates how to use Parameter Store with other Systems Manager tools in AWS services. For more information, see What is a parameter? Understanding requirements and constraints for parameter names Use the information in this topic to help you specify valid values for parameter names when you create a parameter. This information supplements the details in the topic PutParameter in the AWS Systems Manager API Reference, which also provides information about the values AllowedPattern, Description, KeyId, Overwrite, Type, and Value. The requirements and constraints for parameter names include the following: • Case sensitivity: Parameter names are case sensitive. • Spaces: Parameter names can't include spaces. • Valid characters: Parameter names can consist of the following symbols and letters only: a-zA- Z0-9_.- In addition, the slash character ( / ) is used to delineate hierarchies in parameter names. For example: /Dev/Production/East/Project-ABC/MyParameter • Valid AMI format: When you choose aws:ec2:image as the data
|
systems-manager-ug-587
|
systems-manager-ug.pdf
| 587 |
information supplements the details in the topic PutParameter in the AWS Systems Manager API Reference, which also provides information about the values AllowedPattern, Description, KeyId, Overwrite, Type, and Value. The requirements and constraints for parameter names include the following: • Case sensitivity: Parameter names are case sensitive. • Spaces: Parameter names can't include spaces. • Valid characters: Parameter names can consist of the following symbols and letters only: a-zA- Z0-9_.- In addition, the slash character ( / ) is used to delineate hierarchies in parameter names. For example: /Dev/Production/East/Project-ABC/MyParameter • Valid AMI format: When you choose aws:ec2:image as the data type for a String parameter, the ID you enter must validate for the AMI ID format ami-12345abcdeEXAMPLE. • Fully qualified: When you create or reference a parameter in a hierarchy, include a leading forward slash character (/) . When you reference a parameter that is part of a hierarchy, specify the entire hierarchy path including the initial slash (/). Parameter Store 2024 AWS Systems Manager User Guide • Fully qualified parameter names: MyParameter1, /MyParameter2, /Dev/Production/ East/Project-ABC/MyParameter • Not fully qualified parameter name: MyParameter3/L1 • Length: The maximum length for a parameter name that you specify is 1011 characters. This count of 1011 characters includes the characters in the ARN that precede the name you specify, such as the 45 characters in arn:aws:ssm:us-east-2:111122223333:parameter/. • Prefixes: A parameter name can't be prefixed with "aws" or "ssm" (case-insensitive). For example, attempts to create parameters with the following names fail with an exception: • awsTestParameter • SSM-testparameter • /aws/testparam1 Note When you specify a parameter in an SSM document, command, or script, include ssm as part of the syntax. For example, {{ssm:parameter-name}} and {{ ssm:parameter-name }}, such as {{ssm:MyParameter}}, and {{ ssm:MyParameter }}. • Uniqueness: A parameter name must be unique within an AWS Region. For example, Systems Manager treats the following as separate parameters, if they exist in the same Region: • /Test/TestParam1 • /TestParam1 The following examples are also unique: • /Test/TestParam1/Logpath1 • /Test/TestParam1 The following examples, however, if in the same Region, aren't unique: • /TestParam1 • TestParam1 • Hierarchy depth: If you specify a parameter hierarchy, the hierarchy can have a maximum depth of fifteen levels. You can define a parameter at any level of the hierarchy. Both of the following examples are structurally valid: • /Level-1/L2/L3/L4/L5/L6/L7/L8/L9/L10/L11/L12/L13/L14/parameter-name Parameter Store 2025 AWS Systems Manager • parameter-name User Guide Attempting to create the following parameter would fail with a HierarchyLevelLimitExceededException exception: • /Level-1/L2/L3/L4/L5/L6/L7/L8/L9/L10/L11/L12/L13/L14/L15/L16/parameter- name Important If a user has access to a path, then the user can access all levels of that path. For example, if a user has permission to access path /a, then the user can also access /a/b. Even if a user has explicitly been denied access in AWS Identity and Access Management (IAM) for parameter /a/b, they can still call the GetParametersByPath API operation recursively for / a and view /a/b. Topics • Creating a Parameter Store parameter using the console • Creating a Parameter Store parameter using the AWS CLI • Creating a Parameter Store parameter using Tools for Windows PowerShell Creating a Parameter Store parameter using the console You can use the AWS Systems Manager console to create and run String, StringList, and SecureString parameter types. After deleting a parameter, wait for at least 30 seconds to create a parameter with the same name. Note Parameters are only available in the AWS Region where they were created. The following procedure walks you through the process of creating a parameter in the Parameter Store console. You can create String, StringList, and SecureString parameter types from the console. Parameter Store 2026 AWS Systems Manager To create a parameter User Guide 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Parameter Store. 3. Choose Create parameter. 4. In the Name box, enter a hierarchy and a name. For example, enter /Test/helloWorld. For more information about parameter hierarchies, see Working with parameter hierarchies in Parameter Store. 5. 6. In the Description box, type a description that identifies this parameter as a test parameter. For Parameter tier choose either Standard or Advanced. For more information about advanced parameters, see Managing parameter tiers. 7. For Type, choose String, StringList, or SecureString. • If you choose String, the Data type field is displayed. If you're creating a parameter to hold the resource ID for an Amazon Machine Image (AMI), select aws:ec2:image. Otherwise, keep the default text selected. • If you choose SecureString, the KMS Key ID field is displayed. If you don't provide an AWS Key Management Service AWS KMS key ID, an AWS KMS key Amazon Resource Name (ARN), an alias name, or an alias ARN, then the system uses alias/aws/ssm, which is the AWS managed key for Systems Manager. If you don't want to
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.