Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Raise exception if ip_ranges or groups have duplicate values. #16

Merged
merged 1 commit into from
Jul 26, 2015

Conversation

satoruh
Copy link
Contributor

@satoruh satoruh commented Jul 25, 2015

Adding validation codes for permission.

Problem

At first, apply the following DSL.

ec2 "vpc-XXXXXXXX" do
  security_group "default" do
    description "default VPC security group"

    ingress do
      permission :tcp, 443..443 do
        ip_ranges("192.0.2.1/32")   

        groups("default")
      end 
    end 

    egress do
      permission :any do
        ip_ranges("0.0.0.0/0")   
      end 
    end 
  end 
end

And apply the following DSL.

ec2 "vpc-XXXXXXXX" do
  security_group "default" do
    description "default VPC security group"

    ingress do
      permission :tcp, 443..443 do
        ip_ranges("192.0.2.1/32", "192.0.2.1/32")   

        groups("default", "default")   
      end 
    end 

    egress do
      permission :any do
        ip_ranges("0.0.0.0/0")   
      end 
    end 
  end 
end

Then piculet shows following messages, but do nothing.

Apply `Groupfile` to SecurityGroup
Update Permission: vpc-XXXXXXXX > default(ingress) > tcp 443..443
No change

@winebarrel
Copy link
Collaborator

Thanks for your PR 👍

winebarrel pushed a commit that referenced this pull request Jul 26, 2015
Raise exception if ip_ranges or groups have duplicate values.
@winebarrel winebarrel merged commit 686f554 into codenize-tools:master Jul 26, 2015
@winebarrel
Copy link
Collaborator

v0.2.9.beta has been released.
Please try it out. 😃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants