Skip to content

Commit

Permalink
Add the notification-arns, partition, and url-suffix pseudo-parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
john-shaffer committed Apr 12, 2024
1 parent f3f070c commit 49b832d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Unreleased

- Add docstring for `account-id`.
- Add the `notification-arns`, `partition`, and `url-suffix` psuedo parameters. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html

## v2.2.0 (2024-04-11)

Expand Down
34 changes: 34 additions & 0 deletions src/io/staticweb/cloudformation_templating.clj
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@
[x y]
(fn-not (equals x y)))

(def
^{:doc
"Returns the list of notification Amazon Resource Names (ARNs)
for the current stack.
To get a single ARN from the list, use [[select]].
See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-notificationarns"}
notification-arns
{"Ref" "AWS::NotificationARNs"})

(defn outputs
"Converts an output map from the format {LogicalId [Name Value Description]}
to AWS's output format. Description is optional."
Expand All @@ -223,6 +234,19 @@
:Value value
:Export {:Name name})]))))

(def
^{:doc
"Returns the partition that the resource is in. For standard
AWS Regions, the partition is aws. For resources in other
partitions, the partition is aws-partitionname. For example,
the partition for resources in the China (Beijing and Ningxia)
Region is `aws-cn` and the partition for resources in the
AWS GovCloud (US-West) region is `aws-us-gov`.
See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-partition"}
partition
{"Ref" "AWS::Partition"})

(defn prefixed-outputs
"Converts a map from the format {LogicalId [Value Description]} to AWS's
output format. Output names are prefixed with the given prefix.
Expand Down Expand Up @@ -334,6 +358,16 @@
[name parameters]
{"Fn::Transform" {:Name name :Parameters parameters}})

(def
^{:doc
"Returns the suffix for a domain. The suffix is typically
`amazonaws.com`, but might differ by Region. For example,
the suffix for the China (Beijing) Region is `amazonaws.com.cn`.
See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-urlsuffix"}
url-suffix
{"Ref" "AWS::URLSuffix"})

(defn user-data [& data]
(base64 (join "" data)))

Expand Down

0 comments on commit 49b832d

Please sign in to comment.