def add_permission(self):
        """Add permission to Lambda for the API Trigger."""
        statement_id = '{}_api_{}'.format(self.app_name, self.trigger_settings['api_name'])
        principal = 'apigateway.amazonaws.com'
        lambda_alias_arn = get_lambda_alias_arn(self.app_name, self.env, self.region)
        lambda_unqualified_arn = get_lambda_arn(self.app_name, self.env, self.region)
        resource_name = self.trigger_settings.get('resource', '')
        resource_name = resource_name.replace('/', '')
        method_api_source_arn = 'arn:aws:execute-api:{}:{}:{}/{}/{}/{}'.format(
            self.region, self.account_id, self.api_id, self.env, self.trigger_settings['method'], resource_name)
        global_api_source_arn = 'arn:aws:execute-api:{}:{}:{}/*/*/{}'.format(self.region, self.account_id, self.api_id,
                                                                             resource_name)
        add_lambda_permissions(
            function=lambda_alias_arn,
            statement_id=statement_id + self.trigger_settings['method'],
            action='lambda:InvokeFunction',
            principal=principal,
            env=self.env,
            region=self.region,
            source_arn=method_api_source_arn)
        add_lambda_permissions(
            function=lambda_alias_arn,
            statement_id=statement_id,
            action='lambda:InvokeFunction',
            principal=principal,
            env=self.env,
            region=self.region,
            source_arn=global_api_source_arn)
        add_lambda_permissions(
            function=lambda_unqualified_arn,
            statement_id=statement_id + self.trigger_settings['method'],
            action='lambda:InvokeFunction',
            principal=principal,
            env=self.env,
            region=self.region,
            source_arn=method_api_source_arn)
        add_lambda_permissions(
            function=lambda_unqualified_arn,
            statement_id=statement_id,
            action='lambda:InvokeFunction',
            principal=principal,
            env=self.env,
            region=self.region,
            source_arn=global_api_source_arn)
Add permission to Lambda for the API Trigger.