EC2 instance data is used to pass start up information into the EC2 instance. This userdata must not contain access key credentials. Instead use an IAM Instance Profile assigned to the instance to grant access to other AWS Services.
User data is visible through the AWS Management console
Remove sensitive data from the EC2 instance user-data
The following example will fail the aws-ec2-no-secrets-in-user-data check.
The following example will pass the aws-ec2-no-secrets-in-user-data check.