-
Couldn't load subscription status.
- Fork 2.8k
Description
The documentation and javaDoc for origin-access-identity states that, there needs to be a prefix for setting the origin access identity; "origin-access-identity/CloudFront/".
SO, the above prefix needs to be added to the ID-of-origin-access-identity
So, this "origin-access-identity/CloudFront/ID-of-origin-access-identity " needs to be passed to the S3OriginConfig-> OriginAccessIdentity field.
S3OriginConfig().withOriginAccessIdentity("origin-access-identity/CloudFront/" + "123456789")
But the above configuration is causing this error:
Exception in thread "main" com.amazonaws.services.cloudfront.model.InvalidOriginAccessIdentityException: The specified origin access identity does not exist or is not valid. (Service: AmazonCloudFront; Status Code: 400; Error Code: InvalidOriginAccessIdentity)
When i changed "origin-access-identity/CloudFront/" to "origin-access-identity/cloudfront/" it worked fine. So, in the prefix, the "CloudFront" should be lowerCase ("cloudfront").
S3OriginConfig().withOriginAccessIdentity("origin-access-identity/cloudfront/" + "123456789")
REF :
- https://forums.aws.amazon.com/message.jspa?messageID=749598
- http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/cloudfront/model/S3OriginConfig.html#withOriginAccessIdentity-java.lang.String-
- http://docs.aws.amazon.com/cloudfront/latest/APIReference/API_S3OriginConfig.html#cloudfront-Type-S3OriginConfig-OriginAccessIdentity