Download the Terraform binary and place it in any folder you'd like.
Once downloaded, 1) navigate to the folder where the Terraform binary resides. 2) run the following command first:
In Amazon S3 we sometimes need to check for the existence of an object (picture, file, etc) before taking the next actions. Here's how we do it in C#. If we find anything that matches, it brings it bk in a list.
Note: The variables App.awsKey & App.awsSecretyKey are my global variables in my Xamarin forms app. You should replace these with the text values for your key and secretKey from your AWS account.
Note: Prefix = key (key is just a string -- the name of the object you want to find)
Amazon.S3.AmazonS3Client s3Client = new Amazon.S3.AmazonS3Client(App.awsKey, App.awsSecretKey, Amazon.RegionEndpoint.USEast1);
var request = new ListObjectsRequest
Prefix = key,
MaxKeys = 1
ListObjectsResponse response = await s3Client.ListObjectsAsync(request);
if (response.S3Objects.Count == 0)
(This assumes you've already setup the topic and have your own Topic ARN)
// be sure this is the region you're choosing
AmazonSimpleNotificationServiceClient client = new AmazonSimpleNotificationServiceClient(Amazon.RegionEndpoint.USEast1);
// Publish a message to an Amazon SNS topic.
PublishRequest publishRequest = new PublishRequest("arn:aws:sns:us-east-1:123456:TESTTOPIC","this is the message");
var publishResponse = await client.PublishAsync(publishRequest);
Amazon AWS can be amazing and interesting to deal with at times. When you host a static website using S3 and Route 53, it sometimes creates files for each request the service receives. To purge these files and avoid having tens of thousands or even millions of useless files, use this command on your local CLI:
#Delete all files that name start with "2018" files from the bucket:
aws s3 rm s3://[your-aws-bucket-name]/ --recursive --exclude '*' --include '2018*'
I know that I've raved many times about the power of Amazon AWS, and this article will be no different. Amazon S3 provides a nearly free option to host static websites within their S3 product. S3 is, as Amazon describes it, Scalable Storage in the cloud. What this means, it that S3 is essentially a CDN (content delivery network). I host all types of images for websites, high scale emails and even promotional advertisements.
For my developer friends, S3 is a solution that can significantly, if not all together eliminate the cost of having a place to put websites before their completed for your clients to see on the internet.
For one of my attorney clients, I edited their layout locally, created a folder in my existing S3 environment and enabled the option to make the content a static website. The image below shows you exactly how to do this.
Voila! You have a valid website to email to your clients for approval. Obviously, this is free (as long as it doesn't get a lot of traffic - gigs I mean).
Amazon AWS is one of the most powerful and popular cloud tools available. I've been thoroughly impressed with its scalability and it's ease of use, once it's established. I will strongly suggest speaking with or consulting with someone with previous knowledge of the toolset, or you can have a bill for several hundred or even thousand dollars on your hands for things that you weren't aware were running.
While it's cumbersome at first, one of the easiest tools to use is Amazon S3. It essentially provides you the capabilities to have your own CDN (Content Delivery Network). In this space, you can store website images, html, and various other non-executable types, as easily as you can upload an image to Facebook. The only caveat I would have about this awesome tool is that it absolutely requires that you setup and administer the CORS for each folder or group. With CORS, you can say who can retrieve these images (ex: yourwebsite.com is the only location that can request these images). Without this setup, it's very easy for your images to end up cached in Google and you pay the bill for site crawls, users sharing an image, etc.
Otherwise, it's a great tool and as an Enterprise Consultant, I haven't seen an easier to use option to date.