Fork me on GitHub
Oliver George00:07:30

AWS CloudFormation newbie question. I'm experimenting with setting up a apigateway via a cloudstack template. There's one magic number... the CodeDeployDeploymentGroup. I think I could use Fn::ImportValue to read this from the datomic cloud cloudstack if it included an Export for the associated Output.

"CodeDeployDeploymentGroup": {
			"Description": "CodeDeploy Deployment Group",
			"Value": {
				"Fn::GetAtt": [
Could become
"CodeDeployDeploymentGroup": {
            "Description": "CodeDeploy Deployment Group",
            "Value": {
                "Fn::GetAtt": [
            "Export": {
				"Name": {
					"Fn::Sub": "${SystemName}-CodeDeployDeploymentGroup"
(or similar, from that template i think you'd use "Ref": "AWS::StackName" as the system name component) The alternative seems to be modifying the root stack to reference my app specific apigateway stack. Not sure if that's normal or recommended and how that might interplay with datomic cloud updates. Question really is: am I missing something?


Not answering your question but you might consider using Crucible instead to generate your templates. Even just having functions available makes it a lot easier. Here’s an example

Oliver George02:07:46

Thanks @U0510KXTU I thought I'd aim for zero helpers/libs/tooling first to get familiar with what's underlying things. Presume it's something I'd outgrow. Look forward to checking out your code and understanding how it's helpful.


that makes sense. there are examples of refs in there, in Crucible it’s the xref fn


and they can be parameters from the command line or CF “env” values e.g. region


maybe looking at how those CF value/fns are built will get you closer to how to infer/import the group you are trying to access

Oliver George02:07:31

Here's the simple template I came up with. Effectively what would be generated from following the ion-tutorial (but not using {proxy+} so slightly simpler)

Oliver George02:07:31

I used a Parameter since the datomic stack doesn't export the compute group name... if they did the ImportValue thing should do the trick .

Oliver George02:07:20

@U0510KXTU that json feels very similar to your code doesn't it.


yep. the only downside I’ve noticed is refs are string joins which are a bit more complex

Oliver George02:07:14

In your experience, what approach would you use for setting up an apigateway to complement a datomic cloud app (with ions)? I'm largely guessing but the options seem like: (1) a "nested stack" approach provides access to the compute group name and connects the datomic stack lifecycle events to the apigateway stack. (2) treat as stand alone cloudformation and refer to the compute stack by the known group name (3) other.. (aka I need to learn more about cloudformations and devops practices on AWS)


I’ve already done this 🙂 I used Crucible to generate the APIGW and passed in the name of the compute stack as a parameter so that my fns can generate the AWS ARNS using string joins

Oliver George03:07:36

Gotcha thanks (and cool!)


Hi, I’m getting a weird error when I try to retract a unique constraint on an attribute

(d/transact conn {:tx-data [[:db/retract :otu-seq/otuid :db/unique :db.unique/identity]]})
ExceptionInfo nth not supported on this type: Db  clojure.core/ex-info (core.clj:4739)


nvm just saw the other comments about it


I just added ring as a dependency to my Datomic/Ions project, and now I get this:

Refresh Warning: Reflection warning, cognitect/hmac_authn.clj:80:12 - call to static method encodeHex on org.apache.commons.codec.binary.Hex can't be resolved (argument types: unknown, java.lang.Boolean).
Refresh Warning: Reflection warning, cognitect/hmac_authn.clj:80:3 - call to java.lang.String ctor can't be resolved.
Removing ring from deps.edn removes the error. Has anyone else seen this?


It's just a reflection warning though. No biggie

👍 4

Hi, rather short question: is it possible to transact multiple values for a :db.cardinality/many attribute using the list form? Something along those lines:

[[:db/add "my-ident" :foo/bar-refs [ref-ident-1 ref-ident-2]]]


I think you can't do that here, but you can in map form. If you think about it, this is ambiguous. ref-ident-1 could be a keyword and ref-ident-2 could be a value, making the inner vector an entity reference.


try [[:db/add "my-ident" :foo/bar-refs [[ref-ident-1 ref-ident-2]]]] @atwrdik


@marshall following this example i got an invalid list form error (the same happens using my example above)


erm. right; the list form is one datom per vector I believe


you can transact multiple vals in map form


or you can use multiple individual vectors in list form


The explanation from @eraserhd makes sense to me. But I'm still curious how to add multiple refs without using the map form. Would one just write something like this:

[[:db/add "my-ident" :foo/bar-refs ref-ident-1]
 [:db/add "my-ident" :foo/bar-refs ref-ident-2]]


great, thx guys


are Tim Ewald’s code examples for his reified transactions talk from DoD 2015 still available anywhere? The gist has understandably evaporated.