Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Adding new release 0.1.0 Oct 8, 2018
examples Adding new release 0.3.0 Apr 1, 2019
lib/puppet Adding new release 0.3.0 Apr 1, 2019
plans Adding new release 0.2.0 Dec 12, 2018
spec Adding new release 0.2.0 Dec 12, 2018
tasks Adding new release 0.3.0 Apr 1, 2019
.gitattributes Adding new release 0.2.0 Dec 12, 2018
.gitignore Adding new release 0.2.0 Dec 12, 2018
.pdkignore Adding new release 0.2.0 Dec 12, 2018
.rspec Adding new release 0.2.0 Dec 12, 2018
.sync.yml Adding new release 0.3.0 Apr 1, 2019
.travis.yml Adding new release 0.2.0 Dec 12, 2018
.yardopts Adding new release 0.2.0 Dec 12, 2018
CHANGELOG.md Adding new release 0.3.0 Apr 1, 2019
Gemfile Adding new release 0.3.0 Apr 1, 2019
README.md Adding new release 0.3.0 Apr 1, 2019
Rakefile Adding new release 0.2.0 Dec 12, 2018
aws_customer_gateway.md Adding new release 0.3.0 Apr 1, 2019
aws_db_cluster.md Adding new release 0.3.0 Apr 1, 2019
aws_db_cluster_parameter_group.md Adding new release 0.3.0 Apr 1, 2019
aws_db_cluster_snapshot.md Adding new release 0.3.0 Apr 1, 2019
aws_db_instance.md Adding new release 0.3.0 Apr 1, 2019
aws_db_parameter_group.md Adding new release 0.2.0 Dec 12, 2018
aws_db_security_group.md Adding new release 0.1.0 Oct 8, 2018
aws_db_snapshot.md Adding new release 0.3.0 Apr 1, 2019
aws_db_subnet_group.md Adding new release 0.1.0 Oct 8, 2018
aws_egress_only_internet_gateway.md Adding new release 0.3.0 Apr 1, 2019
aws_event_subscription.md Adding new release 0.3.0 Apr 1, 2019
aws_file_system.md Adding new release 0.3.0 Apr 1, 2019
aws_instances.md Adding new release 0.3.0 Apr 1, 2019
aws_internet_gateway.md Adding new release 0.3.0 Apr 1, 2019
aws_key_pair.md Adding new release 0.3.0 Apr 1, 2019
aws_listener.md Adding new release 0.3.0 Apr 1, 2019
aws_load_balancer.md Adding new release 0.3.0 Apr 1, 2019
aws_mount_target.md Adding new release 0.3.0 Apr 1, 2019
aws_network_interface.md Adding new release 0.3.0 Apr 1, 2019
aws_option_group.md Adding new release 0.1.0 Oct 8, 2018
aws_placement_group.md Adding new release 0.3.0 Apr 1, 2019
aws_route_table.md Adding new release 0.3.0 Apr 1, 2019
aws_rule.md Adding new release 0.3.0 Apr 1, 2019
aws_security_group.md Adding new release 0.3.0 Apr 1, 2019
aws_subnet.md Adding new release 0.3.0 Apr 1, 2019
aws_table.md Adding new release 0.3.0 Apr 1, 2019
aws_tags.md Adding new release 0.3.0 Apr 1, 2019
aws_target_group.md Adding new release 0.3.0 Apr 1, 2019
aws_volume.md Adding new release 0.3.0 Apr 1, 2019
aws_vpc.md Adding new release 0.3.0 Apr 1, 2019
aws_vpn_gateway.md Adding new release 0.3.0 Apr 1, 2019
metadata.json Adding new release 0.3.0 Apr 1, 2019

README.md

Amazon AWS

Table of contents

  1. Description
  2. Setup
  3. Usage
  4. Reference

Description

Amazon AWS exposes an API for creating and managing its Infrastructure as a Service platform. By leveraging the power of Puppet code, the module enables you to interact with the AWS API to manage your AWS resources, and provides you with the ability to run Puppet tasks on target EC2 instances.

The module is generated from the AWS API specifications and utilizes the AWS Ruby SDK. For additional information, see the AWS SDK for Ruby documentation.

Setup

Installing the module

Install the retries gem and the Amazon AWS Ruby SDK gem, using the same Ruby used by Puppet.

If using Puppet 4.x or higher, install the gems by running the following command:

/opt/puppetlabs/puppet/bin/gem install aws-sdk retries

Set the following environment variables specific to your AWS installation:

export AWS_ACCESS_KEY_ID=your_access_key_id
export AWS_SECRET_ACCESS_KEY=your_secret_access_key
export AWS_REGION=your_region

To install the module, run the following command:

puppet module install puppetlabs-amazon_aws

Validating the module

This module is compliant with the Puppet Development Kit (PDK), which provides the tool to help validate the modules's metadata, syntax, and style. When you run validations, PDK output tells you which validations it is running and notifies you of any errors or warnings it finds for each type of validation; syntax, code style, and metadata.

To run all validations against this module, run the following command:

pdk validate ruby
pdk validate metadata

To change validation behavior, add options flags to the command. For a complete list of command options and usage information, see the PDK command reference.

Usage

Create a virtual machine and subnet

Create an Ubuntu server v16.04:

aws_instances { your_vm:
  ensure             => 'present',
  image_id           => 'ami-c7e0c82c',
  min_count          => 1,
  max_count          => 1,
  key_name           => your-key-name,
  instance_type      => 't2.micro',
  subnet_id          => your-subnet-id,
  tag_specifications => [ { resource_type => "instance", tags => $tag } ]
}

Create a subnet:

aws_subnet{ your_subnet:
  name       => your_subnet,
  cidr_block => 10.9.12.0/24,
  vpc_id     => your_vpc_id,
  ensure     => present,
}

Run a task

Create a VPC:

bolt task run --nodes localhost amazon_aws::ec2_aws_create_vpc cidr_block=10.200.0.0/16

Examples

Note: Due to validation checks carried out by the Resource API, when running any example you receive a warning that states the provider returned data that did not match the Type schema for a specific resource. This warning message can be ignored. The warning is due to mismatched data between an object, and it's property.

In the examples directory you will find:

  • create_vm.pp to create a EC2 virtual machine.
  • create_subnet.pp to create a subnet for the virtual machine.
  • task_example.sh contains a number of sample tasks, each using Puppet Bolt:
    • create and describe Amazon VPCs.
    • create, list, describe, or delete an Amazon EKS cluster.
    • list or delete an AWS Storage Gateway.
    • create or list Amazon S3 buckets.

In the legacy examples directory are examples from the legacy module on how to create an infrastructure using this new module:

Reference

Resources

You can’t perform that action at this time.