Nelson
Nelson

Reputation: 3242

What class should I use instead of the deprecated AmazonCloudFrontClient?

I am trying to invalidate items in cloud front. I fount that the class http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/cloudfront_2012_03_15/AmazonCloudFrontClient.html is deprecated.

What class should I use?

Upvotes: 1

Views: 358

Answers (2)

randers
randers

Reputation: 5146

There is a class with the same name in another package which is not @Deprecated:

Docs for com.amazonaws.services.cloudfront.AmazonCloudFrontClient

The deprecated class is in the namespace com.amazonaws.services.cloudfront_2012_03_15.AmazonCloudFrontClient.

Upvotes: 2

Nelson
Nelson

Reputation: 3242

I realized my IDE was importing from the wrong package.

Use this:

import com.amazonaws.services.cloudfront.AmazonCloudFrontClient;

https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/cloudfront/AmazonCloudFrontClient.html#createInvalidation(com.amazonaws.services.cloudfront.model.CreateInvalidationRequest

Upvotes: 0

Related Questions