Here below is the puppet code to provision an EC2 instance on AWS cloud.
image_id => 'ami-916f59f4',
instance_type => 't2.micro',
security_groups => ['mySecurityGroup'],
subnet => 'subnet-aff937d5',
ec2_securitygroup { 'mySecurityGroup':
region => 'us-east-2',
ensure => present,
description => 'Security group for aws Ec2 instance',
ingress => [{
protocol => 'tcp',
port => 8080,
cidr => '0.0.0.0/0',
},{
protocol => 'tcp',
port => 80,
cidr => '0.0.0.0/0',
},{
protocol => 'tcp',
port => 22,
cidr => '0.0.0.0/0',
}],
tags => {
tag_name => 'mySecurityGroup',
},
}

No comments:
Post a Comment