Atualizar crialab.sh

This commit is contained in:
2026-09-16 19:05:34 +00:00
parent 994138238e
commit a610690f89
+2 -1
View File
@@ -87,7 +87,8 @@ EOF
if [[ "$create_key" == true ]]; then
key_file="$state_dir/$KEY_NAME.pem"
# noclobber impede sobrescrever uma chave preexistente; conteudo nunca vai para stdout.
(set -o noclobber; aw ec2 create-key-pair --key-name "$KEY_NAME" --key-type rsa --key-format pem \
# RSA/PEM sao os padroes; omitir flags novas permite usar a CLI antiga do Learner Lab.
(set -o noclobber; aw ec2 create-key-pair --key-name "$KEY_NAME" \
--tag-specifications "$(tags key-pair ssh)" --query KeyMaterial --output text > "$key_file")
chmod 600 "$key_file"
[[ -s "$key_file" ]] || { echo 'Arquivo da chave vazio.' >&2; return 1; }