Невозможно получить доступ к услуге Aws KMS из модулей Amazon EKS - PullRequest
1 голос
/ 03 мая 2019

У меня есть модуль kubernates, который пытается получить доступ к службе aws kms с помощью aws java sdk для расшифровки пароля, и у меня есть действительная роль «Я», прикрепленная к модулю, но запрос не выполняется с приведенной ниже ошибкой,

{
"message": "Service Unavailable: Unable to load AWS credentials from any provider in the chain: [EnvironmentVariableCredentialsProvider: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY)), 
SystemPropertiesCredentialsProvider: Unable to load AWS credentials from Java system properties (aws.accessKeyId and aws.secretKey), com.amazonaws.auth.profile.ProfileCredentialsProvider@219aa2a6: profile file cannot be null, 
com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper@399fc8ea: Internal Server Error (Service: null; Status Code: 500; Error Code: null; Request ID: null)]"
}

ниже приведена часть кода, которая предполагает вызов kms

private final boolean kmsEnabled;

private final AWSKMS kmsClient;

public KmsKeyManager(@Value("${kms.enabled}") final boolean kmsEnabled,
                     @Value("${kms.endpoint}") final String kmwEndPoint,
                     @Value("${aws.region}") final String awsRegion) {
    AwsClientBuilder.EndpointConfiguration endpointConfig = new AwsClientBuilder.EndpointConfiguration(kmwEndPoint, awsRegion);
    kmsClient = AWSKMSClientBuilder.standard()
            .withCredentials(new DefaultAWSCredentialsProviderChain())
            .withEndpointConfiguration(endpointConfig)
            .build();

    this.kmsEnabled = kmsEnabled;
}

1 Ответ

0 голосов
/ 03 мая 2019

Сообщение об ошибке здесь содержит подсказку, чего не хватает:

Невозможно загрузить учетные данные AWS от любого провайдера в цепочке ...

См. документы , как предоставить необходимые учетные данные.

...