Your code block is broken so many people won't check it.
You can fix it after posting, so if you arrange it so that other people can see it easily, it will be easier to get an answer.
Also, it's generally inappropriate to ask for code reviews on these question sites. Since it is difficult to accumulate knowledge, it is better to ask pinpoint questions such as "Why is this part a security problem?"
Well, I have some suggestions for you.
We recommend that you perform a general IaC template security check.
There are several static analysis tools out there that you can use against your template to give you general security warnings and best practices.
On top of that, if you specifically ask what you don't understand, it will be a good question and you will get good answers!
Create Route via Cloudformation Templateasked 7 months ago
Cloudformation Template - Amazon Lex Voice Setting Engineasked a month ago
Adding an existing security group CloudFormation EC2 templateAccepted Answerasked 3 years ago
How to declare multi region access point in cloudformation templateasked 3 months ago
AWS Blockchain Template issuesasked 3 months ago
Issues Creating MediaConnect Flows with Cloudformation TemplateAccepted Answerasked 3 months ago
Can you convert (as opposed to import) a CloudFormation template into CDK code?asked 3 months ago
I am trying to deploy the EKS cluster using s3 template but getting errors, please help measked 8 months ago
Need help on security issues on Cloudformation templateasked 2 months ago
HttpApi timeout setting missing from SAM cloudformation templateAccepted Answerasked 3 years ago