08 - AWS Tips

最後更新: 2023-07-07

目錄


Troubleshoot

 

[1]

aws configure 後

"aws s3 ls" 出現

An error occurred (InvalidAccessKeyId) when calling the ListBuckets operation:
 The AWS Access Key Id you provided does not exist in our records.

原因: Env Var 優先

env | grep -i aws

unset AWS_SECRET_ACCESS_KEY
unset AWS_ACCESS_KEY_ID

 


user_data

 

Updates to this field will trigger a stop/start of the EC2 instance by default.

[格式1]

user_data = "${file("init.sh")}"

[格式2]

user_data = <<EOF
#!/bin/bash
echo "test create file /root/test.txt"
touch /root/test.txt
EOF

 

 

 

 

Creative Commons license icon Creative Commons license icon