Skip to content

Commit

Permalink
feat: Devservice localstack port (#1155)
Browse files Browse the repository at this point in the history
* This update includes the ability to set an optional fixed port for LocalStack in Quarkus AWS DevServices.

* Fixed formatting
  • Loading branch information
dagrammy authored Mar 1, 2024
1 parent 65f5cff commit 6427b38
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ public String getSecretKey() {
.toArray(EnabledService[]::new))
.withLabel(DEV_SERVICE_LABEL, devServiceName);

localStackDevServicesBuildTimeConfig.port().ifPresent(
port -> container.setPortBindings(Collections.singletonList("%s:%s".formatted(port, PORT))));

localStackDevServicesBuildTimeConfig.initScriptsFolder().ifPresentOrElse(initScriptsFolder -> {
container.withFileSystemBind(initScriptsFolder, "/etc/localstack/init/ready.d", BindMode.READ_ONLY);
}, () -> localStackDevServicesBuildTimeConfig.initScriptsClasspath().ifPresent(resourcePath -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ public interface LocalStackDevServicesBuildTimeConfig {
* you want is not covered by the extension
*/
Map<String, DevServicesBuildTimeConfig> additionalServices();

/**
* Optional fixed port localstack will listen to.
*/
Optional<Integer> port();
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,23 @@ endif::add-copy-button-to-env-var[]
|


a|icon:lock[title=Fixed at build time] [[quarkus-aws-devservices-localstack-local-stack-dev-services-build-time-config_quarkus-aws-devservices-localstack-port]]`link:#quarkus-aws-devservices-localstack-local-stack-dev-services-build-time-config_quarkus-aws-devservices-localstack-port[quarkus.aws.devservices.localstack.port]`


[.description]
--
Optional fixed port localstack will listen to.

ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_AWS_DEVSERVICES_LOCALSTACK_PORT+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_AWS_DEVSERVICES_LOCALSTACK_PORT+++`
endif::add-copy-button-to-env-var[]
--|int
|


a|icon:lock[title=Fixed at build time] [[quarkus-aws-devservices-localstack-local-stack-dev-services-build-time-config_quarkus-aws-devservices-localstack-container-properties-container-properties]]`link:#quarkus-aws-devservices-localstack-local-stack-dev-services-build-time-config_quarkus-aws-devservices-localstack-container-properties-container-properties[quarkus.aws.devservices.localstack.container-properties]`


Expand Down

0 comments on commit 6427b38

Please sign in to comment.