CodeAnt AI home pagelight logodark logo
  • Support
  • Dashboard
  • Dashboard
  • Join Community
Start Here
  • What is CodeAnt?
Setup
  • Github
  • Bitbucket
  • Gitlab
  • Azure Devops
Pull Request Review
  • Features
  • Customize Review
  • Quality Gates
  • Integrations
Scan center
  • Code Security
  • Code Quality
  • Cloud Security
  • Engineering Productivity
Integrations
  • Jira
  • Test Coverage
  • CI/CD
IDE
  • Setup
  • Review
  • Enhancements
Rule Reference
  • Compliance
  • Anti-Patterns
  • Code Governance
  • Infrastructure Security Database
  • Application Security Database
    • Apex
    • Bash
    • C
    • Clojure
    • Cpp
    • Csharp
    • Dockerfile
    • Elixir
    • Fingerprints
    • Generic
    • Go
    • Html
    • Java
    • Javascript
    • Json
    • Kotlin
    • Ocaml
    • Php
    • Problem-based-packs
    • Python
    • Ruby
    • Rust
    • Scala
    • Solidity
    • Swift
    • Terraform
      • Aws
        • Best practice
        • Correctness
        • Security
      • Azure
      • Gcp
      • Lang
    • Typescript
    • Yaml
Resources
  • Open Source
  • Blogs
Aws

Correctness

lambda-redundant-field-with-image

When using the AWS Lambda “Image” package_type, runtime and handler are not necessary for Lambda to understand how to run the code. These are built into the container image. Including runtime or handler with an “Image” package_type will result in an error on terraform apply. Remove these redundant fields.

lambda-permission-logs-missing-arn-asterisk

The source_arn field needs to end with an asterisk, like this: <log-group-arn>:* Without this, the aws_lambda_permission resource ‘NAME′willnotbecreated.Addtheasterisktotheendofthearn.xNAME' will not be created. Add the asterisk to the end of the arn. x NAME′willnotbecreated.Addtheasterisktotheendofthearn.xARN

subscription-filter-missing-depends

The aws_cloudwatch_log_subscription_filter resource “$NAME” needs a depends_on clause on the aws_lambda_permission, otherwise Terraform may try to create these out-of-order and fail.
Confidence: MEDIUM

reserved-aws-lambda-environment-variable

terraform apply will fail because the environment variable “VARIABLE"isareservedbyAWS.Useanothernamefor"VARIABLE" is a reserved by AWS. Use another name for "VARIABLE"isareservedbyAWS.Useanothernamefor"VARIABLE”.
Best practiceSecurity
twitterlinkedin
Powered by Mintlify
Assistant
Responses are generated using AI and may contain mistakes.