Unable to delete AWS Elastic Beanstalk Environment “resource XX-XXXXXXX has a dependent object”
You will usually get this error when you are trying to delete an Elastic Beanstalk environment.
As the message in the Events log states, the security group of your Elastic Beanstalk’s environment’s ec2 instance is being referenced in another security group. (This is usually done to allow the ec2 instance to have access to another AWS service.) In this case the security group is referenced in our AWS RDS security group, the deletion works right after removing the reference.
Cross Origin Resource Sharing is a very common issue faced.
You will usually get the message like the following.
Font from origin ‘https://k3j3jd3k2j.cloudfront.net’ has been blocked from loading by Cross-Origin Resource Sharing policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘https://www.mervcodes.com’ is therefore not allowed access.
There are two ways to resolve this issue.
Solution 1: S3 Bucket Way
This is the most common solution, which is to set the CORS header in your S3 bucket.
Solution 2: DNS Way
Create a subdomain like
instead of using
Create a CNAME record that points
That’s it. You are done!