puppetlabs-aws icon indicating copy to clipboard operation
puppetlabs-aws copied to clipboard

Security Group Not found

Open pablogmorales opened this issue 6 years ago • 6 comments

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

pablogmorales avatar Feb 28 '18 15:02 pablogmorales

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

tarunmangla07 avatar Apr 06 '18 12:04 tarunmangla07

Did that help?

gregohardy avatar Jul 18 '18 10:07 gregohardy

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 avatar Jul 18 '18 12:07 pablogmorales

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 avatar Aug 03 '18 17:08 pablogmorales

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

pablogmorales avatar Aug 03 '18 17:08 pablogmorales

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

Thank you very much!

pablogmorales avatar Aug 03 '18 17:08 pablogmorales