lib/jets/resource/replacer.rb in jets-1.7.2 vs lib/jets/resource/replacer.rb in jets-1.8.0
- old
+ new
@@ -57,10 +57,18 @@
# "AWS::Events::Rule" => "events.amazonaws.com",
# "AWS::Config::ConfigRule" => "config.amazonaws.com",
# "AWS::ApiGateway::Method" => "apigateway.amazonaws.com"
def principal_map(type)
service = type.split('::')[1].downcase
+ service = special_principal_map(service)
"#{service}.amazonaws.com"
+ end
+
+ def special_principal_map(service)
+ # special map
+ # s3_event actually uses sns topic events to trigger a Lambda function
+ map = { "s3" => "sns" }
+ map[service] || service
end
# From AWS docs: https://amzn.to/2N0QXQL
# source_arn is "not supported by all event sources"
#