Skip to content

Instantly share code, notes, and snippets.

@AngelChaidez
Created April 19, 2023 01:47
Show Gist options
  • Save AngelChaidez/c3f25eda286a0156f6b7abd5e5f7a160 to your computer and use it in GitHub Desktop.
Save AngelChaidez/c3f25eda286a0156f6b7abd5e5f7a160 to your computer and use it in GitHub Desktop.
#!/usr/bin/ env python3.11
# import a function from another module will be used to generate a name at random
import boto3
import os
import sys
from botocore.exceptions import ClientError
sys.path.append("sqs")
from create_sqs import create_service_name
sns_client = boto3.client('sns')
sns_name = create_service_name('SNS_SQS_')
print(sns_name)
try:
response = sns_client.create_topic(
Name = sns_name)
print(f"SNS topic created successfully : {sns_name}")
except ClientError as e:
print(e.message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment