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

Issue 95 lambda alias version #96

Merged
merged 2 commits into from
Jan 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,47 @@ object `AWS::Lambda::EventSourceMapping` extends DefaultJsonProtocol {
implicit val format: JsonFormat[`AWS::Lambda::EventSourceMapping`] = jsonFormat7(`AWS::Lambda::EventSourceMapping`.apply)
}

case class `AWS::Lambda::Version`(name: String,
FunctionName: Token[ResourceRef[`AWS::Lambda::Function`]],
Description: Option[String] = None,
CodeSha256: Option[Token[String]] = None,
override val Condition: Option[ConditionRef] = None)
extends Resource[`AWS::Lambda::Version`]
with HasArn {

override def arn = `Fn::GetAtt`(Seq(name, "Arn"))

def version = `Fn::GetAtt`(Seq(name, "Version"))

def when(newCondition: Option[ConditionRef] = Condition) = copy(Condition = newCondition)
}

object `AWS::Lambda::Version` extends DefaultJsonProtocol {
implicit val format: JsonFormat[`AWS::Lambda::Version`] = jsonFormat5(
`AWS::Lambda::Version`.apply)
}

case class `AWS::Lambda::Alias`(name: String,
AliasName: Token[String],
FunctionName: Token[ResourceRef[`AWS::Lambda::Function`]],
FunctionVersion: Token[String],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be a ResourceRef[AWS::Lambda::Version]. If we ever needed to pass it in as a parameter we could make a special type for that as well (see something like #84).

Description: Option[Token[String]] = None,
override val Condition: Option[ConditionRef] = None)
extends Resource[`AWS::Lambda::Alias`]
with HasArn {

override def arn = `Fn::GetAtt`(Seq(name, "Arn"))

def when(newCondition: Option[ConditionRef] = Condition) = copy(Condition = newCondition)
}

object `AWS::Lambda::Alias` extends DefaultJsonProtocol {
//implicit val format: JsonFormat[`AWS::Lambda::Alias`] = jsonFormat6(`AWS::Lambda::Alias`.apply)
implicit val format: JsonFormat[`AWS::Lambda::Alias`] = jsonFormat(`AWS::Lambda::Alias`.apply,
"name",
"Name",
"FunctionName",
"FunctionVersion",
"Description",
"Condition")
}