Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from tylersouthwick/kms
add support for KMS
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/scala/com/monsanto/arch/cloudformation/model/resource/KMS.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.monsanto.arch.cloudformation.model.resource | ||
|
||
import com.monsanto.arch.cloudformation.model._ | ||
import spray.json.DefaultJsonProtocol._ | ||
import spray.json.RootJsonFormat | ||
|
||
case class `AWS::KMS::Alias`( | ||
name : String, | ||
AliasName : Token[String], | ||
TargetKeyId : Token[String], | ||
override val Condition : Option[ConditionRef] = None | ||
) extends Resource[`AWS::KMS::Alias`] { | ||
override def when(newCondition: Option[ConditionRef]): `AWS::KMS::Alias` = copy(Condition = newCondition) | ||
} | ||
object `AWS::KMS::Alias` { | ||
|
||
implicit val format : RootJsonFormat[`AWS::KMS::Alias`] = jsonFormat4(`AWS::KMS::Alias`.apply) | ||
} | ||
|
||
case class `AWS::KMS::Key`( | ||
name : String, | ||
Description : Option[Token[String]] = None, | ||
Enabled : Option[Token[Boolean]] = None, | ||
EnableKeyRotation : Option[Token[Boolean]] = None, | ||
KeyPolicy : PolicyDocument, | ||
override val Condition: Option[ConditionRef] = None | ||
) extends Resource[`AWS::KMS::Key`] with HasArn { | ||
override def when(newCondition: Option[ConditionRef]): `AWS::KMS::Key` = copy(Condition = newCondition) | ||
|
||
override def arn: Token[String] = `Fn::GetAtt`(Seq(name, "Arn")) | ||
} | ||
|
||
object `AWS::KMS::Key` { | ||
|
||
implicit val format : RootJsonFormat[`AWS::KMS::Key`] = jsonFormat6(`AWS::KMS::Key`.apply) | ||
} | ||
|