Bad parameters used with AWS API methods Medium

Passing outdated or bad parameters to AWS API calls might lead to inefficient or less secure code. Passing the right parameters will lead to secure or efficient code.

Detector ID
java/aws-bad-params@v1.0
Category
Common Weakness Enumeration (CWE) external icon
-

Noncompliant example

1public void createStepConfigNoncompliant() {
2    // Noncompliant: ActionOnFailure.TERMINATE_JOB_FLOW is outdated.
3    new StepConfig().withName("sampleStepName").withActionOnFailure(ActionOnFailure.TERMINATE_JOB_FLOW);
4}

Compliant example

1public void createStepConfigCompliant() {
2    // Compliant: ActionOnFailure.TERMINATE_CLUSTER is used.
3    new StepConfig().withName("sampleStepName").withActionOnFailure(ActionOnFailure.TERMINATE_CLUSTER);
4}