diff --git a/plugins/cloud-aws/rest-api-spec/test/cloud_aws/20_repository.yaml b/plugins/cloud-aws/rest-api-spec/test/cloud_aws/20_repository.yaml new file mode 100644 index 00000000000..df26e517312 --- /dev/null +++ b/plugins/cloud-aws/rest-api-spec/test/cloud_aws/20_repository.yaml @@ -0,0 +1,23 @@ +# Integration tests for Cloud AWS components +# +"S3 repository can be registereed": + - do: + snapshot.create_repository: + repository: test_repo_s3_1 + verify: false + body: + type: s3 + settings: + bucket: "my_bucket_name" + access_key: "AKVAIQBF2RECL7FJWGJQ" + secret_key: "vExyMThREXeRMm/b/LRzEB8jWwvzQeXgjqMX+6br" + + # Get repositry + - do: + snapshot.get_repository: + repository: test_repo_s3_1 + + - is_true: test_repo_s3_1 + - is_true: test_repo_s3_1.settings.bucket + - is_false: test_repo_s3_1.settings.access_key + - is_false: test_repo_s3_1.settings.secret_key diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsEc2Service.java b/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsEc2Service.java index 8cc82590038..a8d07b05d49 100644 --- a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsEc2Service.java +++ b/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsEc2Service.java @@ -50,10 +50,14 @@ public class AwsEc2Service extends AbstractLifecycleComponent { @Inject public AwsEc2Service(Settings settings, SettingsFilter settingsFilter, NetworkService networkService, DiscoveryNodeService discoveryNodeService) { super(settings); + // Filter global settings settingsFilter.addFilter("cloud.key"); settingsFilter.addFilter("cloud.account"); settingsFilter.addFilter("cloud.aws.access_key"); settingsFilter.addFilter("cloud.aws.secret_key"); + // Filter repository-specific settings + settingsFilter.addFilter("access_key"); + settingsFilter.addFilter("secret_key"); // add specific ec2 name resolver networkService.addCustomNameResolver(new Ec2NameResolver(settings)); discoveryNodeService.addCustomAttributeProvider(new Ec2CustomNodeAttributes(settings)); diff --git a/plugins/pom.xml b/plugins/pom.xml index 90bba7e1776..4d05a5d68fe 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -283,6 +283,9 @@ api/indices.refresh.json api/nodes.info.json api/count.json + + api/snapshot.create_repository.json + api/snapshot.get_repository.json