Ejemplo n.º 1
0
    def _inject_subscription(self, function, topic):
        subscription = SNSSubscription(self.logical_id)
        subscription.Protocol = 'lambda'
        subscription.Endpoint = function.get_runtime_attr("arn")
        subscription.TopicArn = topic

        return subscription
Ejemplo n.º 2
0
    def _inject_subscription(self, function, topic):
        subscription = SNSSubscription(self.logical_id)
        subscription.Protocol = 'lambda'
        subscription.Endpoint = function.get_runtime_attr("arn")
        subscription.TopicArn = topic

        return subscription
Ejemplo n.º 3
0
    def _inject_subscription(self, function, topic, filterPolicy):
        subscription = SNSSubscription(self.logical_id)
        subscription.Protocol = 'lambda'
        subscription.Endpoint = function.get_runtime_attr("arn")
        subscription.TopicArn = topic
        if CONDITION in function.resource_attributes:
            subscription.set_resource_attribute(CONDITION, function.resource_attributes[CONDITION])

        if filterPolicy is not None:
            subscription.FilterPolicy = filterPolicy

        return subscription
Ejemplo n.º 4
0
    def _inject_subscription(self, protocol, endpoint, topic, region, filterPolicy, resource_attributes):
        subscription = SNSSubscription(self.logical_id)
        subscription.Protocol = protocol
        subscription.Endpoint = endpoint
        subscription.TopicArn = topic
        if region is not None:
            subscription.Region = region
        if CONDITION in resource_attributes:
            subscription.set_resource_attribute(CONDITION, resource_attributes[CONDITION])

        if filterPolicy is not None:
            subscription.FilterPolicy = filterPolicy

        return subscription