Puppet Class: terraform::aws

Defined in:
manifests/aws.pp

Summary

A short summary of the purpose of this class

Overview

A description of what this class does

Examples:

include terraform::aws

Parameters:

  • aws_access_key_id_var (Any) (defaults to: 'AKIAXJC2VJLMQPZ7EPON')
  • aws_secret_access_key_var (Any) (defaults to: 'wnRBNE0TV73w3BYKyRk44dGFZxyAq+xgZFGrecxx')
  • aws_credentail_directory (Any) (defaults to: '/root/.aws')
  • aws_credential_file (Any) (defaults to: '/root/.aws/credentials')


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'manifests/aws.pp', line 7

class terraform::aws (
	$aws_access_key_id_var		=	'AKIAXJC2VJLMQPZ7EPON',
	$aws_secret_access_key_var 	=	'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',
        $aws_credentail_directory       =       '/root/.aws',
	$aws_credential_file		=	'/root/.aws/credentials',
) {

  exec { 'get-aws-cli':
  	cwd     => '/tmp',
  	command => '/bin/wget https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip',
  	path    => ['/usr/bin', '/usr/sbin',],
  	creates => '/tmp/awscli-exe-linux-x86_64.zip',
        }

  exec { 'unzip-aws-cli':
  	cwd     => '/tmp',
  	command => '/usr/bin/unzip /tmp/awscli-exe-linux-x86_64.zip',
  	path    => ['/usr/bin', '/usr/sbin',],
  	creates => '/tmp/aws/',
        }
  
  
  exec { 'install-aws-cli':
  	cwd     => '/tmp',
  	command => '/tmp/aws/install',
  	path    => ['/usr/bin', '/usr/sbin',],
  	creates => '/usr/local/bin/aws',
        }

  file { $aws_credentail_directory:
	ensure  =>      directory,
	}
  file { $aws_credential_file:
	ensure	=>	file,
	mode	=>	'0644',
	owner	=>	'root',
	group	=>	'root',
	content	=>	template('terraform/awscreds.erb'),	
	}
}