Now that we can have cross-stack references, you can create this stack which will build the KMS key, lambda function, role etc.
Then in the stack(s) that needs to use this functionality, set the following properties on the EncryptedSuperSecretThing resource:
"ServiceToken": {"Fn::ImportValue": "LambdaEncryptionFunction"}, "KeyId": {"Fn::ImportValue": "KMSKeyId"}
Defining the function in-line in this template is gnarly (especially in JSON) but it makes for a very easy deployment.
Now that we can have cross-stack references, you can create this stack which will build the KMS key, lambda function, role etc.
Then in the stack(s) that needs to use this functionality, set the following properties on the EncryptedSuperSecretThing resource:
"ServiceToken": {"Fn::ImportValue": "LambdaEncryptionFunction"}, "KeyId": {"Fn::ImportValue": "KMSKeyId"}
Defining the function in-line in this template is gnarly (especially in JSON) but it makes for a very easy deployment.