puppetlabs-toy-chest / puppetlabs-aws

Puppet module for managing AWS resources to build out infrastructure
Apache License 2.0
187 stars 219 forks source link

Security Group Not found #500

Open pablogmorales opened 6 years ago

pablogmorales commented 6 years ago

Hi Do not know if this is a bug or a configuration issue, but it seems it cannot find any security group within my configuration

Error: Security groups 'Puppet Server' not found in VPCs 'vpc-4bede32f'
Error: /Stage[main]/Main/Ec2_instance[instance-from-puppet]/ensure: change from 'absent' to 'running' failed: Security groups 'Puppet Server' not found in VPCs 'vpc-4bede32f'

puppet resource ec2_securitygroup|grep Puppet
ec2_securitygroup { 'Puppet Server':
  description => 'Puppet Server'
ec2_instance { 'instance-from-puppet':
  ensure            => running,
  region            => 'us-east-1',
  availability_zone => 'us-east-1a',
  image_id          => 'ami-f2ec8c88', # you need to select your own AMI
  instance_type     => 't2.micro',
  key_name          => 'puppetserver',
  subnet            => 'subnet-d4c04d8c',
  security_groups   => ['Puppet Server'],
  tags              => {
    tag_name => 'puppetserver',
  },
}

Thanks Regards

tarunmangla07 commented 6 years ago

You should use the subnet name rather than the subnet id, from your manifests i can see that you are using the subnet id .hope this helps

gregohardy commented 6 years ago

Did that help?

pablogmorales commented 6 years ago

HI Greg, Sorry, did not get your last notification, maybe went to spam folder, I'll check the configuration and will let you know

Thank you very much for your time and support. Regards

pablogmorales commented 5 years ago

Hello, this is what Im getting now:

ec2_instance { 'instance-from-puppet': ensure => running, region => 'us-east-1', availability_zone => 'us-east-1a', image_id => 'ami-b77a72c8', # you need to select your own AMI instance_type => 't2.micro', key_name => 'keyname', subnet => 'subnet-0589332f', security_groups => ['sg-b9c46ec9'], tags => { tag_name => 'provisioned_by_puppet', }, } change from 'absent' to 'running' failed: When specifying a subnet you must specify a security group associated with a VPC

That security group id is valid, is the one currently associated to an instance, what am I doing wrong?

Thanks

pablogmorales commented 5 years ago

as as side note my subnet name is the same as the subnet id

pablogmorales commented 5 years ago

I got it working now, I have to use the names instead of the ID's name..

Thank you very much!