LoslegenKostenlos loslegen

Creating a Topic

Sam has been doing such a great job with her new skills, she got a promotion.

With her new title of Information Systems Analyst 3 (as opposed to 2), she has gotten a tiny pay bump in exchange for a lot more work.

Knowing what she can do, the City Council asked Sam to prototype an alerting system that will alert them when any department has more than 100 Get It Done requests outstanding.

They would like for council members and department directors to receive the alert.

Help Sam use her new knowledge of Amazon SNS to create an alerting system for Council!

Diese Übung ist Teil des Kurses

Introduction to AWS Boto in Python

Kurs anzeigen

Anleitung zur Übung

  • Initialize the boto3 client for SNS.
  • Create the 'city_alerts' topic and extract its topic ARN.
  • Re-create the 'city_alerts' topic and extract its topic ARN with a one-liner.
  • Verify the two topic ARNs match.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Initialize boto3 client for SNS
sns = boto3.client('____', 
                   region_name='us-east-1', 
                   aws_access_key_id=AWS_KEY_ID, 
                   aws_secret_access_key=AWS_SECRET)

# Create the city_alerts topic
response = sns.____(____="____")
c_alerts_arn = response['____']

# Re-create the city_alerts topic using a oneliner
c_alerts_arn_1 = sns.____(____='____')['____']

# Compare the two to make sure they match
print(c_alerts_arn == c_alerts_arn_1)
Code bearbeiten und ausführen