“Como executar o script de shell na instância do EC2” Respostas de código

Instância do almoço EC2 da AWS CLI

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

Instância do almoço EC2 da AWS CLI

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

Como executar o script de shell na instância do 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

Respostas semelhantes a “Como executar o script de shell na instância do EC2”

Perguntas semelhantes a “Como executar o script de shell na instância do EC2”

Mais respostas relacionadas para “Como executar o script de shell na instância do EC2” em Shell/Bash

Procure respostas de código populares por idioma

Procurar outros idiomas de código