Skip to content

Commit

Permalink
Revert changes to Resource for rain modules (#20)
Browse files Browse the repository at this point in the history
* Add Overrides to Resources

* Add Mapping to Type

* Add Any to Type

* Revert changes to Resources
  • Loading branch information
ericzbeard authored Oct 10, 2024
1 parent 56fff12 commit 52fff4e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
7 changes: 1 addition & 6 deletions package/cloudformation.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ typealias RefString = String|Mapping
///
/// Any property that conflicts will be suffixed with `Property`.
open class Resource {

// A Type is a Mapping when it's a Rain module
Type: String(matches(Regex(#"^.*::.*::.*$"#)))|Any
Type: String(matches(Regex(#"^.*::.*::.*$"#)))
Properties: Any?
CreationPolicy: Mapping?
DeletionPolicy: String?
Expand All @@ -24,9 +22,6 @@ open class Resource {
UpdatePolicy: Mapping?
UpdateReplacePolicy: String?
Condition: String?

// Overrides is specific to Rain modules
Overrides: Mapping?
}

/// A CloudFormation Parameter
Expand Down
17 changes: 17 additions & 0 deletions test/type-module.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Represents a CloudFormation template that creates buckets
// in several different ways, with and without the use of modules

amends "modules/template.pkl"
import "modules/cloudformation.pkl" as cfn
import "modules/aws/s3/bucket.pkl" as bucket
import "modules/patterns/bucket.pkl" as pattern

Resources {

["Mod"] {
Type {
["!Rain::Module"] = "Something"
}
}
}

0 comments on commit 52fff4e

Please sign in to comment.