投稿

ラベル(EC2)が付いた投稿を表示しています

CentOS7で利用するVagrantFileのまとめ

CentoOS環境で利用するVagrantFileを整理しておく。 VagrantFileは以下の通り。 Vagrantで生成したCentOSのバージョン確認 $ cat /etc/redhat-release CentOS Linux release 7.8.2003 (Core) VagrantFileは以下の通り。 virtualenvインストール用shell $virtualenv = <<SHELL if ! type /usr/local/bin/virtualenv > /dev/null 2 > &1; then # echo $PATHは以下の結果となり、/usr/local/binは含まれていない。 # /usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin yum update yum install -y python3 pip3 install virtualenv # vagrantユーザとしてvirtualenvとansibleをインストール su -c "source /vagrant/provision/bash/install_ansible.sh" vagrant # vagrantユーザとしてaws apiをインストール su -c "source /vagrant/provision/bash/install_awsapi.sh" vagrant fi SHELL Vagrant.configure("2") do |config| config.vm.box = "bento/centos-7" config.vm.box_version = "202006.16.0" config.vm.network "private_network", ip: "192.168.33.10" config.vm.provider "virtualbox" do |vm| # vm name vm.n...

Ubuntu20.04LTS上でEC2 APIを使うまで

イメージ
ec2-api-tools を利用することになったのでメモっておく。 まずは、キーペアの作成を行う。 キーペアを作成することで、端末からapiを使ってec2にアクセスするために必要となる プライベートキー(private-key.pem)とシークレットキー(certificate.pem)を入手、生成することができる。 AIMのユーザー画面の認証情報タブで「アクセスキーの作成」ボタンを押下し、アクセスキーをダウンロードする。(private-key.pem) そのprivate-keyをもとにopensslコマンドを使ってCertificate keyを作成する。 $ openssl req -new -x509 -nodes -sha256 -days 365 -key private-key.pem -outform PEM -out certificate.pem You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:JP State or Province Name (full name) [Some-State]:Osaka Locality Name (eg, city) []:Osaka Organization Name (eg, company) [Internet Widgits Pty Ltd]:Private Organizational Unit Name (eg, section) []:Private Common Name ...