“Comment exécuter le script shell dans l'instance EC2” Réponses codées

Déjeuner EC2 d'instance d'Aws CLI

aws ec2 run-instances \
    --image-id ami-0d1bf5b68307103c2 \
    --instance-type t2.micro
Envious Echidna

Déjeuner EC2 d'instance d'Aws CLI

aws ec2 run-instances \
    --image-id ami-0d1bf5b68307103c2 \
    --instance-type t2.micro \
    --key-name MyKeyPair
Envious Echidna

Comment exécuter le script shell dans l'instance EC2

has. In the Systems Manager console, in the navigation pane, under Shared Resources, select Managed Instances. Then, from the Actions menu, select the Run Command menu item.

remotely-run-commands-ec2-instance-systems-manager-4a
(Click to enlarge)

b. On the Run Command page, click in the search bar and select Document Name Prefix, click Equals, and type AWS-RunShellScript.

Now click on the pad to the right of AWS-RunShellScript. This document will update the Systems Manager agent on the instance.

Scroll down the page to reach the Targets pane, then check the box next to your managed EC2 instance.
remotely-run-commands-ec2-instance-systems-manager-4b
(Click to enlarge)

vs. Scroll down the page until you reach the Command Settings pane, and then insert the following command in the Commands text box:

sudo yum update -y

Finally, scroll down and select Run.

remotely-run-commands-ec2-instance-systems-manager-4c
(Click to enlarge)

d. When your script runs remotely on your managed EC2 instance, the Overall Status that displays is In Progress. It won't take long for the Overall Status to show Success. When this is the case, scroll down the page to reach the Targets and Outputs pane, then click on your instance ID. Your instance ID will be different from the one in the photo.
remotely-run-commands-ec2-instance-systems-manager-4d
(Click to enlarge)

e. On the Output to: i-XX page, click the Step 1 - Output pane header to view the output of the update instance command.
moi_crn

Réponses similaires à “Comment exécuter le script shell dans l'instance EC2”

Questions similaires à “Comment exécuter le script shell dans l'instance EC2”

Plus de réponses similaires à “Comment exécuter le script shell dans l'instance EC2” dans Shell/Bash

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code