Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom resources other than AWS/Custom cause a cfn_nag exception #52

Closed
twellspring opened this issue Jul 25, 2019 · 4 comments
Closed

Comments

@twellspring
Copy link

twellspring commented Jul 25, 2019

Custom resources with a type other than AWS or Custom cause a cfn_nag exception.
Update /lib/cfn-model/parser/cfn_parser.rb to allow other types of custom resources.

Example template

Resources:
  VPC:
    Type: Versent::Network::VPC
[...]
Transform:
  Name: "123456789012::VPC"

Error

$ cfn_nag --debug ./aws/*.yaml
/usr/local/bundle/gems/cfn-model-0.4.0/lib/cfn-model/parser/cfn_parser.rb:218:in `generate_resource_class_from_type': Unknown namespace in resource type: Versent (RuntimeError)
	from /usr/local/bundle/gems/cfn-model-0.4.0/lib/cfn-model/parser/cfn_parser.rb:189:in `rescue in class_from_type_name'

Reference:

@twellspring twellspring changed the title Custom resources other than AWS/Custom case a cfn_nag exception Custom resources other than AWS/Custom cause a cfn_nag exception Jul 25, 2019
@jeshan
Copy link

jeshan commented Sep 8, 2019

My scenario is about the same. I've boiled it down the following.

does not work (notice the dashes in Type):

AWSTemplateFormatVersion: '2010-09-09'
Resources:
  Res:
    Type: Custom::x-y-z

works:

AWSTemplateFormatVersion: '2010-09-09'
Resources:
  Res:
    Type: Custom::xyz

@phelewski
Copy link

This cfn_nag issue is also triggering this issue:

@ghost ghost self-assigned this Dec 7, 2019
ghost pushed a commit that referenced this issue Dec 7, 2019
@ghost
Copy link

ghost commented Dec 7, 2019

cfn-model 0.4.9 fixes this and cfn-nag 0.4.52 uses cfn-model 0.4.9

@ghost ghost closed this as completed Dec 7, 2019
@ghost
Copy link

ghost commented Dec 7, 2019

I fixed the hyphen issue too. Custom::x-y-z will create a class with the name Xyz

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants