Skip to content

Commit

Permalink
Merge pull request #31 from MonsantoCo/RDSMaker
Browse files Browse the repository at this point in the history
adding in a mechanism to make a SecurityGroupRoutable from a DBInstance
  • Loading branch information
ddgenome committed Oct 21, 2015
2 parents 3b0875d + 9da607d commit dd15972
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ object SecurityGroupRoutableMaker {
def withSG(r: `AWS::AutoScaling::LaunchConfiguration`, sgr: ResourceRef[`AWS::EC2::SecurityGroup`]) =
r.copy(SecurityGroups = r.SecurityGroups :+ Token.fromAny(sgr))
}

implicit object RDSMaker extends SecurityGroupRoutableMaker[`AWS::RDS::DBInstance`] {
def withSG(r: `AWS::RDS::DBInstance`, sgr: ResourceRef[`AWS::EC2::SecurityGroup`]) =
r.copy(VPCSecurityGroups = Some(r.VPCSecurityGroups.getOrElse(Seq()) :+ sgr))
}
}

case class SecurityGroupRoutable[R <: Resource[R]](resource: R, sg: `AWS::EC2::SecurityGroup`, extras: Option[Seq[Resource[_]]] = None) {
Expand Down

0 comments on commit dd15972

Please sign in to comment.