A simple AWS SNS example with Golang using Localstack

In this example we are going to use Localstack and Golang to work with AWS Simple Notification Service (SNS). We will create a new topic, list all topics, subscribe to a topic, list all topic subscriptions, publish to a topic and unsubscribe from a topic.

Structure

├── internal
│   ├── pkg
│   │   └── cloud
│   │       ├── aws
│   │       │   ├── aws.go
│   │       │   └── sns.go
│   │       ├── client.go
│   │       └── model.go
│   └── pubsub
│       └── pubsub.go
└── main.go

#aws #go #golang

What is GEEK

Buddha Community

A simple AWS SNS example with Golang using Localstack

A simple AWS SNS example with Golang using Localstack

In this example we are going to use Localstack and Golang to work with AWS Simple Notification Service (SNS). We will create a new topic, list all topics, subscribe to a topic, list all topic subscriptions, publish to a topic and unsubscribe from a topic.

Structure

├── internal
│   ├── pkg
│   │   └── cloud
│   │       ├── aws
│   │       │   ├── aws.go
│   │       │   └── sns.go
│   │       ├── client.go
│   │       └── model.go
│   └── pubsub
│       └── pubsub.go
└── main.go

#aws #go #golang

Using Golang and AWS SNS to create a HTTP client and server API

In this example we are going to create a application-to-application (A2A) communication. Both applications are HTTP APIs. The client (publisher) dispatches events (image upload or download) and server (subscriber) listens on the events to handle them. We have two event types which are upload and download. Both of these are linked to image topic.

We are benefiting from topic filters because:

  • Subscribers are semantically related to each other.

  • Subscribers consume similar types of events.

  • Subscribers are supposed to share the same access permissions on the topic.

Steps

  1. Create a topic.

  2. Run server.

  3. Subscribe server to the topic.

  4. Client produces events.

#aws #golang #aws sns #api

Elian  Harber

Elian Harber

1617362280

A Simple AWS SQS Example with Golang using Localstack

In this example we are going to use Localstack and Golang to work with AWS Simple Queue Service (SQS). We will create queues, send messages and receive messages as well as doing some other minor work.

Structure

├── internal
│   ├── message
│   │   └── message.go
│   └── pkg
│       └── cloud
│           ├── aws
│           │   ├── aws.go
│           │   └── sqs.go
│           ├── client.go
│           └── model.go
└── main.go

#aws #go #golang

A Simple AWS S3 Example with Golang using Localstack

In this example we are going to use Localstack and Golang to work with AWS Simple Storage Service (S3). We will create a new bucket, upload an object to a bucket, download an object from a bucket, delete an object from a bucket and list objects in a bucket.

Structure

├── assets
│   ├── id.txt
│   └── logo.png
├── internal
│   ├── bucket
│   │   └── bucket.go
│   └── pkg
│       └── cloud
│           ├── aws
│           │   ├── aws.go
│           │   └── s3.go
│           ├── client.go
│           └── model.go
├── main.go
└── tmp

#aws #go #golang

Seamus  Quitzon

Seamus Quitzon

1601341562

AWS Cost Allocation Tags and Cost Reduction

Bob had just arrived in the office for his first day of work as the newly hired chief technical officer when he was called into a conference room by the president, Martha, who immediately introduced him to the head of accounting, Amanda. They exchanged pleasantries, and then Martha got right down to business:

“Bob, we have several teams here developing software applications on Amazon and our bill is very high. We think it’s unnecessarily high, and we’d like you to look into it and bring it under control.”

Martha placed a screenshot of the Amazon Web Services (AWS) billing report on the table and pointed to it.

“This is a problem for us: We don’t know what we’re spending this money on, and we need to see more detail.”

Amanda chimed in, “Bob, look, we have financial dimensions that we use for reporting purposes, and I can provide you with some guidance regarding some information we’d really like to see such that the reports that are ultimately produced mirror these dimensions — if you can do this, it would really help us internally.”

“Bob, we can’t stress how important this is right now. These projects are becoming very expensive for our business,” Martha reiterated.

“How many projects do we have?” Bob inquired.

“We have four projects in total: two in the aviation division and two in the energy division. If it matters, the aviation division has 75 developers and the energy division has 25 developers,” the CEO responded.

Bob understood the problem and responded, “I’ll see what I can do and have some ideas. I might not be able to give you retrospective insight, but going forward, we should be able to get a better idea of what’s going on and start to bring the cost down.”

The meeting ended with Bob heading to find his desk. Cost allocation tags should help us, he thought to himself as he looked for someone who might know where his office is.

#aws #aws cloud #node js #cost optimization #aws cli #well architected framework #aws cost report #cost control #aws cost #aws tags