如何使用厨师食谱配置AWS资源?

问题描述 投票:-1回答:1

用于AWS INFRASTRUCTURE设置的首席服务器

我正在厨师中使用AWS Cook Book,并添加了VPC创建:

my_vpc = aws_vpc 'my_vpc' do
  cidr_block '10.0.0.0/24'
  main_routes '0.0.0.0/0' => :internet_gateway
  internet_gateway true`enter code here`
end

my_sg = aws_security_group 'my_sg' do
  vpc lazy { my_vpc.aws_object.id }
  inbound_rules '0.0.0.0/0' => [ 22, 80 ]
end

my_subnet = aws_subnet 'my_subnet' do
  vpc lazy { my_vpc.aws_object.id }
  cidr_block '10.0.0.0/24'
  availability_zone 'eu-west-1a'
  map_public_ip_on_launch true
end

machine 'my_machine' do
  machine_options(
    lazy do
      {
        bootstrap_options: {
          subnet_id: my_subnet.aws_object.id,
          security_group_ids: [my_sg.aws_object.id]
        }
      }
    end
  )
end

我遇到“未定义的方法”错误

NoMethodError

undefined method `aws_vpc' for cookbook: chef-aws, recipe: default :Chef::Recipe
amazon-web-services chef
1个回答
0
投票

我找到了厨师aws供应的替代解决方案。

  1. 在超市使用aws食谱。

  2. 要在AWS中创建cloudformation堆栈

  3. 使用云形成模板然后在AWS中创建自己的基础结构。

© www.soinside.com 2019 - 2024. All rights reserved.