Skip to main content

Posts

Showing posts from 2019

API GATEWAYS STRUCTURE

API Gateways API Gateway Architecture internal HDD Diagram API Gateways Internal Structure Details: %3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22API%20Gateways%26amp%3Bnbsp%3B%26lt%3Bbr%26gt%3BDashboard%26lt%3Bbr%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%2280%22%20y%3D%2280%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%223%22%20value%3D%22API%20Gateways%20Rules%26amp%3Bnbsp%3B%26lt%3Bbr%26gt%3BApplication%20Services%26lt%3Bbr%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22280%22%20y%3D%2280%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3CmxCell%20id%3D%224%22%20value%3D%22Buckect(Json%20file)%22%20sty...

How to Use AWS SES Template Using Golang

👉 Amazon Simple Email Service Template (Amazon SES) is a highly scalable and cost-effective bulk and transactional email-sending service for businesses and developers. Subscription is quick and is on pay-as-you-go basis. You can read more about Amazon SES here  👏. Create an AwsSES.go file (Code Explained below) package main import ( "fmt" "utilities" "github.com/spf13/cast" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ses" ) const ( sesRegion = "us-east-1" ) /* Create SES Session Function */ func newSESSession() (*session.Session, error) { return session.NewSession(&aws.Config{ Region: aws.String(sesRegion), }) } Create a Template Struct Format // SESTemplate ... contains template name, subject, htmlpart & text part type SESTemplate struct { TemplateName string `json:"templateName"` Subject stri...

How to Publish message to SNS with AWS Golang

Publish to SNS With Golang SNS is a notification service. A user can send a notification to a topic. Each topic can have multiple subscribers, which receive a copy of every message sent to the topic – something like an HTTP endpoint, an email address, or an Amazon SQS queue. Sending a single notification can go to multiple places. Steps to publish an SNS message on an Amazon SNS Topic An AWS Account to set up an SNS topic and 1 queue that receives from the topic you just created. Place your key and secret in your .aws/credentials file [ http://docs.aws.amazon.com/AWSImportExport/latest/DG/SaveCredentials.html ] Use GoLang 1.7+ [ https://golang.org/doc/install Set your GOPATH [ https://golang.org/doc/install#install ] Install Amazon Core and SNS libraries go get  github . com / aws / aws - sdk - go / aws go get  github . com / aws / aws - sdk - go / aws / session go get  github . com / aws / aws - sdk - go / service / sn Create an AwsSns.go file (C...

How To Upload files to AWS S3 bucket using golang

You can use the code below to upload files to aws s3 bucket using go : "import "github.com/aws/aws-sdk-go/service/s3" Package s3 provides the client and types for making API requests to Amazon Simple Storage Service. package main import ( "bytes" "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "log" "net/http" ) Get Bucket Region: GetBucketRegion will attempt to get the region for a bucket using a region hint to determine which AWS partition to perform the query on. Use this utility to determine the region a bucket is in. var S3_REGION, S3_BUCKET string func LS3BucketInitialization() { S3REGION, errRegion := "S3_REGION NAME" S3BUCKET, errBucket := "S3_BUCKET NAME" if errRegion != nil || errBucket != nil { log.Fatal(errRegion, errBucket) return } S3_REGION = S3REGION.Value S3...