From 4d3df8cb468ca09546269df196fc30f53c59da52 Mon Sep 17 00:00:00 2001 From: Shimin Guo Date: Tue, 29 Sep 2015 16:29:37 -0700 Subject: [PATCH] Adding PrivateIpAddress attribute. String -> IPAddress, also adding unit test --- .../com/monsanto/arch/cloudformation/model/resource/EC2.scala | 3 ++- src/test/resources/cloudformation-template-vpc-example.json | 2 ++ .../monsanto/arch/cloudformation/model/CloudFormation_AT.scala | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/scala/com/monsanto/arch/cloudformation/model/resource/EC2.scala b/src/main/scala/com/monsanto/arch/cloudformation/model/resource/EC2.scala index dc6abd16..b1123633 100644 --- a/src/main/scala/com/monsanto/arch/cloudformation/model/resource/EC2.scala +++ b/src/main/scala/com/monsanto/arch/cloudformation/model/resource/EC2.scala @@ -65,6 +65,7 @@ case class `AWS::EC2::Instance`( UserData: Option[`Fn::Base64`] = None, Monitoring: Option[Boolean] = None, Volumes: Option[Seq[EC2MountPoint]] = None, + PrivateIpAddress: Option[Token[IPAddress]] = None, DisableApiTermination: Option[String] = None, override val Condition: Option[ConditionRef] = None, override val DependsOn: Option[Seq[String]] = None @@ -72,7 +73,7 @@ case class `AWS::EC2::Instance`( def when(newCondition: Option[ConditionRef] = Condition) = copy(Condition = newCondition) } object `AWS::EC2::Instance` extends DefaultJsonProtocol { - implicit val format: JsonFormat[`AWS::EC2::Instance`] = jsonFormat16(`AWS::EC2::Instance`.apply) + implicit val format: JsonFormat[`AWS::EC2::Instance`] = jsonFormat17(`AWS::EC2::Instance`.apply) } case class `AWS::EC2::InternetGateway`(name: String, Tags: Seq[AmazonTag], diff --git a/src/test/resources/cloudformation-template-vpc-example.json b/src/test/resources/cloudformation-template-vpc-example.json index 0566edcf..aca6ef96 100644 --- a/src/test/resources/cloudformation-template-vpc-example.json +++ b/src/test/resources/cloudformation-template-vpc-example.json @@ -1289,6 +1289,7 @@ }, "SourceDestCheck":"false", "DisableApiTermination":"false", + "PrivateIpAddress":"1.2.3.4", "ImageId":{ "Fn::FindInMap":[ "AWSNATAMI", @@ -1409,6 +1410,7 @@ }, "SourceDestCheck":"false", "DisableApiTermination":"false", + "PrivateIpAddress":"1.2.3.4", "ImageId":{ "Fn::FindInMap":[ "AWSNATAMI", diff --git a/src/test/scala/com/monsanto/arch/cloudformation/model/CloudFormation_AT.scala b/src/test/scala/com/monsanto/arch/cloudformation/model/CloudFormation_AT.scala index a6fe222b..606768f6 100644 --- a/src/test/scala/com/monsanto/arch/cloudformation/model/CloudFormation_AT.scala +++ b/src/test/scala/com/monsanto/arch/cloudformation/model/CloudFormation_AT.scala @@ -624,6 +624,7 @@ object StaxTemplate { SecurityGroupIds = Seq( ResourceRef(natSecGroupResource) ), Tags = standardTagsNoNetwork("nat" + number), DisableApiTermination = Some("false"), + PrivateIpAddress = Some(IPAddress(1, 2, 3, 4)), UserData = Some(`Fn::Base64`( `Fn::Join`("", Seq[Token[String]](