Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What is going on with this article?
@class2glass

[やってみた]AWS EC2にCloudMapperを構築

More than 1 year has passed since last update.

環境

AWS EC2 Amazon Linux 2 AMI

構築手順

アクセスキーの取得

[IAM]-[ユーザ]-[ユーザ名]-[認証情報]より、アクセスキーを作成し、アクセスキーとシークレットアクセスキーを控える

CloudMapperの取得と配置

$ sudo yum install git -y
$ git clone https://github.com/duo-labs/cloudmapper.git

$ sudo yum install autoconf automake libtool python34-devel jq -y
$ sudo yum install python3.x86_64 python3-tkinter.x86_64  python3-devel.x86_64 python3-pip.noarch -y

nginxのインストール

$ sudo amazon-linux-extras install nginx1.12 -y
$ sudo systemctl enable nginx
$ sudo systemctl start nginx

Pythonモジュールのインストール

$ sudo pip3 install pyyaml
$ sudo pip3 install parliament
$ sudo pip3 install pyjq
$ sudo pip3 install netaddr
$ sudo pip3 install policyuniverse
$ sudo pip3 install jinja2

AWS CLIの環境設定

$ aws configure
AWS Access Key ID [None]: アクセスキー
AWS Secret Access Key [None]: シークレットアクセスキー
Default region name [None]: リージョン名(英語)
Default output format [None]: json

リージョン、アベイラビリティーゾーン、および ローカルゾーン

CloudMapperの初期設定

$ cd cloudmapper
$ AWS_ID=$(aws sts get-caller-identity \
    --query "Account" \
    --output text) \
    && echo ${AWS_ID}

$ python3 cloudmapper.py configure add-account --config-file config.json --name dev.io --id ${AWS_ID} --default DEFAULT
$ python3 cloudmapper.py configure add-account --config-file config.json --name demodemo --id ${AWS_ID}

利用方法

構成情報の取得

$ python3 cloudmapper.py collect --config config.json --account demodemo
$ python3 cloudmapper.py prepare --config config.json --account demodemo

アクセス

http://ec2-xxx.xxx.xxx.xxx.ap-northeast-1.compute.amazonaws.com/
1
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
comjo
社員有志で検証・研究した内容をシェアしています。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
1
Help us understand the problem. What is going on with this article?