Skip to content

Latest commit

 

History

History

Config

AWS Config

Jump to


Using tools in this repo


AWS Config Cost Surprise

There could be new Config configuration items created even you have not made a new deployment.

E.g., ECS workload using VPC Networking mode

Config tracks everything, so an ENI is in a subnet so it tracks it back that way too. ENI has an Security Group associated so it also counts that. VPC is in the same boat.

If you look at Config history or CloudTrail creating that interface should be able to track down the root cause. Things we have seen before:

  • Task cycling due to health checks or schedule
  • Glue with bad data or config (it uses ENIs internally)
  • Lambdas firing other things that in turn fire lambdas

Useful Libs and Tools


Useful Articles and Blogs


Querying AWS resources

Using CLI

aws configservice select-resource-config --expression "$(cat ec2.sql)"

The SQL SELECT query components are as follows.

SELECT property [, ...]
[ WHERE condition ]
[ GROUP BY property ]
[ ORDER BY property [ ASC | DESC ] [, property [ ASC | DESC ] ...] ]

Examples

SELECT resourceId WHERE resourceType='AWS::EC2::Instance'
SELECT configuration.complianceType, COUNT(*)
WHERE resourceType = 'AWS::Config::ResourceCompliance'
GROUP BY configuration.complianceType
SELECT
    resourceId,
    resourceType,
    configuration.instanceType,
    configuration.placement.tenancy,
    configuration.imageId,
    availabilityZone
WHERE
    resourceType = 'AWS::EC2::Instance'
    AND configuration.imageId = 'ami-99c7e87ff8cf57a8e'