简体   繁体   English

如何使用厨师食谱提供 aws 资源?

[英]how to provision aws resource using chef cookbook?

Chef server for AWS INFRASTRUCTURE provisioning用于 AWS INFRASTRUCTURE 配置的 Chef 服务器

I'm using aws cook book in chef and I'm adding vpc creation:我在厨师中使用 aws 烹饪书,我正在添加 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

I'm experiencing "undefined method" error我遇到“未定义方法”错误

NoMethodError无方法错误

undefined method `aws_vpc' for cookbook: chef-aws, recipe: default :Chef::Recipe

I found an alternate solution for chef aws provisioning.我找到了主厨 aws 配置的替代解决方案。

  1. Using aws cookbook in supermarket.在超市使用 aws 食谱。

  2. To create a cloudformation stack in aws在 aws 中创建 cloudformation 堆栈

  3. Using cloud formation template then this creating an own infra in aws.使用云形成模板,然后在 aws 中创建自己的基础设施。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM