diff options
author | Morten Tokle <mortent@verizonmedia.com> | 2020-05-13 08:21:50 +0200 |
---|---|---|
committer | Morten Tokle <mortent@verizonmedia.com> | 2020-05-18 10:29:28 +0200 |
commit | dfa23cab41d83b7c21a34d199e747fe8e5747ea3 (patch) | |
tree | 6302951df2d6d9264b41d5c6f21e544238c286d6 /controller-api | |
parent | 8f7170a652e8abaa496b10d3c629559997e123c7 (diff) |
Create application iam role service
Diffstat (limited to 'controller-api')
4 files changed, 55 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java index f87c764b3fd..007ab2b4abe 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java @@ -1,6 +1,7 @@ // Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration; +import com.yahoo.vespa.hosted.controller.api.integration.aws.ApplicationRoleService; import com.yahoo.vespa.hosted.controller.api.integration.aws.AwsEventFetcher; import com.yahoo.vespa.hosted.controller.api.integration.aws.ResourceTagger; import com.yahoo.vespa.hosted.controller.api.integration.certificates.EndpointCertificateProvider; @@ -73,4 +74,5 @@ public interface ServiceRegistry { ResourceTagger resourceTagger(); + ApplicationRoleService applicationRoleService(); } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/ApplicationRoleService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/ApplicationRoleService.java new file mode 100644 index 00000000000..e72ba5823d8 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/ApplicationRoleService.java @@ -0,0 +1,13 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.integration.aws; + +import com.yahoo.config.provision.ApplicationId; + +import java.util.Optional; + +/** + * @author mortent + */ +public interface ApplicationRoleService { + Optional<ApplicationRoles> createApplicationRoles(ApplicationId applicationId); +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/ApplicationRoles.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/ApplicationRoles.java new file mode 100644 index 00000000000..de3e84ac0c3 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/ApplicationRoles.java @@ -0,0 +1,23 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.integration.aws; + +/** + * @author mortent + */ +public class ApplicationRoles { + private final String hostRole; + private final String containerRole; + + public ApplicationRoles(String hostRole, String containerRole) { + this.hostRole = hostRole; + this.containerRole = containerRole; + } + + public String hostRole() { + return hostRole; + } + + public String containerRole() { + return containerRole; + } +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/NoopApplicationRoleService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/NoopApplicationRoleService.java new file mode 100644 index 00000000000..4842389bccb --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/NoopApplicationRoleService.java @@ -0,0 +1,17 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.integration.aws; + +import com.yahoo.config.provision.ApplicationId; + +import java.util.Optional; + +/** + * @author mortent + */ +public class NoopApplicationRoleService implements ApplicationRoleService { + + @Override + public Optional<ApplicationRoles> createApplicationRoles(ApplicationId applicationId) { + return Optional.empty(); + } +} |