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
25
Help us understand the problem. What is going on with this article?
@yuki-k

VagrantでAWSを利用する

More than 5 years have passed since last update.

vagrant-awsのインストール

VagrantでAWSを利用するにはvagrant-awsというナイスなプラグインがある。

vagrant plugin install vagrant-aws

使い方はGitHubで。

Vagrantfileの設定

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "dummy"
  config.vm.provider :aws do |aws, override|
    aws.access_key_id = "ACCESS KEY"
    aws.secret_access_key = "SECRET ACCESS KEY"
    aws.keypair_name = "KEYPAIR"
    aws.ami = "ami-a1124fa0"
    aws.region = "ap-northeast-1"
    override.ssh.username = "ubuntu"
    override.ssh.private_key_path = "/path/to/aws.pem"
  end

  config.vm.define "host1" do |m|
    m.vm.provider :aws do |aws, override|
      aws.instance_type = "t2.micro"
      aws.security_groups = ["default"]
    end
  end

end

Acess Key IDとSecret Access Keyが分からない場合は、AWSのヘルプを参照。

ami-a1124fa0はUbuntu 14.04 LTS 64bit。

インスタンスを立ち上げてみる

vagrant up --provider aws host1

実行の後、AWS Management ConsoleのEC2のInstancesで、新しいインスタンスが立ち上がっているのが確認できる。

25
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
yuki-k

Comments

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