Ec2 instance attributes check for the ones not mentioned in the docs

Hello,

I am trying to perform a check/test using chef inspec on resources in aws for the below attributes:

EC2:
1 : ec2-instance-detailed-monitoring-enabled (part of aws_launch_confiuration but not aws_ec2_instance)
2: Check instances for specified tenancy (part of aws_vpc but not aws_ec2_instance)
3; Check the Amazon EC2 instances in your account are managed by AWS Systems Manager
4: Enabled termination protection
5: Check that security groups are attached to Amazon Elastic Compute Cloud (Amazon EC2) instances

S3:
1: Bucket replication enabled
2: Enabled MFA Delete on S3 buckets
3: Enabled S3 Object Lock
4: Object level logging enabled

I cant find any above property/attribute for these resources in documentation.
Apologies for such a long list, but just want to get the ides for how to test for these.

All thanks for any help.

Hello @sudhakar and welcome to the community! :wave:

I just want to check where you have been looking, have you looked through the AWS-specific resources listed here: https://docs.chef.io/inspec/resources#aws

Thanku @schwad for the welcome and your response.

Yes I have checked the same docs.

For what I have mentioned in the list of attributes that I want to check...

Let's say about tenancy of ec2, there is no property for that in aws_ec2_instance but it is there in aws_vpc resource.

How should I check the tenancy value of an ec2 instance , Could you please guide me here?

Also for properties like detailed monitoring value of ec2, how to check if a an ec2 is managed or not.

There are more but I could not get my hands on their way to do .

Thank you do your support.

OK, so a link for additional properties in the docs give the attributes that i am looking for but on using it it throws error as undefined method. please help

describe aws_ec2_instance(instanceid) do
its('monitoring.state') { should cmp "enabled"}
end

the above test throws error as "monitoring method is undefined"

what should i use?