“Cómo ejecutar el script de shell en la instancia de EC2” Código de respuesta

Instancia de almuerzo EC2 de AWS CLI

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

Instancia de almuerzo EC2 de AWS CLI

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

Cómo ejecutar el script de shell en la instancia de 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

Respuestas similares a “Cómo ejecutar el script de shell en la instancia de EC2”

Preguntas similares a “Cómo ejecutar el script de shell en la instancia de EC2”

Más respuestas relacionadas con “Cómo ejecutar el script de shell en la instancia de EC2” en Shell/Bash

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código