Sitemap

100 Days of DevOps — Day 40-Introduction to AWS Config

4 min readMar 22, 2019

--

Welcome to Day 40 of 100 Days of DevOps, Focus for today AWS Config

What Is AWS Config?

AWS Config provides a detailed view of the configuration of AWS resources in your AWS account. This includes how the resources are related to one another and how they were configured in the past so that you can see how the configurations and relationships change over time.

Features

  • Track state of all resources(OS level too — Windows/Linux)
  • Meet your compliance need(PCI-DSS, HIPAA)
  • Validate against AWS Config Rule

Setting up AWS Config

Press enter or click to view image in full size
* All resources: You can check on, Record all rsources supported in this region
OR
Global resources like IAM
OR
We can even check specific resources eg: EC2
* Amazin S3 bucket: This bucket will recieve configuration history and configuration snapshot files
* Amazon SNS topic(Optional): We can send config changes to S3 bucket
* AWS Config role: It give AWS config read-only access(IAM Role)to AWS resource
Press enter or click to view image in full size
* Skip this for the time being
  • Confirm and AWS Config setup for us.
  • Check the status of AWS config, by click on the status icon on the top of the page
Press enter or click to view image in full size
  • Now click on Resource and then Instance
Press enter or click to view image in full size
Press enter or click to view image in full size
  • Click on the Configuration timeline
Press enter or click to view image in full size
  • Scroll down and click on changes
Press enter or click to view image in full size
Press enter or click to view image in full size

Scenario: Last time we skipped the rule section, this time let add all the config rule, our task for today to make sure for an account is compliant

  • CloudTrail must be enabled
  • S3 bucket versioning must be enabled
  • EC2 instance must be a part of VPC
  • We are only using instance type as t2.micro
Press enter or click to view image in full size

Search for CloudTrail and select cloudtrail-enabled

Press enter or click to view image in full size
  • You don't need to change any of the default value and click on save
Press enter or click to view image in full size

Same way search for S3 bucket versioning enabled

Press enter or click to view image in full size

Search for ec2-instances-in-vpc

Press enter or click to view image in full size
  • This requires some changes as you need to specify your VPC id
Press enter or click to view image in full size

Search for desired-instance-type

Press enter or click to view image in full size
  • Add the instanceType Value to t2.micro
Press enter or click to view image in full size
  • Finally, you will see something like this
Press enter or click to view image in full size
  • If you further drill down, as you can see this instance is using t2.medium while in config rule for the desired-instance-type we choose t2.micro
Press enter or click to view image in full size
  • One more example, as you can see in this case S3 bucket is non-compliant
Press enter or click to view image in full size
  • If we can go to the S3 bucket and enabled versioning
Press enter or click to view image in full size
  • As we remediated the issue, to see the immediate effect
Press enter or click to view image in full size
  • We are back in business
Press enter or click to view image in full size

Terraform Code

  • Now we need to automate the entire process and then is no better tool other then terraform to do a job for us

GitHub Link

Looking forward from you guys to join this journey and spend a minimum an hour every day for the next 100 days on DevOps work and post your progress using any of the below medium.

Reference

--

--

Prashant Lakhera
Prashant Lakhera

Written by Prashant Lakhera

AWS Community Builder, Ex-Redhat, Author, Blogger, YouTuber, RHCA, RHCDS, RHCE, Docker Certified,4XAWS, CCNA, MCP, Certified Jenkins, Terraform Certified, 1XGCP