使用CloudFormation部署所需的资源。切换到us-east-1
区域,使用以下的模板地址创建资源:
https://pingfan.s3.amazonaws.com/files/emr-roadshow.template
为CloudFormation命名为emr-roadshow
,进入到最后一步点击创建。
等待CloudFormation Stack创建完成。
在EC2页面找到Cloud 9机器,更改它的IAM Role:
绑定上emr-roadshow-iamrolesCloud9Admin这个Role:
进入到Cloud 9页面,打开创建出来的Cloud 9, 并进入控制台:
执行命令,安装aws cli v2, 并使用上面绑定的Role:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
/usr/local/bin/aws cloud9 update-environment --environment-id $C9_PID --managed-credentials-action DISABLE
rm -vf ${HOME}/.aws/credentials
确认当前使用的Role已经生效:
WSParticipantRole:~/environment $ aws sts get-caller-identity
{
"UserId": "AROATGFBBI3UPZEEYEKUC:i-0e82a09ee53d179ad",
"Account": "219381057256",
"Arn": "arn:aws:sts::219381057256:assumed-role/emr-roadshow-iamrolesCloud9Admin928AB599-PPRH5I4r6TlB/i-0e82a09ee53d179ad"
}
安装后面所需要的工具:
curl https://raw.githubusercontent.com/aws-samples/stream-emr-on-eks/workshop/deployment/app_code/post-deployment.sh -o post-deployment.sh
sh post-deployment.sh
source ~/.bash_profile