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

Inconsistent availability of resource matchers #274

Closed
walterdolce opened this issue May 4, 2017 · 8 comments
Closed

Inconsistent availability of resource matchers #274

walterdolce opened this issue May 4, 2017 · 8 comments

Comments

@walterdolce
Copy link
Contributor

Looks like resource matchers are not shared across all resource types.

Every resource matcher should be available to use in a resource type whenever the resource type supports that. Please see below.

# This will not work. But in AWS you can attach a tag to an ELB..
describe elb("some-elb") do
   it { should have_tag("Environment").value("development") }
end

# This will work as normal
describe autoscaling_group("some-asg") do
    it { should have_tag("Environment").value("development") }
end

As you will see, there's inconsistency of resource matchers. It would be nice to bring consistency to those as this creates confusion and prevent proper testing of AWS resources.

Many thanks.

@k1LoW
Copy link
Owner

k1LoW commented May 5, 2017

Hi @walterdolce. Thank you for your request.

Why have_tag matchers are not shared

It is because the method of getting tag is different for each AWS resource.

So, To have have_tag on all resources, more contribution is needed.

Regards.

@IssueHuntBot
Copy link

@issuehuntfest has funded $20.00 to this issue. See it on IssueHunt

@garettmd
Copy link
Contributor

@k1LoW I'm interested in working this issue. Reading contributing.md, it appears that I'd want to go the "Add new account attribute type" route. However, from what I understand that involved adding a new type, which I don’t think is what we want here.

For example, I'm trying to add have_tags to the alb resource type. When running bin/toolbox template alb_tags -a it prompts me to create the new type.

It makes more sense to me to add this to the alb type file and its corresponding finder file, but I'm new to the codebase (and Ruby for that matter).

Which of those two approaches makes the most sense?

@k1LoW
Copy link
Owner

k1LoW commented May 23, 2019

Hi @garettmd

Add new account attribute type

Sorry, bin/toolbox template support only new resource type.

If you want to add new attribute or matcher, you write ruby code like https://github.com/k1LoW/awspec/pull/446/files .

Thanks !

@garettmd
Copy link
Contributor

Thanks @k1LoW that helps. I'll see if I can get a good PR out this week

@garettmd
Copy link
Contributor

@k1LoW I just opened #472 for this

@glasswalk3r
Copy link
Contributor

@k1LoW , this issue can be closed since the #472 was merge a long time ago.

@k1LoW
Copy link
Owner

k1LoW commented Jun 21, 2021

@glasswalk3r Thank you !

@k1LoW k1LoW closed this as completed Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants