/** * @return Boolean */ public function destroy() { $key = $this->getNameWithPrefix() . '_url'; $this->cache->delete($key); if ($this->queueExists()) { // Delete the SQS Queue $this->sqs->deleteQueue(['QueueUrl' => $this->queueUrl]); $this->log(200, "SQS Queue removed", ['QueueUrl' => $this->queueUrl]); } $key = $this->getNameWithPrefix() . '_arn'; $this->cache->delete($key); if ($this->topicExists() || !empty($this->queueUrl)) { // Delete the SNS Topic $topicArn = !empty($this->topicArn) ? $this->topicArn : str_replace('sqs', 'sns', $this->queueUrl); $this->sns->deleteTopic(['TopicArn' => $topicArn]); $this->log(200, "SNS Topic removed", ['TopicArn' => $topicArn]); } return true; }
/** * Delete a topic * @param string $topicArn Topic ARN * @deprecated use SnsClient directly to subscribe */ public function deleteTopic($topicArn) { $this->sns->deleteTopic(['TopicArn' => $topicArn]); }
/** * @When /^I delete topic "([^"]*)"$/ */ public function iDeleteTopic($name) { $this->sns->deleteTopic(['TopicArn' => $this->getArnByName($name)]); }