Did you notice the StringLike and StringEquals operators in the policies contained in the condition statements? Knowing how to parse these out will be essential for deciphering the policies on the test. This will be covered in more detail in Chapter 14, Working with Access Policies.
aws iam create-policy –policy-name cr-policy –policy-document file://iam_config_policy.json
aws iam attach-role-policy –role-name Packt-Config –policy-arn arn:aws:iam::182968331794:policy/cr-policy
{
“allSupported”: false,
“includeGlobalResourceTypes”: false,
“resourceTypes”: [
“AWS::EC2::SecurityGroup”,
“AWS::EC2::Volume”
]
}
aws configservice put-configuration-recorder –configuration-recorder name=packt,roleARN=arn:aws:iam::182968331794:role/Packt-Config –recording-group file://resources.json
{
“name”: “default”,
“s3BucketName”: “packt-config”,
“snsTopicARN”: “arn:aws:sns:us-east-1:1234567890:packt-config”,
“configSnapshotDeliveryProperties”: {
“deliveryFrequency”: “Twelve_Hours”
}
}
aws configservice put-delivery-channel –delivery-channel file://delivery.json
aws configservice start-configuration-recorder –configuration-recorder-name packt
It will take a few minutes to capture the configuration items; however, you are finished setting up the configuration recorder.
With the setup of the configuration recorder complete, give the AWS Config service a little time to discover the items in the two services that we stood up previously.
After you have the configuration recorder up and running, you can go to the AWS Management Console to see the AWS Config dashboard. You can jump there directly using the following URL: https://packt.link/U0bU9.
When you open the dashboard, you will be able to see the number of configuration items recorded:
Figure 5.2: AWS Config dashboard after the initial recorder run