Tools for managing AWS cloud services

The Right Button

Automation Through IaC

You can use Infrastructure as Code (IaC) to model and set up your AWS resources, so you spend less time managing them and more time focusing on the applications you want to run in AWS. To begin, create a template that describes all of the AWS resources you want, such as EC2 instances or Amazon S3 buckets.

The CloudFormation service takes care of provisioning and configuring these resources for you: You don't have to create, configure, and figure out individually what depends on what in the AWS Management Console user interface – CloudFormation does that work for you.

A CloudFormation template describes your desired resources and their dependencies, so you can launch and configure them together as a stack. With a template, you can create, update, and delete an entire stack as a single entity, rather than managing resources individually. Stacks can be managed and deployed across multiple AWS accounts and regions. The template is saved as a text file, and its format complies with the JSON or YAML standard. Because they are text files, you create and edit them in any text editor and manage them in your version control system along with the rest of the source code.

The template describes the AWS resources you want to create and configure. The following basic template describes a single resource of the AWS::S3::Bucket type:

{"
Resources" : {"
HelloBucket" : {
"Type" : "AWS::S3::Bucket"
}}

Note that you need to choose a unique name for your S3 bucket (e.g., HelloBucket-<123-full-number>) that no other AWS customer has already chosen. When you use this template to create a stack, CloudFormation easily creates an S3 bucket because the service can simply use the default settings. For other resources, such as an EC2 autoscaling or EC2 instance, CloudFormation needs more information.

IaC with Programming Languages

Instead of writing the CloudFormation templates yourself, you can use a programming language to define your resources. The AWS Cloud Development Kit (AWS CDK), for example, supports well-known programming languages and leverages their power to express complex concepts. Cloud resources are preconfigured with tried and trusted defaults and then rolled out in a secure, repeatable manner as CloudFormation templates. The earlier short example with CDK in TypeScript would be:

const helloBucket = new s3.Bucket(this, 'HelloBucket');

JavaScript, Python, Java, and C# are also possible. For more information, see the CDK website [6] or the CDK workshop [7].

Conclusions

Amazon offers numerous services in the cloud in the form of AWS. In the first part of the article, I looked at the essential features of the AWS Management Console. In the second part, I focused on how you can completely replace point and click in the AWS Management Console with command-line tools, SDKs, other tools, and IaC. Although I could only provide a brief insight into each category, the options for managing the AWS cloud without the web interface are fast, repeatable, and targeted, whether you opt for the terminal, scripting, or coding in your programming language of choice.

The Author

Christopher Henkel is a Solutions Architect at AWS.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=