404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.140.188.79: ~ $
**Example 1: To run a command on one or more remote instances**

The following ``send-command`` example runs an ``echo`` command on a target instance. ::

    aws ssm send-command \
        --document-name "AWS-RunShellScript" \
        --parameters 'commands=["echo HelloWorld"]' \
        --targets "Key=instanceids,Values=i-1234567890abcdef0" \
        --comment "echo HelloWorld"
  
Output::

    {
        "Command": {
            "CommandId": "92853adf-ba41-4cd6-9a88-142d1EXAMPLE",
            "DocumentName": "AWS-RunShellScript",
            "DocumentVersion": "",
            "Comment": "echo HelloWorld",
            "ExpiresAfter": 1550181014.717,
            "Parameters": {
                "commands": [
                    "echo HelloWorld"
                ]
            },
            "InstanceIds": [
                "i-0f00f008a2dcbefe2"
            ],
            "Targets": [],
            "RequestedDateTime": 1550173814.717,
            "Status": "Pending",
            "StatusDetails": "Pending",
            "OutputS3BucketName": "",
            "OutputS3KeyPrefix": "",
            "MaxConcurrency": "50",
            "MaxErrors": "0",
            "TargetCount": 1,
            "CompletedCount": 0,
            "ErrorCount": 0,
            "DeliveryTimedOutCount": 0,
            "ServiceRole": "",
            "NotificationConfig": {
                "NotificationArn": "",
                "NotificationEvents": [],
                "NotificationType": ""
            },
            "CloudWatchOutputConfig": {
                "CloudWatchLogGroupName": "",
                "CloudWatchOutputEnabled": false
            }
        }
    }

For more information, see `Running Commands Using Systems Manager Run Command <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html>`__ in the *AWS Systems Manager User Guide*.

**Examle 2: To get IP information about an instance**

The following ``send-command`` example retrieves the IP information about an instance. ::

    aws ssm send-command \
        --instance-ids "i-1234567890abcdef0" \
        --document-name "AWS-RunShellScript" \
        --comment "IP config" \
        --parameters "commands=ifconfig"

See example 1 for sample output.

For more information, see `Running Commands Using Systems Manager Run Command <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html>`__ in the *AWS Systems Manager User Guide*.

**Example 3: To run a command on instances with specific tags**

The following ``send-command`` example runs a command on instances that have the tag key "ENV" and the value "Dev". ::

    aws ssm send-command \
        --targets "Key=tag:ENV,Values=Dev" \
        --document-name "AWS-RunShellScript" \
        --parameters "commands=ifconfig"

See example 1 for sample output.

For more information, see `Running Commands Using Systems Manager Run Command <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html>`__ in the *AWS Systems Manager User Guide*.

**Example 4: To run a command that sends SNS notifications**

The following ``send-command`` example runs a command that sends SNS notifications for all notification events and the ``Command`` notification type. ::

    aws ssm send-command \
        --instance-ids "i-1234567890abcdef0" \
        --document-name "AWS-RunShellScript" \
        --comment "IP config" \
        --parameters "commands=ifconfig" \
        --service-role-arn "arn:aws:iam::123456789012:role/SNS_Role" \
        --notification-config "NotificationArn=arn:aws:sns:us-east-1:123456789012:SNSTopicName,NotificationEvents=All,NotificationType=Command"

See example 1 for sample output.

For more information, see `Running Commands Using Systems Manager Run Command <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html>`__ in the *AWS Systems Manager User Guide*.

**Example 5: To run a command that outputs to S3 and CloudWatch**

The following ``send-command`` example runs a command that outputs command details to an S3 bucket and to a CloudWatch Logs log group. ::

    aws ssm send-command \
        --instance-ids "i-1234567890abcdef0" \
        --document-name "AWS-RunShellScript" \
        --comment "IP config" \
        --parameters "commands=ifconfig" \
        --output-s3-bucket-name "s3-bucket-name" \
        --output-s3-key-prefix "runcommand" \
        --cloud-watch-output-config "CloudWatchOutputEnabled=true,CloudWatchLogGroupName=CWLGroupName"

See example 1 for sample output.

For more information, see `Running Commands Using Systems Manager Run Command <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html>`__ in the *AWS Systems Manager User Guide*.

**Example 6: To run commands on multiple instances with different tags**

The following ``send-command`` example runs a command on instances with two different tag keys and values. ::

    aws ssm send-command \
        --document-name "AWS-RunPowerShellScript" \
        --parameters commands=["echo helloWorld"] \
        --targets Key=tag:Env,Values=Dev Key=tag:Role,Values=WebServers

See example 1 for sample output.

For more information, see `Running Commands Using Systems Manager Run Command <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html>`__ in the *AWS Systems Manager User Guide*.

**Example 7: To target multiple instances with the same tag key**

The following ``send-command`` example runs a command on instances that have the same tag key but with different values. ::

    aws ssm send-command \
        --document-name "AWS-RunPowerShellScript" \
        --parameters commands=["echo helloWorld"] \
        --targets Key=tag:Env,Values=Dev,Test

See example 1 for sample output.

For more information, see `Running Commands Using Systems Manager Run Command <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html>`__ in the *AWS Systems Manager User Guide*.

**Example 8: To run a command that uses a shared document**

The following ``send-command`` example runs a shared document on a target instance. ::

    aws ssm send-command \
        --document-name "arn:aws:ssm:us-east-1:123456789012:document/ExampleDocument" \
        --targets "Key=instanceids,Values=i-1234567890abcdef0"

See example 1 for sample output.

For more information, see `Using shared SSM documents <https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-using-shared.html>`__ in the *AWS Systems Manager User Guide*.

Filemanager

Name Type Size Permission Actions
add-tags-to-resource.rst File 1.26 KB 0644
associate-ops-item-related-item.rst File 790 B 0644
cancel-command.rst File 861 B 0644
cancel-maintenance-window-execution.rst File 633 B 0755
create-activation.rst File 673 B 0644
create-association-batch.rst File 2.13 KB 0644
create-association.rst File 4.37 KB 0644
create-document.rst File 1.83 KB 0644
create-maintenance-window.rst File 1.53 KB 0755
create-ops-item.rst File 883 B 0644
create-patch-baseline.rst File 5.15 KB 0755
create-resource-data-sync.rst File 304 B 0644
delete-activation.rst File 491 B 0644
delete-association.rst File 1.12 KB 0644
delete-document.rst File 387 B 0644
delete-inventory.rst File 982 B 0644
delete-maintenance-window.rst File 493 B 0755
delete-parameter.rst File 416 B 0644
delete-parameters.rst File 655 B 0644
delete-patch-baseline.rst File 501 B 0755
delete-resource-data-sync.rst File 208 B 0644
deregister-managed-instance.rst File 522 B 0644
deregister-patch-baseline-for-patch-group.rst File 662 B 0755
deregister-target-from-maintenance-window.rst File 720 B 0755
deregister-task-from-maintenance-window.rst File 715 B 0755
describe-activations.rst File 1.26 KB 0644
describe-association-execution-targets.rst File 1.25 KB 0644
describe-association-executions.rst File 2.89 KB 0644
describe-association.rst File 3.85 KB 0644
describe-automation-executions.rst File 1.31 KB 0644
describe-automation-step-executions.rst File 1.73 KB 0644
describe-available-patches.rst File 3.99 KB 0755
describe-document-permission.rst File 719 B 0644
describe-document.rst File 1.75 KB 0644
describe-effective-instance-associations.rst File 1.89 KB 0755
describe-effective-patches-for-patch-baseline.rst File 3.88 KB 0755
describe-instance-associations-status.rst File 1.18 KB 0755
describe-instance-information.rst File 2.03 KB 0644
describe-instance-patch-states-for-patch-group.rst File 5.69 KB 0755
describe-instance-patch-states.rst File 1.54 KB 0755
describe-instance-patches.rst File 2.01 KB 0755
describe-inventory-deletions.rst File 2.25 KB 0644
describe-maintenance-window-execution-task-invocations.rst File 1.36 KB 0755
describe-maintenance-window-execution-tasks.rst File 1.05 KB 0755
describe-maintenance-window-executions.rst File 3.19 KB 0755
describe-maintenance-window-schedule.rst File 1.86 KB 0755
describe-maintenance-window-targets.rst File 2.61 KB 0755
describe-maintenance-window-tasks.rst File 7.29 KB 0755
describe-maintenance-windows-for-target.rst File 844 B 0755
describe-maintenance-windows.rst File 1.71 KB 0755
describe-ops-items.rst File 3.06 KB 0644
describe-parameters.rst File 3.42 KB 0644
describe-patch-baselines.rst File 2.08 KB 0755
describe-patch-group-state.rst File 1.17 KB 0755
describe-patch-groups.rst File 1.38 KB 0755
describe-patch-properties.rst File 1.53 KB 0644
describe-sessions.rst File 2.67 KB 0755
disassociate-ops-item-related-item.rst File 599 B 0644
get-automation-execution.rst File 2.21 KB 0644
get-calendar-state.rst File 1.04 KB 0644
get-command-invocation.rst File 1.61 KB 0644
get-connection-status.rst File 348 B 0755
get-default-patch-baseline.rst File 1.08 KB 0755
get-deployable-patch-snapshot-for-instance.rst File 1.62 KB 0755
get-document.rst File 1.98 KB 0644
get-inventory-schema.rst File 1.41 KB 0755
get-inventory.rst File 1.13 KB 0755
get-maintenance-window-execution-task-invocation.rst File 1.49 KB 0755
get-maintenance-window-execution-task.rst File 2.24 KB 0755
get-maintenance-window-execution.rst File 861 B 0755
get-maintenance-window-task.rst File 1.74 KB 0755
get-maintenance-window.rst File 899 B 0755
get-ops-item.rst File 2.33 KB 0644
get-ops-summary.rst File 4.41 KB 0644
get-parameter-history.rst File 1.96 KB 0644
get-parameter.rst File 3.3 KB 0644
get-parameters-by-path.rst File 1.2 KB 0644
get-parameters.rst File 3.44 KB 0644
get-patch-baseline-for-patch-group.rst File 755 B 0755
get-patch-baseline.rst File 1.71 KB 0755
get-service-setting.rst File 980 B 0644
label-parameter-version.rst File 1.11 KB 0644
list-association-versions.rst File 1.4 KB 0644
list-associations.rst File 3.54 KB 0644
list-command-invocations.rst File 4.9 KB 0644
list-commands.rst File 6.71 KB 0644
list-compliance-items.rst File 2.15 KB 0644
list-compliance-summaries.rst File 2.17 KB 0644
list-document-metadata-history.rst File 1.55 KB 0644
list-document-versions.rst File 748 B 0644
list-documents.rst File 1.95 KB 0644
list-inventory-entries.rst File 1.54 KB 0755
list-ops-item-related-items.rst File 1.39 KB 0644
list-resource-compliance-summaries.rst File 2.8 KB 0644
list-resource-data-sync.rst File 802 B 0644
list-tags-for-resource.rst File 688 B 0644
modify-document-permission.rst File 500 B 0644
put-compliance-items.rst File 504 B 0644
put-inventory.rst File 620 B 0755
put-parameter.rst File 5.24 KB 0644
register-default-patch-baseline.rst File 980 B 0755
register-patch-baseline-for-patch-group.rst File 759 B 0755
register-target-with-maintenance-window.rst File 3.04 KB 0755
register-task-with-maintenance-window.rst File 6.27 KB 0755
remove-tags-from-resource.rst File 488 B 0644
reset-service-setting.rst File 1003 B 0644
resume-session.rst File 1.21 KB 0644
send-automation-signal.rst File 554 B 0644
send-command.rst File 6.5 KB 0644
start-associations-once.rst File 553 B 0644
start-automation-execution.rst File 1.21 KB 0644
start-change-request-execution.rst File 3.03 KB 0644
start-session.rst File 1.34 KB 0644
stop-automation-execution.rst File 487 B 0644
terminate-session.rst File 639 B 0755
unlabel-parameter-version.rst File 734 B 0644
update-association-status.rst File 1.78 KB 0644
update-association.rst File 2.78 KB 0755
update-document-default-version.rst File 605 B 0644
update-document-metadata.rst File 641 B 0644
update-document.rst File 1.64 KB 0755
update-maintenance-window-target.rst File 1021 B 0755
update-maintenance-window-task.rst File 1.62 KB 0755
update-maintenance-window.rst File 1.23 KB 0755
update-managed-instance-role.rst File 544 B 0644
update-ops-item.rst File 806 B 0644
update-patch-baseline.rst File 2.21 KB 0755
update-resource-data-sync.rst File 648 B 0644
update-service-setting.rst File 661 B 0644